Esempio n. 1
0
        public virtual void testCompleteProcessWithCallActivity()
        {
            //given process with user task before multi-instance call activity
            ProcessInstance processInstance      = rule.processInstance();
            TaskQuery       taskQuery            = rule.TaskService.createTaskQuery().processInstanceId(processInstance.Id);
            Task            taskBeforeSubProcess = taskQuery.taskName("Task before multi-instance").singleResult();

            assertNotNull(taskBeforeSubProcess);

            //when the task before is complete the process leads to calling the multi-instance subprocess
            rule.TaskService.complete(taskBeforeSubProcess.Id);

            Task taskAfterSubProcess = taskQuery.taskName("Task after multi-instance").singleResult();

            assertNotNull(taskAfterSubProcess);

            //after completing the after task the process instance ends
            rule.TaskService.complete(taskAfterSubProcess.Id);
            rule.assertScenarioEnded();
        }
Esempio n. 2
0
        public virtual void testCompleteProcessWithCallActivityAndOneCompletedTask()
        {
            //given process after multi-instance callactivity
            ProcessInstance processInstance     = rule.processInstance();
            TaskQuery       taskQuery           = rule.TaskService.createTaskQuery().processInstanceId(processInstance.Id);
            Task            taskAfterSubProcess = taskQuery.taskName("Task after multi-instance").singleResult();

            assertNotNull(taskAfterSubProcess);

            // Completing this task end the process instance
            rule.TaskService.complete(taskAfterSubProcess.Id);
            rule.assertScenarioEnded();
        }