Esempio n. 1
0
 public void Remove(UserTask userTask)
 {
     using (var session = sessionFactory.OpenSession())
     {
         session.Delete(FindTask(userTask.TaskIdentifier, userTask.WorkflowInstanceIdentifier));
     }
 }
Esempio n. 2
0
        public void Remove(UserTask userTask)
        {
            if (!tasks.ContainsKey(userTask.WorkflowInstanceIdentifier))
            {
                return;
            }

            tasks[userTask.WorkflowInstanceIdentifier].Remove(userTask);
        }
Esempio n. 3
0
 public void Remove(UserTask userTask)
 {
     graphClient.Cypher.Match("(t:Task)")
                .Where("t.TaskIdentifier={name}")
                .AndWhere("t.WorkflowInstanceIdentifier={id}")
                .OptionalMatch("()-[r]->(t)")
                .WithParams(new
                {
                    name = userTask.TaskIdentifier,
                    id = userTask.WorkflowInstanceIdentifier
                }).Delete("t, r").ExecuteWithoutResults();
 }
Esempio n. 4
0
 public void Add(UserTask userTask)
 {
     
     graphClient.Cypher.Match("(e:Execution {Identifier: {id}})")
         .Merge("(e)-[:HAS_TASK]->(t:Task)")
         .Set("t = {task}")
         .WithParams(new
         {
             id = userTask.ExecutionIdentifier,
             task = userTask
         })
         .ExecuteWithoutResults();
 }
Esempio n. 5
0
 public void Add(UserTask userTask)
 {
     IList<UserTask> userTasks;
     if (tasks.TryGetValue(userTask.WorkflowInstanceIdentifier, out userTasks))
     {
         userTasks.Add(userTask);
     }
     else
     {
         userTasks = new List<UserTask>();
         userTasks.Add(userTask);
         tasks.Add(userTask.WorkflowInstanceIdentifier, userTasks);
     }
 }
Esempio n. 6
0
        public void Add(UserTask userTask)
        {
            using (var session = sessionFactory.OpenSession())
            {
                var entity = new UserTaskModel
                {
                    TaskIdentifier = userTask.TaskIdentifier,
                    ExecutionIdentifier = userTask.ExecutionIdentifier,
                    WorkflowInstanceIdentifier = userTask.WorkflowInstanceIdentifier
                };

                session.SaveOrUpdate(entity);
                session.Flush();
            }
        }
Esempio n. 7
0
        public void Complete(UserTask task)
        {
            IExecution execution = persistenceProvider.LoadExecution(task.ExecutionIdentifier, serviceLocator.GetInstance<IExecutionPlan>());
            if (execution == null)
            {
                throw new InvalidOperationException(string.Format("Execution with identifier '{0}' not found", task.ExecutionIdentifier));
            }

            // TODO: txn
            TaskRepository.Remove(task);
            execution.Signal();
        }