public void ClearTimersIgnore()
 {
     using (NpgsqlConnection connection = new NpgsqlConnection(ConnectionString))
     {
         WorkflowProcessTimer.ClearTimersIgnore(connection);
     }
 }
 public void ClearTimer(Guid timerId)
 {
     using (NpgsqlConnection connection = new NpgsqlConnection(ConnectionString))
     {
         WorkflowProcessTimer.Delete(connection, timerId);
     }
 }
Exemple #3
0
        public void RegisterTimer(Guid processId, string name, DateTime nextExecutionDateTime, bool notOverrideIfExists)
        {
            using (var context = CreateContext())
            {
                var oldTimer =
                    context.WorkflowProcessTimers.SingleOrDefault(wpt => wpt.ProcessId == processId && wpt.Name == name);

                if (oldTimer == null)
                {
                    oldTimer = new WorkflowProcessTimer()
                    {
                        Id   = Guid.NewGuid(),
                        Name = name,
                        NextExecutionDateTime = nextExecutionDateTime,
                        ProcessId             = processId
                    };

                    oldTimer.Ignore = false;

                    context.WorkflowProcessTimers.InsertOnSubmit(oldTimer);
                }

                if (!notOverrideIfExists)
                {
                    oldTimer.NextExecutionDateTime = nextExecutionDateTime;
                }

                context.SubmitChanges();
            }
        }
 public void ClearTimers(Guid processId, List <string> timersIgnoreList)
 {
     using (NpgsqlConnection connection = new NpgsqlConnection(ConnectionString))
     {
         WorkflowProcessTimer.DeleteByProcessId(connection, processId, timersIgnoreList);
     }
 }
Exemple #5
0
 public void ClearTimerIgnore(Guid timerId)
 {
     using (var connection = new SqlConnection(ConnectionString))
     {
         WorkflowProcessTimer.ClearTimerIgnore(connection, timerId);
     }
 }
        public void RegisterTimer(Guid processId, string name, DateTime nextExecutionDateTime, bool notOverrideIfExists)
        {
            using (var session = Store.OpenSession())
            {
                var oldTimer =
                    session.Query <WorkflowProcessTimer>().SingleOrDefault(wpt => wpt.ProcessId == processId && wpt.Name == name);

                if (oldTimer == null)
                {
                    oldTimer = new WorkflowProcessTimer()
                    {
                        Id   = Guid.NewGuid(),
                        Name = name,
                        NextExecutionDateTime = nextExecutionDateTime,
                        ProcessId             = processId
                    };

                    oldTimer.Ignore = false;

                    session.Store(oldTimer);
                }

                if (!notOverrideIfExists)
                {
                    oldTimer.NextExecutionDateTime = nextExecutionDateTime;
                }

                session.SaveChanges();
            }
        }
Exemple #7
0
        public void RegisterTimer(Guid processId, string name, DateTime nextExecutionDateTime, bool notOverrideIfExists)
        {
            var dbcoll = Store.GetCollection <WorkflowProcessTimer>(MongoDBConstants.WorkflowProcessTimerCollectionName);
            var timer  = dbcoll.FindOne(Query <WorkflowProcessTimer> .Where(item => item.ProcessId == processId && item.Name == name));

            if (timer == null)
            {
                timer = new WorkflowProcessTimer()
                {
                    Id   = Guid.NewGuid(),
                    Name = name,
                    NextExecutionDateTime = nextExecutionDateTime,
                    ProcessId             = processId
                };

                timer.Ignore = false;
                dbcoll.Insert(timer);
            }

            if (!notOverrideIfExists)
            {
                timer.NextExecutionDateTime = nextExecutionDateTime;
                dbcoll.Save(timer);
            }
        }
        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
                    };

                    timer.Ignore = false;
                    timer.Insert(connection);
                }

                if (!notOverrideIfExists)
                {
                    timer.NextExecutionDateTime = nextExecutionDateTime;
                    timer.Update(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 void ClearTimersIgnore()
 {
     using (OracleConnection connection = new OracleConnection(ConnectionString))
     {
         WorkflowProcessTimer.ClearTimersIgnore(connection);
         WorkflowProcessTimer.Commit(connection);
     }
 }
 public void ClearTimer(Guid timerId)
 {
     using (OracleConnection connection = new OracleConnection(ConnectionString))
     {
         WorkflowProcessTimer.Delete(connection, timerId);
         WorkflowProcessTimer.Commit(connection);
     }
 }
Exemple #12
0
 public IEnumerable <ProcessTimer> GetTimersForProcess(Guid processId)
 {
     using (var connection = new SqlConnection(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 (OracleConnection connection = new OracleConnection(ConnectionString))
            {
                var timer = WorkflowProcessTimer.GetCloseExecutionTimer(connection);
                if (timer == null)
                {
                    return(null);
                }

                return(timer.NextExecutionDateTime);
            }
        }
        public List <TimerToExecute> GetTimersToExecute()
        {
            var now = _runtime.RuntimeDateTimeNow;

            using (NpgsqlConnection 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());
            }
        }
Exemple #16
0
        public void DeleteProcess(Guid processId)
        {
            using (SqlConnection connection = new SqlConnection(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();
                }
            }
        }
 partial void InsertWorkflowProcessTimer(WorkflowProcessTimer instance);
 partial void DeleteWorkflowProcessTimer(WorkflowProcessTimer instance);
 partial void UpdateWorkflowProcessTimer(WorkflowProcessTimer instance);