예제 #1
0
        /// <summary>
        /// Reschedule the item, associated with passed event.
        /// </summary>
        /// <param name="workflowItemEvent"></param>
        /// <returns></returns>
        protected ScheduleWorkflowItemAction Reschedule(WorkflowItemEvent workflowItemEvent)
        {
            Ensure.NotNull(workflowItemEvent, "workflowItemEvent");
            var workflowItem = _allWorkflowItems.WorkflowItemFor(workflowItemEvent);

            return(WorkflowAction.Schedule(workflowItem));
        }
예제 #2
0
 public override WorkflowAction NextAction(WorkflowItem workflowItem)
 {
     if (_data.NextAction == SignalNextAction.Continue)
     {
         return(WorkflowAction.ContinueWorkflow(workflowItem));
     }
     return(WorkflowAction.Schedule(workflowItem));
 }
예제 #3
0
        public static TimerItem Reschedule(WorkflowItem ownerItem, Identity identity, IWorkflow workflow)
        {
            var timerItem = new TimerItem(identity, workflow);

            timerItem._rescheduleTimer = timerItem;
            timerItem.OnStartFailure(e => WorkflowAction.FailWorkflow("RESCHEDULE_TIMER_START_FAILED", e.Cause));
            timerItem.OnCancelled(e => WorkflowAction.CancelWorkflow("RESCHEDULE_TIMER_CANCELLED"));
            timerItem.OnFailedCancellation(e => WorkflowAction.FailWorkflow("RESCHEDULE_TIMER_CANCELLATION_FAILED", e.Cause));
            timerItem.OnFired(e => WorkflowAction.Schedule(ownerItem));
            return(timerItem);
        }
예제 #4
0
        public static TimerItem Reschedule(WorkflowItem ownerItem, ScheduleId scheduleId, IWorkflow workflow)
        {
            var identity  = Identity.New(scheduleId.Name, scheduleId.Version, scheduleId.PositionalName);
            var timerItem = new TimerItem(identity, scheduleId, workflow);

            timerItem._rescheduleTimer = timerItem;
            timerItem.OnStartFailed(e => WorkflowAction.FailWorkflow("RESCHEDULE_TIMER_START_FAILED", e.Cause));
            timerItem.OnCancellationFailed(e => WorkflowAction.FailWorkflow("RESCHEDULE_TIMER_CANCELLATION_FAILED", e.Cause));
            timerItem.OnFired(e => WorkflowAction.Schedule(ownerItem));
            return(timerItem);
        }