예제 #1
0
        public WorkflowAction Resume(WorkflowSignaledEvent signal)
        {
            Ensure.NotNull(signal, nameof(signal));
            var waitEvent = WaitForSignalsEvent(signal.SignalName);

            if (waitEvent == null)
            {
                throw new SignalResumeException($"Workflow item {Identity} is not waiting for signal {signal.SignalName}");
            }
            WorkflowDecision decision = null;

            if (waitEvent.HasTimedout(signal))
            {
                decision = waitEvent.RecordTimedout(signal);
            }
            else
            {
                decision = waitEvent.RecordSignal(signal);
            }

            var recordedAction = WorkflowAction.Custom(decision);

            if (waitEvent.IsExpectingSignals)
            {
                return(recordedAction);
            }

            return(waitEvent.NextAction(this) + recordedAction);
        }
예제 #2
0
 private WorkflowAction(WorkflowDecision workflowDecision)
     : this(new [] { workflowDecision })
 {
 }