Package: MyToolkit (PCL)
Platforms: All (PCL)

A workflow activity describes one state of a workflow definition. Important: An activity must not contain instance state, the properties of activities are parameters which belong to the definition and which parameterize all instances.


The idea of the WorkflowActivityBase class is to inherit from it and override the PrepareAsync or CompleteAsync methods:

public class MockActivity : WorkflowActivityBase
    public override Task<WorkflowActivityResult> CompleteAsync(WorkflowInstance instance,
        WorkflowDefinition definition, WorkflowActivityArguments args, 
        CancellationToken cancellationToken)
        // TODO: Add your logic here
        return Task.FromResult(new WorkflowActivityResult(true));

The CompleteAsync method has to return a WorkflowActivityResult object which contains the description of the next activities, a value indicating whether the execution was successful and a custom result value.

TODO: Describe PrepareAsync method

Last edited Jul 30, 2014 at 6:13 PM by rsuter, version 3