示例#1
0
        public override void Execute()
        {
            if (WorkFlowContext.Canceled)
            {
                throw new WorkflowCanceledException();
            }

            _branch(this);

            do
            {
                if (WorkFlowContext.Canceled)
                {
                    throw new WorkflowCanceledException();
                }

                WorkFlowContext.RemoveInstructions(this);

                foreach (var step in Nodes)
                {
                    step.Execute();

                    if (WorkFlowContext.HasInstruction <BreakInstruction>(this))
                    {
                        break;
                    }
                }
            } while(WorkFlowContext.HasInstruction <RestartInstruction>(this));

            WorkFlowContext.RemoveInstructions(this);
        }
示例#2
0
        public override void Execute()
        {
            _branch(this);

            do
            {
                WorkFlowContext.RemoveInstructions(this);

                var step = _step();
                Result = ExecuteStep(step);
                ExecuteNodes();

                WorkFlowContext.Path.RemoveLast();
            } while(WorkFlowContext.HasInstruction <RetryInstruction>(this) || WorkFlowContext.HasInstruction <RestartInstruction>(this));

            WorkFlowContext.RemoveInstructions(this);
        }
示例#3
0
        private void ExecuteNodes()
        {
            if (WorkFlowContext.Canceled)
            {
                throw new WorkflowCanceledException();
            }

            foreach (var node in Nodes)
            {
                if (!ShouldExecuteNode(Result, node))
                {
                    continue;
                }

                node.Execute();

                if (WorkFlowContext.HasInstruction <BreakInstruction>(this))
                {
                    break;
                }
            }
        }