# Keep track of the status of Flowable process

**URL:** <https://forum.flowable.org/t/keep-track-of-the-status-of-flowable-process/837>\
**Category:** Uncategorized\
**Created:** [August 10, 2017, 11:19pm UTC](https://forum.flowable.org/t/keep-track-of-the-status-of-flowable-process/837 "2017-08-10T23:19:07Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinayksharma](https://avatars.discourse-cdn.com/v4/letter/v/bc8723/32.png) [@vinayksharma](https://forum.flowable.org/u/vinayksharma)\
**Post date:** [August 10, 2017, 11:19pm UTC](https://forum.flowable.org/t/keep-track-of-the-status-of-flowable-process/837/1 "2017-08-10T23:19:07Z")

</div>

Hi

I want to keep track of the status of my Flowable processes ( which I invoke through REST call) i.e. I want to know, which process started when and when it finished , and if it has NOT finished then at which step is it.

The way, am doing it is by firing a query on **ACT\_HI\_ACTINST** with the PROC\_INST\_ID\_ ( I get this id in the response of the REST call, through which I trigger the process). e.g.

SELECT \* FROM flowable.ACT\_HI\_ACTINST where PROC\_INST\_ID\_ like ‘517708’.

The above query gives the names of all the Steps (ACT\_NAME\_ & ACT\_ID\_) which were executed for this process instance.

I want to create multiple processes , which would shared same steps , is there a way to create a global ACT\_ID\_ which can be used by multiple processes ? e.g. I want to have a service-task with one Id which no other service-task can have ( like a primary key). Currently, I can have multiple service-tasks with the same id.

Thanks in advance for your suggestions/help.

---

<div class="post-metadata">

**Author:** ![tijs](https://avatars.discourse-cdn.com/v4/letter/t/bc79bd/32.png) [@tijs](https://forum.flowable.org/u/tijs)\
**Post date:** [August 15, 2017, 7:24am UTC](https://forum.flowable.org/t/keep-track-of-the-status-of-flowable-process/837/2 "2017-08-15T07:24:47Z")

</div>

Hi,

The ACT\_ID\_ value is filled with the id attribute of the serviceTask element in the BPMN XML. So if you consistently use the same id attribute for same service task in different BPMN XMLs it will have the same ACT\_ID\_ value. Within the same process definition / BPMN XML you can only use an id attribute value once, because it needs to be unique within the BPMN XML.

Best regards,

Tijs

---

<div class="post-metadata">

**Author:** ![vinayksharma](https://avatars.discourse-cdn.com/v4/letter/v/bc8723/32.png) [@vinayksharma](https://forum.flowable.org/u/vinayksharma)\
**Post date:** [August 15, 2017, 5:43pm UTC](https://forum.flowable.org/t/keep-track-of-the-status-of-flowable-process/837/3 "2017-08-15T17:43:17Z")

</div>

Thanks @tijs. Yes that what even my understanding is. But the issue is what if someone gives the same ID to a different serviceTask which is not meant to be same thing, as the one it is intended to be i.e. I want a way to restrict the user from using the Id in a wrong way . So am planning to keep track of the status of each step in my own DB.

i.e. if my process has 5 different Service-Tasks (each considered as 1 step), then after each step is done, I would mark it as Complete in my DB. My question to you is that from a best practice perspective would the use of **Execution-Listener** is correct in this case i.e. I would execute a listener (which would make a DB call) at the end of each Step ? Or should I have a service-task after each step to update the status of it in DB ?

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [August 15, 2017, 5:52pm UTC](https://forum.flowable.org/t/keep-track-of-the-status-of-flowable-process/837/4 "2017-08-15T17:52:47Z")

</div>

In case you want to avoid using certain ids you can either hook in a custom BpmnParseHandler or add a custom validator. Both are called when the process definition is deployed.

Not sure why you’d want a complete in the db yourself, the historical data already contains that. However, if you do want to do it yourself, an executionlistener would indeed be the way to go (or have a custom ActivityBehaviorFactory that wraps the original behaviour)

---

<div class="post-metadata">

**Author:** ![vinayksharma](https://avatars.discourse-cdn.com/v4/letter/v/bc8723/32.png) [@vinayksharma](https://forum.flowable.org/u/vinayksharma)\
**Post date:** [August 21, 2017, 11:29pm UTC](https://forum.flowable.org/t/keep-track-of-the-status-of-flowable-process/837/5 "2017-08-21T23:29:04Z")

</div>

Thanks @joram . Would do try with it.

---

<div class="post-metadata">

**Author:** ![vinayksharma](https://avatars.discourse-cdn.com/v4/letter/v/bc8723/32.png) [@vinayksharma](https://forum.flowable.org/u/vinayksharma)\
**Post date:** [August 25, 2017, 5:32pm UTC](https://forum.flowable.org/t/keep-track-of-the-status-of-flowable-process/837/6 "2017-08-25T17:32:25Z")

</div>

@joram @tijs another question , from ACT\_HI\_ACTINST table am able to find the status of the steps executed in a process i.e. if a process has 10 steps and 5 of these steps and done and 6th step is waiting for something to happen before it can execute then ACT\_HI\_ACTINST would have the entries till Step-5 with Start/End time. My question is where I can find the FULL mapping for the entire process irrespective of the execution status.

Thanks

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [August 29, 2017, 12:29pm UTC](https://forum.flowable.org/t/keep-track-of-the-status-of-flowable-process/837/7 "2017-08-29T12:29:44Z")

</div>

You can get a java representation of the whole proces definition through the repositoryService.getBpmnModel(processDefinitionId) method.

---

<div class="post-metadata">

**Author:** ![vinayksharma](https://avatars.discourse-cdn.com/v4/letter/v/bc8723/32.png) [@vinayksharma](https://forum.flowable.org/u/vinayksharma)\
**Post date:** [August 29, 2017, 6:55pm UTC](https://forum.flowable.org/t/keep-track-of-the-status-of-flowable-process/837/8 "2017-08-29T18:55:40Z")

</div>

Thanks @joram. I was actually looking for it from the DB perspective i.e. which table to look for to get the entire mapping .

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [September 4, 2017, 7:44pm UTC](https://forum.flowable.org/t/keep-track-of-the-status-of-flowable-process/837/9 "2017-09-04T19:44:33Z")

</div>

The whole mapping is not stored in a relational way, as there’s no need for that. Rather, the BPMN model xml is stored in in a table (ACT\_GE\_BYTEARRAY), and fetched from the database to parse to an executable java model when neeed.

---

<div class="post-metadata">

**Author:** ![vinayksharma](https://avatars.discourse-cdn.com/v4/letter/v/bc8723/32.png) [@vinayksharma](https://forum.flowable.org/u/vinayksharma)\
**Post date:** [September 7, 2017, 6:13pm UTC](https://forum.flowable.org/t/keep-track-of-the-status-of-flowable-process/837/10 "2017-09-07T18:13:11Z")

</div>

Thanks @joram for sharing the details.
