AnsweredAssumed Answered

Process does not end

Question asked by mrb on Mar 8, 2014
Latest reply on Mar 10, 2014 by frederikheremans1
Hey together,

i'm playing a little bit with activiti and i have a strange behaviour, when i'm using usertasks.
My process never ends and i don't know why.

My Process:

<?xml version="1.0" encoding="UTF-8"?>
<definitions>
  <message id="newRequest" name="newRequest"></message>
  <process id="myProcess" name="My process" isExecutable="true">
    <startEvent id="messagestartevent1" name="workflow">
      <messageEventDefinition messageRef="newRequest"></messageEventDefinition>
    </startEvent>
    <userTask id="Approval" name="Approval">
      <extensionElements>
        <activiti:taskListener event="create" class="AssignSupervisor"></activiti:taskListener>
      </extensionElements>
    </userTask>
    <sequenceFlow id="flow1" sourceRef="messagestartevent1" targetRef="Approval"></sequenceFlow>
    <endEvent id="endevent1" name="End">
      <extensionElements>
        <activiti:executionListener event="start" class="sendNotification"></activiti:executionListener>
      </extensionElements>
    </endEvent>
    <sequenceFlow id="flow2" sourceRef="Approval" targetRef="endevent1"></sequenceFlow>
  </process>
</definitions>



ProcessInstance costInstance = runtimeService.startProcessInstanceByMessage("newRequest");
      TaskService ts = processEngine.getTaskService();
      List<Task> tasks = ts.createTaskQuery().taskAssignee("supervisor1").list();
      assertEquals(1, tasks.size()); //true
      ts.complete(tasks.get(0).getId());
      System.out.println(costInstance.getActivityId()); //Approval
      assertEquals(true, costInstance.isEnded()); //false


What i'm doing wrong?

Thanks a lot.

Outcomes