public IWorkflowBlueprint Build(IWorkflow workflow, string activityIdPrefix) { var workflowTypeName = workflow.GetType().Name; Name ??= workflowTypeName; DisplayName ??= workflowTypeName; WithId(workflowTypeName); workflow.Build(this); return(BuildBlueprint(activityIdPrefix)); }
void RemoveWorkflow() { //stop the current workflow IWorkflow current = null; if (!_workflows.TryDequeue(out current)) { return; } current.StopWorkflow(); //remove old workflows no longer active var pruning = true; while (pruning) { if (!_workflows.TryPeek(out current)) { return; } if (current != Get(current.GetType())) { _workflows.TryDequeue(out current); } else { pruning = false; } } //start the next workflow if (!_workflows.TryPeek(out current)) { return; } current.StartWorkflow(new WorkflowManager(() => Remove(current as IBehavior))); }
public void Execute(IWorkflow <string> workflow, StateChangeEventArgs <string> transition) { Console.WriteLine("Mail action executed: {0}. Context: {1}", workflow.GetType().Name, workflow.Context.GetType().Name); }
public ElsaOptionsBuilder AddWorkflow(IWorkflow workflow) { Services.AddSingleton(workflow); ElsaOptions.WorkflowFactory.Add(workflow.GetType(), workflow); return(this); }
public void Execute(IWorkflow <string, Customer> workflow, WorkflowTransition <string, Customer> transition) { WriteLine($"ActionThree action executed: {workflow.GetType().Name}. Context Object: {workflow.Context.GetType().Name}"); }