Skip to content

Entities

Entities supporting workflows must implement ISupportsWorkflow interface, providing the required information as the interface contract oblige to. There is an additional requirement for workflow entities, which is to provide a parameterless constructor.

You create an entity by extending from BaseWorkflowStateMachineInstance class, which provides the properties required by workflow entities, as the example shows here below:

C#
public class ServiceOrder : BaseWorkflowStateMachineInstance
{
    public ServiceOrder()
    {
    }

    public ServiceOrder(Guid correlationId)
    {
        this.CorrelationId = correlationId;
    }
}

Note

Bear in mind that by extending from BaseWorkflowStateMachineInstance, which implements

ISupportsWorkflow, the framework will be mapping the interface contract properties to EntityFramework for you.