Suspending A serviceTask and resuming the same using rest call from postman

Hi Team,

I have 20+ service class in Flowable which is wired into BPMN xml . Each class will call its own micoservices and will return back to Flowable with success Boolean and some values which need to be stored in execution variable and then will move to next service class and microservice api call and go on.
Flowable:async is made true in the first sericetask itself. So it runs asynchronous in nature.

So if I’m making any rest call from postman to suspend the process while it is running, is it possible?
Each service class in Flowable has implemented JavaDelegate class , do i need to change this to ActivityBehaviour class?,
If I Change this and while testing, it automatically ends the process at that class even without calling the suspend call from postman?

When we do the suspend call from postman and from controller it will go to respective Flowswerivce implementation class there the method is wrote to suspend the process (runtimeService.sus…Pro…(pid ))

RuntimeSerice is autowired in this Service implementation class.

Please help me with the answers and your suggestions or redirect me to the link if answers are already there.


I’m having trouble understanding the question/issue Are you looking for a way to suspend/activate processes instance besides a PUT to /runtime/process-instances/{processInstanceId}?

During a longer running service task, suspending in the middle of execution will result in an optimistic lock exception on the database, causing the process instance to roll back to the previous wait state. Part of the solution will likely be making more of your service tasks async to force it to persist to the database between each task.

it’s worked. made all servicetask async. now suspend and resume task is working as expected.