コード例 #1
0
 public IWorkflowExecutionResult Cancel(WorkflowContextBase pendingWorkflow)
 {
     try
     {
         Builder.CreateWorkflowRepository().DeleteWorkflowContextBase(pendingWorkflow);
         return(new WorkflowExecutionResult {
             Context = pendingWorkflow, Status = WorkflowStatus.Cancelled
         });
     }
     catch (Exception e)
     {
         log4net.LogManager.GetLogger(GetType()).Error($"Error cancelling pending Workflow '{pendingWorkflow?.Name}' !", e);
         return(new WorkflowExecutionResult {
             Context = pendingWorkflow, Status = WorkflowStatus.Failed
         });
     }
 }
コード例 #2
0
        public static void RemovePendingJob(Guid id)
        {
            var instance = Builder.CreateRetrieveRepository().GetById <WorkflowContextBase>(id);

            Builder.CreateWorkflowRepository().DeleteWorkflowContextBase(instance);
        }