Class RaisedWorkflowEventOptions
- Namespace
- Acuit.Pinpoint.Workflows.Workstation
- Assembly
- Acuit.Pinpoint.Workflows.Workstation.dll
Options for a raised workflow event.
public class RaisedWorkflowEventOptions
- Inheritance
-
RaisedWorkflowEventOptions
- Inherited Members
Properties
DefaultWorkflow
Gets or sets the default workflow handler, or null if there is none.
public IActivity DefaultWorkflow { get; set; }
Property Value
DefaultWorkflowOptions
Gets or sets optional default workflow event handler options.
public WorkflowEventHandlerOptions DefaultWorkflowOptions { get; set; }
Property Value
ParameterValueProvider
Gets or sets an optional parameter value provider to provide additional parameters to any workflow executed in response to this event.
public IParameterValueProvider ParameterValueProvider { get; set; }
Property Value
ServiceProvider
Gets or sets an optional service provider to provide additional services to any workflow executed in response to this event.
public IServiceProvider ServiceProvider { get; set; }
Property Value
WorkflowHostCreator
Gets or sets an optional callback that creates a workflow host within which a workflow handler should execute.
public Func<IActivity, IParameterValueProvider, IServiceProvider, WorkflowHost> WorkflowHostCreator { get; set; }
Property Value
Remarks
If this is set, then the workflow event handler will be executed within the WorkflowHost returned by the callback. If this is null, then the workflow event handler will be invoked via WorkflowInvoker, without creating a WorkflowHost.
The parameters provided to this callback should be used to create the WorkflowHost via WorkflowHost(IActivity, IParameterValueProvider, IServiceProvider).
The event raiser owns the created WorkflowHost and is responsible for disposing it.
Using a workflow host enables:
- Accessing the DataContext property (e.g., to hook it up to a user interface). Because the event raiser controls the lifetime of the WorkflowHost, it can continue to use DataContext even after the workflow completes its execution.
- Raising events for the executing workflow via RaiseEvent<TEvent>(TEvent).
- Requesting cancellation via RequestCancel(). (Note that the cancellation token passed to RaiseEventAsync(WorkflowEvent, IActivity, WorkflowEventHandlerOptions, IParameterValueProvider, IServiceProvider, Action<IRaisedWorkflowEventConfiguration>, CancellationToken) can also be used to request cancellation.)
When this is set, the callback will only be executed if either a workflow event handler has been added for the event or a default workflow is provided when the event was raised. If no workflow will execute in response to the workflow event, then this callback will not be called.
Note that creating the workflow host also starts executing the workflow.