Process instance diagram format

Hi all,

I have a component that accepts BPMN and spits out an SVG of the diagram.

For example, it works great with the following call where I want to get the BPMN of a process definition:
/flowable-task/process-api/repository/process-definitions/{processDefinitionId}/resourcedata

My objective now is to be able to provide the same functionality, but for a process instance.

I found a call that returns something very similar to what I need, but it returns it in a binary PNG format:
flowable-task/process-api/runtime/process-instances/{processInstanceId}/diagram

What I like from that PNG is that it illustrates which task the process instance is currently on.

Is there an API call I can use that would return the same kind of data, but in BPMN format? I’m new to Flowable / BPM, so any help would be greatly appreciated.

Thank you in advance!

Not sure i’m following, what do you mean with BPMN format? The diagram is BPMN after all.

Hi Joram,

Thank you for the reply. Running the following endpoint (https://www.flowable.org/docs/userguide/index.html#_get_diagram_for_a_process_instance
)
http://localhost:8080/flowable-task/process-api/runtime/process-instances/{processInstanceId}/diagram

I get PNG binary data as a response. What’s interesting is I don’t get JSON back in the success response body like the documentation lists.

Am I using the correct endpoint? Could this possibly be a version issue?

That seems to be a mistake in the documentation. The class responsible for handling that call only returns the png, see https://github.com/flowable/flowable-engine/blob/master/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceDiagramResource.java#L77

The body shown in the docs there, seem to be for /process-instances/{id}. I’ve removed the wrong body from the docs: https://github.com/flowable/flowable-engine/commit/2d20598edb24a2e6494927187494a001fa690839

The call you’re looking for is this one: https://flowable.org/docs/userguide/index.html#_get_active_activities_in_an_execution