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

**URL:** <https://forum.flowable.org/t/suspending-a-servicetask-and-resuming-the-same-using-rest-call-from-postman/5175>\
**Category:** Flowable Engine\
**Created:** [January 5, 2020, 1:55am UTC](https://forum.flowable.org/t/suspending-a-servicetask-and-resuming-the-same-using-rest-call-from-postman/5175 "2020-01-05T01:55:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ameer](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@Ameer](https://forum.flowable.org/u/Ameer)\
**Post date:** [January 5, 2020, 1:55am UTC](https://forum.flowable.org/t/suspending-a-servicetask-and-resuming-the-same-using-rest-call-from-postman/5175/1 "2020-01-05T01:55:21Z")

</div>

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.

Thanks  
Ame

---

<div class="post-metadata">

**Author:** ![wwitt](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/wwitt/32/706_2.png) [@wwitt](https://forum.flowable.org/u/wwitt)\
**Post date:** [January 6, 2020, 9:16pm UTC](https://forum.flowable.org/t/suspending-a-servicetask-and-resuming-the-same-using-rest-call-from-postman/5175/2 "2020-01-06T21:16:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Ameer](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@Ameer](https://forum.flowable.org/u/Ameer)\
**Post date:** [January 10, 2020, 4:57am UTC](https://forum.flowable.org/t/suspending-a-servicetask-and-resuming-the-same-using-rest-call-from-postman/5175/4 "2020-01-10T04:57:43Z")

</div>

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