Esempio n. 1
0
        public virtual void testScriptResourceListener()
        {
            IProcessInstance processInstance = runtimeService.StartProcessInstanceByKey("process");

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

            Assert.NotNull(task);

            Assert.True((bool)runtimeService.GetVariable(processInstance.Id, "create"));

            taskService.SetAssignee(task.Id, "test");
            Assert.True((bool)runtimeService.GetVariable(processInstance.Id, "assignment"));

            taskService.Complete(task.Id);
            Assert.True((bool)runtimeService.GetVariable(processInstance.Id, "complete"));

            task = taskService.CreateTaskQuery().First();
            Assert.NotNull(task);

            runtimeService.DeleteProcessInstance(processInstance.Id, "test");

            if (processEngineConfiguration.HistoryLevel.Id >= HistoryLevelFields.HistoryLevelAudit.Id)
            {
                var variable = HistoryService.CreateHistoricVariableInstanceQuery() /*.VariableName("Delete")*/.First();
                Assert.NotNull(variable);
                Assert.True((bool)variable.Value);
            }
        }