public void ClearTimersIgnore() { using (var connection = new NpgsqlConnection(ConnectionString)) { WorkflowProcessTimer.ClearTimersIgnore(connection); } }
public void ClearTimer(Guid timerId) { using (var connection = new NpgsqlConnection(ConnectionString)) { WorkflowProcessTimer.Delete(connection, timerId); } }
public void ClearTimers(Guid processId, List <string> timersIgnoreList) { using (var connection = new NpgsqlConnection(ConnectionString)) { WorkflowProcessTimer.DeleteByProcessId(connection, processId, timersIgnoreList); } }
public void RegisterTimer(Guid processId, string name, DateTime nextExecutionDateTime, bool notOverrideIfExists) { using (var connection = new NpgsqlConnection(ConnectionString)) { var timer = WorkflowProcessTimer.SelectByProcessIdAndName(connection, processId, name); if (timer == null) { timer = new WorkflowProcessTimer { Id = Guid.NewGuid(), Name = name, NextExecutionDateTime = nextExecutionDateTime, ProcessId = processId, Ignore = false }; timer.Insert(connection); } else if (!notOverrideIfExists) { timer.NextExecutionDateTime = nextExecutionDateTime; timer.Update(connection); } } }
public IEnumerable <ProcessTimer> GetTimersForProcess(Guid processId) { using (var connection = new NpgsqlConnection(ConnectionString)) { var timers = WorkflowProcessTimer.SelectByProcessId(connection, processId); return(timers.Select(t => new ProcessTimer { Name = t.Name, NextExecutionDateTime = t.NextExecutionDateTime })); } }
public void DeleteProcess(Guid processId) { using (NpgsqlConnection connection = new NpgsqlConnection(ConnectionString)) { WorkflowProcessInstance.Delete(connection, processId); WorkflowProcessInstanceStatus.Delete(connection, processId); WorkflowProcessInstancePersistence.DeleteByProcessId(connection, processId); WorkflowProcessTransitionHistory.DeleteByProcessId(connection, processId); WorkflowProcessTimer.DeleteByProcessId(connection, processId); } }
public DateTime?GetCloseExecutionDateTime() { using (var connection = new NpgsqlConnection(ConnectionString)) { var timer = WorkflowProcessTimer.GetCloseExecutionTimer(connection); if (timer == null) { return(null); } return(timer.NextExecutionDateTime); } }
public List <TimerToExecute> GetTimersToExecute() { var now = _runtime.RuntimeDateTimeNow; using (var connection = new NpgsqlConnection(ConnectionString)) { var timers = WorkflowProcessTimer.GetTimersToExecute(connection, now); WorkflowProcessTimer.SetIgnore(connection, timers); return(timers.Select(t => new TimerToExecute() { Name = t.Name, ProcessId = t.ProcessId, TimerId = t.Id }).ToList()); } }
public void DeleteProcess(Guid processId) { using (var connection = new NpgsqlConnection(ConnectionString)) { connection.Open(); using (var transaction = connection.BeginTransaction()) { WorkflowProcessInstance.Delete(connection, processId, transaction); WorkflowProcessInstanceStatus.Delete(connection, processId, transaction); WorkflowProcessInstancePersistence.DeleteByProcessId(connection, processId, transaction); WorkflowProcessTransitionHistory.DeleteByProcessId(connection, processId, transaction); WorkflowProcessTimer.DeleteByProcessId(connection, processId, null, transaction); transaction.Commit(); } } }