# Resume Process Instances

**URL:** <https://forum.flowable.org/t/resume-process-instances/2739>\
**Category:** Uncategorized\
**Created:** [October 16, 2018, 7:30am UTC](https://forum.flowable.org/t/resume-process-instances/2739 "2018-10-16T07:30:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sagaraa](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/sagaraa/32/973_2.png) [@sagaraa](https://forum.flowable.org/u/sagaraa)\
**Post date:** [October 16, 2018, 7:30am UTC](https://forum.flowable.org/t/resume-process-instances/2739/1 "2018-10-16T07:30:15Z")

</div>

I am developing my application over flowable, sometimes it happens my process didn’t get complete at one go and user have to wait for a while and come again to continue the process,  
while history of that incomplete process is saved in ACT\_RU\_VARIABLE,

whenever user comes again and want to continue the process from the point where he left, how can I continue (to say restart ) or assign the same process Instance to the user.

---

<div class="post-metadata">

**Author:** ![inakihn](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/inakihn/32/799_2.png) [@inakihn](https://forum.flowable.org/u/inakihn)\
**Post date:** [October 16, 2018, 9:41am UTC](https://forum.flowable.org/t/resume-process-instances/2739/2 "2018-10-16T09:41:38Z")

</div>

Hello,

You can query for active processes for the given user, and continue from there.

---

<div class="post-metadata">

**Author:** ![sagaraa](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/sagaraa/32/973_2.png) [@sagaraa](https://forum.flowable.org/u/sagaraa)\
**Post date:** [October 16, 2018, 10:15am UTC](https://forum.flowable.org/t/resume-process-instances/2739/3 "2018-10-16T10:15:00Z")

</div>

I tried but couldn’t find the right query. Can you help???

---

<div class="post-metadata">

**Author:** ![sagaraa](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/sagaraa/32/973_2.png) [@sagaraa](https://forum.flowable.org/u/sagaraa)\
**Post date:** [October 16, 2018, 10:26am UTC](https://forum.flowable.org/t/resume-process-instances/2739/4 "2018-10-16T10:26:25Z")

</div>

I tried  
runtimeService.activateProcessInstanceById(processInstanceId);

it is giving me error  
“Cannot set suspension state ‘active’ for ProcessInstance[processInstanceId]’: already in state ‘active’.”,

this is incomplete process and I want to complete this instance

---

<div class="post-metadata">

**Author:** ![inakihn](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/inakihn/32/799_2.png) [@inakihn](https://forum.flowable.org/u/inakihn)\
**Post date:** [October 16, 2018, 10:28am UTC](https://forum.flowable.org/t/resume-process-instances/2739/5 "2018-10-16T10:28:30Z")

</div>

You should query for something like

```auto
List<ProcessInstance> instanceList = runtimeService
  .createProcessInstanceQuery()
  .involvedUser("userId")
  .list();

```

Where “userId” is the id of the involved user. With that you’d have the active ProcessInstances. See [https://flowable.org/docs/userguide/index.html#queryAPI](https://flowable.org/docs/userguide/index.html#queryAPI) for additional information.

---

<div class="post-metadata">

**Author:** ![sagaraa](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/sagaraa/32/973_2.png) [@sagaraa](https://forum.flowable.org/u/sagaraa)\
**Post date:** [November 15, 2018, 11:53am UTC](https://forum.flowable.org/t/resume-process-instances/2739/6 "2018-11-15T11:53:14Z")

</div>

this is creating new processInstance involving that user instead of getting the older one

---

<div class="post-metadata">

**Author:** ![inakihn](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/inakihn/32/799_2.png) [@inakihn](https://forum.flowable.org/u/inakihn)\
**Post date:** [November 19, 2018, 2:15pm UTC](https://forum.flowable.org/t/resume-process-instances/2739/7 "2018-11-19T14:15:36Z")

</div>

No, the code I put is creating a query to search for processes for the given userId, not creating new process instances. You can filter more and ask for process that are not completed, and so on.

Normally processes stop on a wait\_state, usually on a user task that the user would have to complete. You could query for tasks of the user, please refer to [User guide getting started](https://flowable.org/docs/userguide/index.html#_querying_and_completing_tasks)
