executionId to XML of the schema behind

Is there a way to fetch deployed xml schema by executionId ?
Ultimately I’m looking for a way to map executionId with xml of bpmn (to render it in a custom admin tool).

At the moment I found that:

  • processDefinitionId can be queried with runtimeService.createExecutionQuery().executionId(...).singleResult().getProcessDefinitionId() where runtimeService is an instance of org.flowable.engine.RuntimeService
  • also there is repositoryService which is capable of .getBmpnModel() by processDefinitionId , but that would be a DOM of the schema, right?

Could you guide me where to look for the original XML of deployed schema. Or may be a facility capable of serializing BmpnModel back to XML.

Cheers!

You can convert a BpmnModel to xml using : new BpmnXMLConverter().convertToXML(bpmnModel); where BpmnXMLConverter lives in the org.flowable.bpmn.converter package.

Thank you.

What is the difference between

  • new BpmnXMLConverter().convertToXML(bpmn)
  • and repositoryService.getResourceAsStream(deploymentId, resourceName) (resourceName comes from ProcessDefinitionUtil.getProcessDefinition(...).getResourceName() and deploymentId form query of runtimeservice)
    ?

Both provide access shema in form of bytes.

The first converts a java model to XML. The second returns the xml exactly as it was deployed originally.