AnsweredAssumed Answered

ProcessInstance.isEnded() returns false

Question asked by frauke on Oct 6, 2010
Latest reply on Mar 21, 2011 by jbarrez
How can it be that processInstance.isEnded() does not return true if the process terminated?
What did I do wrong?
This is the process definition:

<process id="testProcess1" name="Test Process">
    <startEvent id="startTest" />
    <sequenceFlow id="flow1" sourceRef="startTest" targetRef="t1" />
    <userTask id="t1" name="T1" />
    <sequenceFlow id="flow2" sourceRef="t1" targetRef="t2" />
    <task id="t2" name="T2"/>
    <sequenceFlow id="flow3" sourceRef="t2" targetRef="ready" />
    <endEvent id="ready" />
</process>
The test fails and the processInstance still holds activity 'T1':

        ProcessInstance processInstance = processEngine.getRuntimeService()
            .startProcessInstanceByKey("testProcess1");
        Task task = processEngine.getTaskService().createTaskQuery()
            .processInstanceId(processInstance.getId())
            .singleResult();
        processEngine.getTaskService().complete(task.getId());
        assertEquals(true, processInstance.isEnded());
Frauke

Outcomes