AnsweredAssumed Answered

process& subprocess with receive task never completes

Question asked by jeanhelou on Jun 8, 2012
Latest reply on Jul 11, 2012 by jeanhelou
Hello,

I tried the following very simple workflow:
[attachment=1]receive_task_bug.png[/attachment]

In my understanding, when completing usertask1 (User Task) the workflow should be completed. However the following java test code fails :

@Deployment(resources = { "workflow/TestProcess2.bpmn20.xml" })
    @Test
    public void should_complete_process() {
        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(RESTART, new HashMap<String, Object>());
        Assert.assertNotNull(processInstance);

        List<Task> list = taskService.createTaskQuery().processInstanceId(processInstance.getId()).list();
        for (Task task : list) {
            taskService.complete(task.getId());
        }
        List<ProcessInstance> list1 = runtimeService.createProcessInstanceQuery().processDefinitionKey(RESTART).list();
        Assert.assertTrue(list1.isEmpty());
    }

Is this a bug, am I missing something ?
I added the test case, the test workflow and the spring context to this post  just in case

thanks

Outcomes