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

            tasks[userTask.WorkflowInstanceIdentifier].Remove(userTask);
        }
Ejemplo 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();
 }
Ejemplo 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();
 }
Ejemplo 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);
     }
 }
Ejemplo 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();
            }
        }
Ejemplo 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();
        }