cancel
Showing results for 
Search instead for 
Did you mean: 

Problem iin Activiti - Async

vimalan_dharma
Champ in-the-making
Champ in-the-making
Hi,

I have taken sample async bpmn from your site. Where i added service task instead of script task. when i run this activiti, i got the response immediately. Thats perfect. But the problem here is in the service task delegate the task to the Java class , this java class is never ever executed. I dont know why.

when i remove the activiti:async=true. This above java deleagate class has been executed perfectly.
The scenario is, Calling this activiti from UI. I have to send 200 response code to the UI side to not wait until this activiti completes.
Moreover my activiti takes longer time to complete. In this time UI has aborted the connection afterthat not able to proceed.

This is my sample bpmn.xml file. Taken AsynScript file from ur site. Here service task is used instead of calling script task.

<?xml version="1.0" encoding="UTF-8"?>
<definitions
  xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
  xmlns:activiti="http://activiti.org/bpmn"
  targetNamespace="Examples">

  <process id="asyncScript">
    <startEvent id="theStart" />
    <sequenceFlow sourceRef="theStart" targetRef="script" />
    <serviceTask id="script" activiti:class="com.activiti.task.ServiceTask" activiti:async="true"></serviceTask>
   <!–  <scriptTask id="script" activiti:async="true" scriptFormat="juel">
       <script>#{execution.setVariable('invoked','true')}</script>
    </scriptTask> –>
    <sequenceFlow sourceRef="script" targetRef="wait" />
    <receiveTask id="wait" />
    <sequenceFlow sourceRef="wait" targetRef="theEnd" />
    <endEvent id="theEnd" />
  </process>
</definitions>

Please help me on this. i am trying all the possibilities not no clues.
2 REPLIES 2

vimalan_dharma
Champ in-the-making
Champ in-the-making
attached sample bpmn file

frederikherema1
Star Contributor
Star Contributor
Take a look in the ACT_RU_JOB table (OR alternatively, use the Explorer UI in Manage > Jobs OR use the managementService.createJobQuery(…).withException()) to find the job that corresponds to the "async" service-task. You can do this based on the process instance id. If the delegate is never called, you'll see that the retry-count will be 0 for the job and a reference is there to an exception stacktrace, which will lead you to your issue, most likely.