public void RegisterTimer(Guid processId, string name, DateTime nextExecutionDateTime, bool notOverrideIfExists) { using (OracleConnection connection = new OracleConnection(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); } WorkflowProcessTimer.Commit(connection); } }
public void ClearTimer(Guid timerId) { using (OracleConnection connection = new OracleConnection(ConnectionString)) { WorkflowProcessTimer.Delete(connection, timerId); WorkflowProcessTimer.Commit(connection); } }
public void ClearTimersIgnore() { using (OracleConnection connection = new OracleConnection(ConnectionString)) { WorkflowProcessTimer.ClearTimersIgnore(connection); WorkflowProcessTimer.Commit(connection); } }
public void ClearTimers(Guid processId, List <string> timersIgnoreList) { using (OracleConnection connection = new OracleConnection(ConnectionString)) { WorkflowProcessTimer.DeleteByProcessId(connection, processId, timersIgnoreList); WorkflowProcessTimer.Commit(connection); } }
public DateTime?GetCloseExecutionDateTime() { using (var connection = new OracleConnection(ConnectionString)) { var timer = WorkflowProcessTimer.GetCloseExecutionTimer(connection); return(timer != null ? timer.NextExecutionDateTime : (DateTime?)null); } }
public IEnumerable <ProcessTimer> GetTimersForProcess(Guid processId) { using (var connection = new OracleConnection(ConnectionString)) { var timers = WorkflowProcessTimer.SelectByProcessId(connection, processId); return(timers.Select(t => new ProcessTimer { Name = t.Name, NextExecutionDateTime = t.NextExecutionDateTime })); } }
public DateTime?GetCloseExecutionDateTime() { using (OracleConnection connection = new OracleConnection(ConnectionString)) { var timer = WorkflowProcessTimer.GetCloseExecutionTimer(connection); if (timer == null) { return(null); } return(timer.NextExecutionDateTime); } }
public void DeleteProcess(Guid processId) { using (OracleConnection connection = new OracleConnection(ConnectionString)) { WorkflowProcessInstance.Delete(connection, processId); WorkflowProcessInstanceStatus.Delete(connection, processId); WorkflowProcessInstancePersistence.DeleteByProcessId(connection, processId); WorkflowProcessTransitionHistory.DeleteByProcessId(connection, processId); WorkflowProcessTimer.DeleteByProcessId(connection, processId); WorkflowProcessInstance.Commit(connection); } }
public List <TimerToExecute> GetTimersToExecute() { var now = _runtime.RuntimeDateTimeNow; using (OracleConnection connection = new OracleConnection(ConnectionString)) { var timers = WorkflowProcessTimer.GetTimersToExecute(connection, now); WorkflowProcessTimer.SetIgnore(connection, timers); WorkflowProcessTimer.Commit(connection); return(timers.Select(t => new TimerToExecute() { Name = t.Name, ProcessId = t.ProcessId, TimerId = t.Id }).ToList()); } }