Skip to content

Latest commit

 

History

History
31 lines (27 loc) · 849 Bytes

File metadata and controls

31 lines (27 loc) · 849 Bytes

Looping through workflow steps sample

Illustrates how to create a workflow that loops.

public class SimpleDecisionWorkflow : IWorkflow
{
    public void Build(IWorkflowBuilder<object> builder)
    {
        builder
            .StartWith<HelloWorld>()
            .Then<RandomOutput>(randomOutput =>
            {
                randomOutput
                    .When(0)
                        .Then<CustomMessage>(cm =>
                        {
                            cm.Name("Print custom message");
                            cm.Input(step => step.Message, data => "Looping back....");
                        })
                        .Then(randomOutput);  //loop back to randomOutput

                randomOutput
                    .When(1)
                        .Then<GoodbyeWorld>();
            });
    }
	...
}