elsa-workflows / elsa-documentation

The official Elsa documentation website
elsa-documentation.vercel.app
Other
15 stars 36 forks source link

Add a Diagram to explain IWorkflowDispatcher event #84

Open jdevillard opened 2 months ago

jdevillard commented 2 months ago

The idea is to add a diagram to explain how event are fired in an implementation of the IWorkflowDispatcher :

Event can be fired when :

For example, in an custom implementation that dispatch execution in specific process (in a multi-process execution), we must know what is the order of event to ensure getting the right execution context of the workflow and not missing something.

public interface IWorkflowDispatcher
{
    /// <summary>
    /// Dispatches a request to execute the specified workflow definition.
    /// </summary>
    Task<DispatchWorkflowResponse> DispatchAsync(DispatchWorkflowDefinitionRequest request, DispatchWorkflowOptions options, CancellationToken cancellationToken = default);

    /// <summary>
    /// Dispatches a request to execute the specified workflow instance.
    /// </summary>
    Task<DispatchWorkflowResponse> DispatchAsync(DispatchWorkflowInstanceRequest request, DispatchWorkflowOptions options, CancellationToken cancellationToken = default);

    /// <summary>
    /// Starts all workflows and resumes existing workflow instances based on the specified activity type and bookmark payload.
    /// </summary>
    Task<DispatchWorkflowResponse> DispatchAsync(DispatchTriggerWorkflowsRequest request, DispatchWorkflowOptions options, CancellationToken cancellationToken = default);

    /// <summary>
    /// Resumes the workflow waiting for the specified bookmark.
    /// </summary>
    Task<DispatchWorkflowResponse> DispatchAsync(DispatchResumeWorkflowsRequest request, DispatchWorkflowOptions options, CancellationToken cancellationToken = default);
}