protected override async Task Execute(WorkflowInstance instance) { var ifHit = false; foreach (var branch in Workflows.Value.Where(x => x.Item2 != null).Where(branch => branch.Item2())) { ifHit = true; await instance.EnterWorkflow(branch.Item1); if (BreakAfterFirstTrue.Value) { break; } } if (ifHit) { return; } foreach (var branch in Workflows.Value.Where(x => x.Item2 == null)) { await instance.EnterWorkflow(branch.Item1); } }
protected override async Task Execute(WorkflowInstance instance) { while (!instance.IsCancelled && Condition.Value()) { await instance.EnterWorkflow(Create(WorkflowActivity.Value)); } }
protected virtual async Task EnterWorkflow() { if (Workflow.Value != null) { await WorkflowInstance.EnterWorkflow(Workflow.Value); } }
protected override async Task Execute(WorkflowInstance instance) { var instances = new List <WorkflowInstance>(); foreach (var workflowWithArgs in _workflows) { instances.Add(await instance.EnterWorkflow(workflowWithArgs.Item1, false, workflowWithArgs.Item2)); } await Task.WhenAll(instances.Select(i => i.Wait())); }
protected virtual async Task EnterWorkflow(WorkflowInstance instance) { await instance.EnterWorkflow(Workflow.Value); }