Convert to xml diagram

I want to generate the attached xml diagram through java code.Please share the code snippet

Hi Nihar,

check org.activiti.rest.service.api.runtime.process.ProcessInstanceDiagramResource#getProcessInstanceDiagram reast end point. There is exact way how to get image from process instance id. (it is similar for your case.

Regards
Martin

the diagram is not generated for the same API…
I want to create bpmnModel to generate the xml(attached).
Please share java code to create bpmnModel to create activities and pass the same bpmnModel to the method convertToXML(bpmnModel)

Hi Nihar,

Now I understand your question little bit more (I am still not sure).
Somebody else has to answer your question.

Regards
Martin

Hi Nihar,

There’s the flowable-bpmn-layout module, that will try to create a good layout for a provided BpmnModel without graphical interchange information:

BpmnAutoLayout bpmnLayout = new BpmnAutoLayout(bpmnModel);
bpmnLayout.execute();

This is always a best effort action. To get good BPMN DI or graphical interchange information you need the web modeler or the Eclipse Designer and model the process definition in a graphical way.

Best regards,

Tijs