-
Notifications
You must be signed in to change notification settings - Fork 0
Workflow.cs
This code defines a class named Workflow
, which inherits from Dictionary<string, object>
. This class is part of the Marionette.Workflow
namespace.
The Workflow
class has the following private fields:
-
_actions
: An array ofFunc<object, object>
instances that represent the actions to be executed in the workflow. -
_isRunning
: A boolean that indicates whether the workflow is currently running. -
_currentAction
: An integer that represents the index of the current action in the list of actions. -
_iterator
: An array of objects that represents the items in the current iterator.
The Workflow
class has the following public methods:
-
Workflow()
: A constructor that initializes the_actions
,_isRunning
, and_currentAction
fields. -
CreateSequence(Func<object, object>[] actions)
: A method that creates a sequence of actions to be executed in the workflow. It takes an array ofFunc<object, object>
instances as a parameter and returns an instance ofWorkflow
. -
JumpTo(string label)
: A method that jumps to the specified label in the sequence of actions. It takes alabel
parameter that specifies the label to jump to and returns an instance ofWorkflow
. -
Execute()
: A method that executes the sequence of actions in the workflow. It returns an instance ofWorkflow
. -
Return<TInterface>(string alias)
: A generic method that returns the output of the specified action as an instance of the specified interface. It takes analias
parameter that specifies the alias of the action to return the output of.
This class is used to define a workflow that consists of a sequence of actions to be executed in a specific order. The CreateSequence
method is used to define the sequence of actions, while the JumpTo
method is used to jump to a specific action in the sequence. The Execute
method is used to execute the sequence of actions, while the Return
method is used to return the output of a specific action in the sequence. The Workflow
class inherits from Dictionary<string, object>
, allowing it to store the output of each action in the sequence using an alias.