protected internal virtual void AssertHistoricTaskDeletionPresent(IList <string> processIds, string deleteReason, ProcessEngineTestRule testRule)
        {
            if (!testRule.HistoryLevelNone)
            {
                foreach (string processId in processIds)
                {
                    IHistoricTaskInstance historicTaskInstance = historyService.CreateHistoricTaskInstanceQuery(p => p.ProcessInstanceId == processId)
                                                                 //.ProcessInstanceId(processId)
                                                                 .First();

                    Assert.That(historicTaskInstance.DeleteReason, Is.EqualTo(deleteReason));
                }
            }
        }
Пример #2
0
        public virtual void testHistoricTaskInstanceUpdate()
        {
            var id = runtimeService.StartProcessInstanceByKey("HistoricTaskInstanceTest").Id;

            ITask task = taskService.CreateTaskQuery().First();

            // Update and save the task's fields before it is finished
            task.Priority    = 12345;
            task.Description = "Updated description";
            task.Name        = "Updated name";
            task.Assignee    = "gonzo";
            taskService.SaveTask(task);

            taskService.Complete(task.Id);
            Assert.AreEqual(true, historyService.CreateHistoricTaskInstanceQuery().Count() > 0);

            IHistoricTaskInstance historicTaskInstance = historyService.CreateHistoricTaskInstanceQuery().First();

            Assert.AreEqual("Updated name", historicTaskInstance.Name);
            Assert.AreEqual("Updated description", historicTaskInstance.Description);
            Assert.AreEqual("gonzo", historicTaskInstance.Assignee);
            Assert.AreEqual("task", historicTaskInstance.TaskDefinitionKey);
        }