Class DefaultWorkflowProcessor
The default implementation of the IWorkflowProcessor service contract.
Inherited Members
Namespace: Kephas.Workflow
Assembly: Kephas.Workflow.dll
Syntax
[OverridePriority(Priority.Low)]
public class DefaultWorkflowProcessor : Loggable, ILoggable, IWorkflowProcessor
Constructors
| Improve this Doc View SourceDefaultWorkflowProcessor(ICompositionContext, ICollection<IExportFactory<IActivityBehavior, ActivityBehaviorMetadata>>)
Initializes a new instance of the DefaultWorkflowProcessor class.
Declaration
public DefaultWorkflowProcessor(ICompositionContext compositionContext, ICollection<IExportFactory<IActivityBehavior, ActivityBehaviorMetadata>> behaviorFactories)
Parameters
Type | Name | Description |
---|---|---|
ICompositionContext | compositionContext | Context for the composition. |
System.Collections.Generic.ICollection<IExportFactory<IActivityBehavior, ActivityBehaviorMetadata>> | behaviorFactories | The behavior factories. |
Properties
| Improve this Doc View SourceCompositionContext
Gets a context for the composition.
Declaration
public ICompositionContext CompositionContext { get; }
Property Value
Type | Description |
---|---|
ICompositionContext | The composition context. |
Methods
| Improve this Doc View SourceApplyAfterExecuteBehaviorsAsync(IEnumerable<IActivityBehavior>, IActivityContext, CancellationToken)
Applies the behaviors invoking the AfterExecuteAsync(IActivityContext, CancellationToken) asynchronously.
Declaration
protected virtual Task ApplyAfterExecuteBehaviorsAsync(IEnumerable<IActivityBehavior> behaviors, IActivityContext context, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<IActivityBehavior> | behaviors | The behaviors. |
IActivityContext | context | The execution context. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | An asynchronous result. |
ApplyBeforeExecuteBehaviorsAsync(IEnumerable<IActivityBehavior>, IActivityContext, CancellationToken)
Applies the behaviors invoking the BeforeExecuteAsync(IActivityContext, CancellationToken) asynchronously.
Declaration
protected virtual Task ApplyBeforeExecuteBehaviorsAsync(IEnumerable<IActivityBehavior> behaviors, IActivityContext context, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<IActivityBehavior> | behaviors | The behaviors. |
IActivityContext | context | The execution context. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | An asynchronous result. |
ExecuteAsync(IActivity, Object, IExpando, IActivityContext, CancellationToken)
Executes the activity asynchronously, enabling the activity execution behaviors.
Declaration
public Task<object> ExecuteAsync(IActivity activity, object target, IExpando arguments, IActivityContext context, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IActivity | activity | The activity to execute. |
System.Object | target | The activity target. |
IExpando | arguments | The execution arguments. |
IActivityContext | context | The execution context. |
System.Threading.CancellationToken | cancellationToken | Optional. The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Object> | A promise of the execution result. |
GetActivityInfo(IActivity, IActivityContext)
Gets the IActivityInfo for the activity to execute.
Declaration
protected virtual IActivityInfo GetActivityInfo(IActivity activity, IActivityContext activityContext)
Parameters
Type | Name | Description |
---|---|---|
IActivity | activity | The activity to execute. |
IActivityContext | activityContext | Context for the activity. |
Returns
Type | Description |
---|---|
IActivityInfo | The activity information. |
GetExecutionArgumentsAsync(IActivityInfo, IExpando, IActivityContext, CancellationToken)
Gets the activity arguments asynchronously.
Declaration
protected virtual Task<IExpando> GetExecutionArgumentsAsync(IActivityInfo activityInfo, IExpando input, IActivityContext activityContext, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IActivityInfo | activityInfo | Information describing the activity. |
IExpando | input | The input. |
IActivityContext | activityContext | Context for the activity. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IExpando> | An asynchronous result that yields the activity arguments. |
GetOrderedBehaviors(IActivityInfo, IActivityContext)
Gets the behaviors for execution.
Declaration
protected virtual (IEnumerable<IActivityBehavior> behaviors, IEnumerable<IActivityBehavior> reversedBehaviors)GetOrderedBehaviors(IActivityInfo activityInfo, IActivityContext context)
Parameters
Type | Name | Description |
---|---|---|
IActivityInfo | activityInfo | Information describing the activity. |
IActivityContext | context | The execution context. |
Returns
Type | Description |
---|---|
System.ValueTuple<System.Collections.Generic.IEnumerable<IActivityBehavior>, System.Collections.Generic.IEnumerable<IActivityBehavior>> | An enumerator that allows foreach to be used to process the behaviors in this collection. |