コード例 #1
0
        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);
            }
        }
コード例 #2
0
ファイル: WhileWorkflow.cs プロジェクト: laniatech/Lightwork
 protected override async Task Execute(WorkflowInstance instance)
 {
     while (!instance.IsCancelled && Condition.Value())
     {
         await instance.EnterWorkflow(Create(WorkflowActivity.Value));
     }
 }
コード例 #3
0
 protected virtual async Task EnterWorkflow()
 {
     if (Workflow.Value != null)
     {
         await WorkflowInstance.EnterWorkflow(Workflow.Value);
     }
 }
コード例 #4
0
        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()));
        }
コード例 #5
0
 protected virtual async Task EnterWorkflow(WorkflowInstance instance)
 {
     await instance.EnterWorkflow(Workflow.Value);
 }