Interface IRaisedWorkflowEventConfiguration
- Namespace
- Acuit.Pinpoint.Workflows.Workstation
- Assembly
- Acuit.Pinpoint.Workflows.Workstation.dll
Configuration for an event being raised, allowing additional interactions with the executing workflow.
[Obsolete("This is deprecated and will be removed in a future version.")]
public interface IRaisedWorkflowEventConfiguration
Properties
WorkflowHostCreatedCallback
Gets or sets a callback that provides a WorkflowHost within which the workflow event handler will be executed.
Action<WorkflowHost> WorkflowHostCreatedCallback { get; set; }
Property Value
Remarks
If this is set to a non-null value, then the workflow event handler will be executed within a WorkflowHost workflow host, and this delegate will be called after creating the WorkflowHost to execute a workflow event handler. If this is null, then the workflow event handler will be invoked directly, without creating a WorkflowHost.
Using a workflow host enables the following:
- Accessing the DataContext property (e.g., to hook it up to a user interface).
- 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 no WorkflowHost will be created and this callback will not be called.
Note that creating the workflow host also starts executing the workflow, so this event will be raised after the initial synchronous part of the workflow has already executed. This means that workflows that complete synchronously will already be completed when this event is raised.
The WorkflowHost parameter provided to the callback should only be used while the workflow event handler is executing, between when the callback occurs and when the workflow event handler completes. As soon as the workflow event handler completes, the WorkflowHost instance will be disposed.