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 }); } }
public static void RemovePendingJob(Guid id) { var instance = Builder.CreateRetrieveRepository().GetById <WorkflowContextBase>(id); Builder.CreateWorkflowRepository().DeleteWorkflowContextBase(instance); }