/// <summary> /// Creates a new workflow step and adds it to the workflow builder /// </summary> /// <typeparam name="TData"></typeparam> /// <typeparam name="TStep"></typeparam> /// <param name="workflowBuilder"></param> public static WorkflowStep <TStep> AddStep <TData, TStep>(this IWorkflowBuilder <TData> workflowBuilder) where TStep : IStepBody { var step = new WorkflowStep <TStep>(); step.Name = step.Name ?? typeof(TStep).Name; workflowBuilder.AddStep(step); return(step); }
public IStepBuilder <TData, TStep> Then <TStep>(Action <IStepBuilder <TData, TStep> > stepSetup = null) where TStep : IStepBody { WorkflowStep <TStep> step = new WorkflowStep <TStep>(); _workflowBuilder.AddStep(step); var stepBuilder = new StepBuilder <TData, TStep>(_workflowBuilder, step); if (stepSetup != null) { stepSetup.Invoke(stepBuilder); } step.Name = step.Name ?? typeof(TStep).Name; _outcome.NextStep = step.Id; return(stepBuilder); }
public IStepBuilder <TData, TStep> Then <TStep>(Action <IStepBuilder <TData, TStep> > stepSetup = null) where TStep : IStepBody { WorkflowStep <TStep> newStep = new WorkflowStep <TStep>(); _workflowBuilder.AddStep(newStep); var stepBuilder = new StepBuilder <TData, TStep>(_workflowBuilder, newStep); if (stepSetup != null) { stepSetup.Invoke(stepBuilder); } newStep.Name = newStep.Name ?? typeof(TStep).Name; Step.Outcomes.Add(new StepOutcome() { NextStep = newStep.Id }); return(stepBuilder); }