# How to get Flowable process Information at run time

**URL:** <https://forum.flowable.org/t/how-to-get-flowable-process-information-at-run-time/2704>\
**Category:** Uncategorized\
**Created:** [October 9, 2018, 7:02am UTC](https://forum.flowable.org/t/how-to-get-flowable-process-information-at-run-time/2704 "2018-10-09T07:02:36Z")\
**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 9, 2018, 7:02am UTC](https://forum.flowable.org/t/how-to-get-flowable-process-information-at-run-time/2704/1 "2018-10-09T07:02:36Z")

</div>

I have a Flowable process in my spring boot project. Is there any way I can get list of all the task that are involved in my process as I am unable to get process modeler or UI of .bpmn20.xml file

Is there any way to get the complete list of .bpmn20.xml file  
OR  
meta data of that process.

---

<div class="post-metadata">

**Author:** ![rgorzkowski](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/rgorzkowski/32/1365_2.png) [@rgorzkowski](https://forum.flowable.org/u/rgorzkowski)\
**Post date:** [October 9, 2018, 8:16am UTC](https://forum.flowable.org/t/how-to-get-flowable-process-information-at-run-time/2704/2 "2018-10-09T08:16:50Z")

</div>

Hi @sagaraa

You can try this rough and ready code:

```
final List<FlowElement> userTasks = repositoryService.getBpmnModel(<your_process_id>)
            .getMainProcess()
            .getFlowElements()
            .stream()
            .filter(UserTask.class::isInstance)
            .collect(Collectors.toList());

```

It finds user tasks inside main process.

---

<div class="post-metadata">

**Author:** ![rgorzkowski](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/rgorzkowski/32/1365_2.png) [@rgorzkowski](https://forum.flowable.org/u/rgorzkowski)\
**Post date:** [October 9, 2018, 8:18am UTC](https://forum.flowable.org/t/how-to-get-flowable-process-information-at-run-time/2704/3 "2018-10-09T08:18:43Z")

</div>

I believe that there is better way to fetch user tasks, but I don’t know it 🙂

---

<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 9, 2018, 9:08am UTC](https://forum.flowable.org/t/how-to-get-flowable-process-information-at-run-time/2704/4 "2018-10-09T09:08:36Z")

</div>

Hi, Thanks for quick reply  
Actually I am looking for all task(including user, http service) which gets executed or which will be executed

In my example every task is getting executed except “THIS SHOULD NOT APPEAR”,  
So, I want a list of all tasks except “THIS SHOULD NOT APPEAR”

![flowable](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/flowable/original/1X/6a5e5be3e030ed3a581e531f8cae8da0a3004227.png)

---

<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 9, 2018, 9:23am UTC](https://forum.flowable.org/t/how-to-get-flowable-process-information-at-run-time/2704/5 "2018-10-09T09:23:59Z")

</div>

Also excluding sequenceflow

---

<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 10, 2018, 9:02am UTC](https://forum.flowable.org/t/how-to-get-flowable-process-information-at-run-time/2704/6 "2018-10-10T09:02:06Z")

</div>

@rgorzkowski  
I found a temporary solution, I got the result by directly interacting with the database, Table ACT\_HI\_ACTINST contains we have to use the proper processDefinition Id,

select ACT\_NAME\_ from dbo.ACT\_HI\_ACTINST where PROC\_DEF\_ID\_=processDefinitionId

Is there API call for the same.

---

<div class="post-metadata">

**Author:** ![filiphr](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/filiphr/32/315_2.png) [@filiphr](https://forum.flowable.org/u/filiphr)\
**Post date:** [October 10, 2018, 8:01pm UTC](https://forum.flowable.org/t/how-to-get-flowable-process-information-at-run-time/2704/7 "2018-10-10T20:01:30Z")

</div>

@sagaraa you can query on all **executed** activities (user task, service task etc) by going through the [`HistoricActivityInstanceQuery`](https://github.com/flowable/flowable-engine/blob/master/modules/flowable-engine/src/main/java/org/flowable/engine/history/HistoricActivityInstanceQuery.java). This can be created via the [`HistoryService#createHistoricActivityInstanceQuery()`](https://github.com/flowable/flowable-engine/blob/master/modules/flowable-engine/src/main/java/org/flowable/engine/HistoryService.java#L57).

If you want to get all possible tasks you will have to use the `BpmnModel`. Have a look at the reply from @rgorzkowski [How to get Flowable process Information at run time](https://forum.flowable.org/t/how-to-get-flowable-process-information-at-run-time/2704/2?u=filiphr)
