Class ActivityFlowRunner
Represents an execution of a activity flow.
Inheritance
Inherited Members
Namespace: Mediachase.Commerce.Engine
Assembly: Mediachase.Commerce.dll
Version: 10.8.0Syntax
public class ActivityFlowRunner
Constructors
ActivityFlowRunner()
Initializes a new instance of the ActivityFlowRunner class.
Declaration
public ActivityFlowRunner()
ActivityFlowRunner(ActivityFlowContext)
Initializes a new instance of the ActivityFlowRunner class.
Declaration
public ActivityFlowRunner(ActivityFlowContext context)
Parameters
Type | Name | Description |
---|---|---|
ActivityFlowContext | context |
Properties
Context
Gets the ActivityFlowContext associated with the activity flow.
Declaration
public ActivityFlowContext Context { get; }
Property Value
Type | Description |
---|---|
ActivityFlowContext |
Methods
Do<T>()
Adds an activity as a step to the execution of activity flow.
Declaration
public ActivityFlowRunner Do<T>()
where T : Activity
Returns
Type | Description |
---|---|
ActivityFlowRunner | The execution of activity flow. |
Type Parameters
Name | Description |
---|---|
T | The activity class, it must be inherited from Activity class. |
Else()
Creates an execution of an Else flow in the current activity flow.
Declaration
public ActivityFlowRunner Else()
Returns
Type | Description |
---|---|
ActivityFlowRunner | The execution of Else flow. |
EndIf()
Creates an execution of EndIf flow in the current activity flow.
Declaration
public ActivityFlowRunner EndIf()
Returns
Type | Description |
---|---|
ActivityFlowRunner | The execution of EndIf flow. |
Execute()
Executes an activity flow.
Declaration
public bool Execute()
Returns
Type | Description |
---|---|
System.Boolean |
If(Func<Boolean>)
Creates an execution of an If flow in the current activity flow.
Declaration
public ActivityFlowRunner If(Func<bool> condition)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.Boolean> | condition | The condition function of the If flow. |
Returns
Type | Description |
---|---|
ActivityFlowRunner | The execution of If flow. |
On(String, EventHandler)
Adds a handler for an event provided by the activity linked to the last step. The activity flow execution will listen on this event and handle it.
Declaration
public ActivityFlowRunner On(string eventName, EventHandler handler)
Parameters
Type | Name | Description |
---|---|---|
System.String | eventName | The name of the event. |
System.EventHandler | handler | The handler of the event. |
Returns
Type | Description |
---|---|
ActivityFlowRunner |