Skip to content

Add components overview #810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Each running workflow is persisted to the chosen persistence provider between ea

## Host

The workflow host is the service responsible for executing workflows. It does this by polling the persistence provider for workflow instances that are ready to run, executes them and then passes them back to the persistence provider to by stored for the next time they are run. It is also responsible for publishing events to any workflows that may be waiting on one.
The workflow host is the service responsible for executing workflows. It does this by polling the persistence provider for workflow instances that are ready to run, executes them and then passes them back to the persistence provider to be stored for the next time they are run. It is also responsible for publishing events to any workflows that may be waiting on one.

### Setup

Expand All @@ -114,6 +114,16 @@ Console.ReadLine();
host.Stop();
```

## Registry

The registry contains workflow definitions which have been registered. When starting a workflow, the workflow host creates a new instance for the desired workflow definition.


## Persistence

The persistence provider persists internal data which allows to resume workflows. Part of this are execution pointers which are created for every step that is visited during the execution of a workflow. They hold information about the outcome of the step and thus also indicate which step has to be run next.


## Passing data between steps

Each step is intended to be a black-box, therefore they support inputs and outputs. These inputs and outputs can be mapped to a data class that defines the custom data relevant to each workflow instance.
Expand Down
21 changes: 20 additions & 1 deletion src/WorkflowCore/Interface/IWorkflowHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,33 @@ public interface IWorkflowHost : IWorkflowController, IActivityController, IHost
/// </summary>
void Stop();


/// <summary>
/// Fires events when an error is thrown in a workflow step.
/// </summary>
event StepErrorEventHandler OnStepError;

/// <summary>
/// Fires events on workflow and step lifecycle changes like started and completed steps/workflows
/// and workflow errors.
/// </summary>
event LifeCycleEventHandler OnLifeCycleEvent;
void ReportStepError(WorkflowInstance workflow, WorkflowStep step, Exception exception);

//public dependencies to allow for extension method access

/// <summary>
/// Persists workflow data like workflow status and events.
/// </summary>
IPersistenceProvider PersistenceStore { get; }

/// <summary>
/// Provides locks for resources in the persistence store to ensure exclusive access.
/// </summary>
IDistributedLockProvider LockProvider { get; }

/// <summary>
/// Contains the workflow definitions which are used for creating workflow instances.
/// </summary>
IWorkflowRegistry Registry { get; }
WorkflowOptions Options { get; }
IQueueProvider QueueProvider { get; }
Expand Down