AnsweredAssumed Answered

UserTask is looping all the time

Question asked by chandanmb1 on Jun 29, 2016
Latest reply on Jun 29, 2016 by chandanmb1
Hello,

I have added the TaskListener for the UserTask.
<userTask id="push" name="Push the Message to Queue">
      <extensionElements>
        <activiti:taskListener event="create" class="com.UserCreateListener"></activiti:taskListener>
        <activiti:taskListener event="complete" class="com.UserCompleteListener"></activiti:taskListener>
      </extensionElements>
    </userTask>

When i start the activiti process, it is calling UserCreateListener and i am completing it. It will move to UserCompleteListener.
In the UserCompleteListener, it is looping the method notify and process is not finishing it off.

<code>
           public void notify(DelegateTask delegateTask) {
      System.out.println("Completing the Task::::::::"+delegateTask.getId());
      
      DelegateExecution execution = delegateTask.getExecution();
      EngineServices engineServices = execution.getEngineServices();
      TaskService taskService = engineServices.getTaskService();
      
      taskService.claim(delegateTask.getId(), "Abhilash");
      taskService.complete(delegateTask.getId());
      
      System.out.println("Finished");
      
   }
<code>

Outcomes