# APIs for debugging workflow progress?

**URL:** <https://forum.flowable.org/t/apis-for-debugging-workflow-progress/459>\
**Category:** Uncategorized\
**Created:** [April 8, 2017, 12:10am UTC](https://forum.flowable.org/t/apis-for-debugging-workflow-progress/459 "2017-04-08T00:10:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![aaronk](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@aaronk](https://forum.flowable.org/u/aaronk)\
**Post date:** [April 8, 2017, 12:10am UTC](https://forum.flowable.org/t/apis-for-debugging-workflow-progress/459/1 "2017-04-08T00:10:56Z")

</div>

What APIs are available in Flowable that help trace the path that a process instance has taken?

I’ve spent a fair amount of cycles tweaking and re-running tests for BPMN workflows that aren’t behaving as expected, only to find that it was a simple error like a missing `sequenceFlow`.

One user posted a great example [here](https://forum.flowable.org/t/process-debugger/117/2) that would go a long way toward helping with that, but what APIs made that output possible?

I stumbled across the [ExecutionTree](http://www.flowable.org/docs/javadocs/org/flowable/engine/debug/ExecutionTree.html) class, but proper usage is a bit of a mystery, and the chain of classes that use that are undocumented and don’t seem to be intended for end users.

---

<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:** [April 10, 2017, 7:21am UTC](https://forum.flowable.org/t/apis-for-debugging-workflow-progress/459/2 "2017-04-10T07:21:46Z")

</div>

Hi,

I always start with the history tables of Flowable. With the HistoricActivityInstanceQuery you can get a good overview of the activities that have been executed for a specific process instance for example. That provides good info for a lot of cases. Let me know if you are missing something from this HistoricActivityInstanceQuery result.

Best regards,

Tijs

---

<div class="post-metadata">

**Author:** ![aaronk](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@aaronk](https://forum.flowable.org/u/aaronk)\
**Post date:** [April 10, 2017, 7:59pm UTC](https://forum.flowable.org/t/apis-for-debugging-workflow-progress/459/3 "2017-04-10T19:59:19Z")

</div>

Thanks, I will give it a shot and update when I do. Thanks!

---

<div class="post-metadata">

**Author:** ![aaronk](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@aaronk](https://forum.flowable.org/u/aaronk)\
**Post date:** [April 12, 2017, 9:56pm UTC](https://forum.flowable.org/t/apis-for-debugging-workflow-progress/459/4 "2017-04-12T21:56:18Z")

</div>

> [@tijs](#):
>
> I always start with the history tables of Flowable. With the HistoricActivityInstanceQuery you can get a good overview of the activities that have been executed for a specific process instance for example. That provides good info for a lot of cases. Let me know if you are missing something from this HistoricActivityInstanceQuery result.

I played with this, and some of the other historic queries on `HistoryService`. A couple of things I’m not able to figure out:

- How to get historic values of form properties when using `multiInstanceLoopCharacteristics` (I tried `ProcessInstanceHistoryLog.getHistoricData()` and got a lot of `HistoricVariableInstanceEntity` values, but it only reported the last value set for a form property)
- How to get an execution tree, for process debugging purposes (as in the post linked above)

---

<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:** [April 14, 2017, 3:18pm UTC](https://forum.flowable.org/t/apis-for-debugging-workflow-progress/459/5 "2017-04-14T15:18:35Z")

</div>

Hi,

You can get historic values of form properties with the HistoricDetailQuery. If history level is set to full, it will include all variable updates, and not only single variable values.  
For the execution tree you could use the ExecutionTreeUtil class with the buildExecutionTree method. This will provide you with a nested execution tree of the passed execution.

Best regards,

Tijs

---

<div class="post-metadata">

**Author:** ![aaronk](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@aaronk](https://forum.flowable.org/u/aaronk)\
**Post date:** [April 14, 2017, 5:08pm UTC](https://forum.flowable.org/t/apis-for-debugging-workflow-progress/459/6 "2017-04-14T17:08:46Z")

</div>

Thanks Tijs, the `HistoricDetailQuery` pointer helps — I played with that, but was looking at variables rather than form properties.

> [@tijs](#):
>
> For the execution tree you could use the ExecutionTreeUtil class with the buildExecutionTree method. This will provide you with a nested execution tree of the passed execution.

This one I’m still having trouble with, because `buildExecutionTree` takes an `ExecutionEntity` collection, or a `DelegateExecution`. I don’t know how to obtain an `ExecutionEntity` at all, and a `DelegateExecution` seems to be available only by explicit call of a service task, execution listener, etc. within the workflow.

---

<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:** [April 18, 2017, 7:15am UTC](https://forum.flowable.org/t/apis-for-debugging-workflow-progress/459/7 "2017-04-18T07:15:04Z")

</div>

Hi,

You can get an Execution with RuntimeService createExecutionQuery. You can cast the Execution instance to an ExecutionEntity and call the buildExecutionTree method.

Best regards,

Tijs
