cancel
Showing results for 
Search instead for 
Did you mean: 

See progress of script tasks

nixikanius
Champ in-the-making
Champ in-the-making
Hello.

I created test process:


<process id="connectionRequestProcess" name="Connection Request Process" isExecutable="true">
    <startEvent id="startevent1" name="Request received"></startEvent>
    <scriptTask id="scripttask1" name="Script Task" activiti:async="true" scriptFormat="groovy" activiti:autoStoreVariables="false">
      <script>sleep(20000);</script>
    </scriptTask>
    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="scripttask1"></sequenceFlow>
    <endEvent id="endevent1" name="Request processed"></endEvent>
    <scriptTask id="scripttask2" name="Script Task" scriptFormat="groovy" activiti:autoStoreVariables="false">
      <script>sleep(20000);</script>
    </scriptTask>
    <scriptTask id="scripttask3" name="Script Task" scriptFormat="groovy" activiti:autoStoreVariables="false">
      <script>sleep(20000);</script>
    </scriptTask>
    <sequenceFlow id="flow3" sourceRef="scripttask2" targetRef="scripttask3"></sequenceFlow>
    <sequenceFlow id="flow4" sourceRef="scripttask3" targetRef="endevent1"></sequenceFlow>
    <sequenceFlow id="flow5" sourceRef="scripttask1" targetRef="scripttask2"></sequenceFlow>
  </process>


As you see the first task of process is asynchronous. It needs to start process asynchronously. When I start process in this way I see in activiti-explorer and in activiti-rest that activity_id for process instance is always set to scripttask1 even when this task is completed (for example in 30 seconds after process start).

Is there anyway to see actual progress of script tasks in Activiti? We need asynchronous process with some direct script tasks and want to see where each process instance is now.
3 REPLIES 3

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Nixikanius,

scripttask1, scripttask2, scripttask3 are executed in one transaction. Because of delays transaction can timeout. Make all scripttasks asynchronous and status will be updated. Each scripttask is executed in separate transaction.

Regards
Martin

nixikanius
Champ in-the-making
Champ in-the-making
Async property for all tasks works! Thank you!

If I put user task after scripttask3 and after it 2 new script tasks I also need to set them as async? Is it mean that if I want to see script tasks progress in direct chain I need to set all of them as asynchronous?

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Nixikanius,

to get more info read http://activiti.org/userguide/index.html#bpmnConcurrencyAndTransactions, you need to create wait states to get updates readable outside of transaction.

Regards
Martin