Completed process instance diagram

Hi,

Is there any reason why only the ACTIVE process instance have available a process instance diagram?

After a process instance is completed or canceled the diagram is no longer available.

IMHO it makes more sense to have the diagram for the completed process than for the active process (which could live for only a few seconds).

  For active instances there is this API:
   GET runtime/process-instances/{processInstanceId}/diagram

However for completed processes there is nothing of the form:
   GET history/historic-process-instances/{processInstanceId}/diagram

Also in the web-apps (admin and task) the diagram is only available for active process instances.

br,
Vlad

Hi Vlad,

Process instance diagram is generated according to the current process state.
What should a diagram for completed processes show?
(Simple process definition diagram with one end event highlighted?)

Another point of view could be to display audit trail for current instances and for completed instances too.
e.g.: https://github.com/martin-grofcik/activiti-crystalball/wiki/Audit-trail-diagram

Regards
Martin

Hi Martin,

Thanks for your answer.

The completed process diagram should show the path that was taken from start to end. The process can have multiple (exclusive) Gateways each leading to a different path (execution).

Knowing the process instance, I’m interested in seeing at a glance witch paths have been taken and which not.

If we take this diagram example:
http://www.flowable.org/docs/userguide/index.html#_deploying_a_process_definition

http://www.flowable.org/docs/userguide/images/getting.started.bpmn.process.png

I would expect to easily see if the “approved” or “rejected” path has been taken.

br,
Vlad

Hi Vlad,

The logic is already there in the admin app, maybe it’s not enabled yet.
Could you create an issue, then we’ll make sure the diagram is also available for a completed process instance.

Best regards,

Tijs

Done, Thanks!

https://github.com/flowable/flowable-engine/issues/447

HI tijs,

I was wondering if it is possible to have a diagram similar to flowable-admin app in my own app. There are considerable differences in the diagram generated via API and the one in flowable-admin app. It seems like flowable-admin uses some client side js/css to beautify the diagram and add colours to the path. Any idea on if I can add similar client side js-css to make the diagram even more descriptive and coloured.

The flowable admin network calls suggest that it retrieves a JSON for the process instance overall execution or history and renders the diagram using some js-css. It doesn’t seem to hit the above API which returns diagram(png).

Hi,

This JS diagram renderer is included in the Flowable Modeler, Task and Admin app. Yes you can easily use it in your own app as well, because it just needs a div to render the diagram. You can find the necessary JS files here https://github.com/flowable/flowable-engine/tree/master/modules/flowable-ui-admin/flowable-ui-admin-app/src/main/webapp/display

It invokes the Flowable REST API to return a simplified JSON representation of the process definition. This is the REST service used in the Admin app:

Best regards,

Tijs

1 Like

Hi, We have similar requirement. We want to open program diagram from our web application.
Something like flowable admin “show process diagram”. Please help.