コード例 #1
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);
        }
コード例 #2
0
 /// <summary>
 /// Cancel the workflow. It will cause the workflow to be closed immediately on Amazon SWF with cancelled status.
 /// </summary>
 /// <param name="details"></param>
 /// <returns></returns>
 protected static WorkflowAction CancelWorkflow(string details)
 {
     return(WorkflowAction.CancelWorkflow(details));
 }