After completing user task , count is not moving to next service task

Hi Team,

Scenario:
bpmn : start event -> user task -> service task -> close event
Step 1) user task is completed using RESP API,
–> it moves to next service task, since there is a “Delegate” class present for this task , it’ll get executed
–> in this class an external API is called for which response will come after 10 sec
Step 2) During this time when we look at cockpit , the count does not move from user task to service task, why is it so??

Since the user task is completed , the count should decrease by 1 and service task count should get incremented by 1 right??
Please let me know if this understanding is correct or not

Thanks and Regards,
Manoj

Unless the process reaches a point where the state can be persisted you wont see a change in the state.

If you’re in memory waiting for a rest response the database has not saved that state. It’s only successful at the end of your process when it finally commits.

-Niall

Hi Niall,

Is there any way to change the state which in turn can show the count ?
Could you point to any related documentation?

Thanks,
Manoj

This is best detailed under the Transactions section of the docs.

With regard to solving your specific problem, you tick the “Asynchronous Before” tick box on your service task. That would commit the state before attempting the rest call. So the token would be visible in cockpit.

1 Like

Thank you Niall
I’ll try this