Creating XML for application

Hi, i’m developing a tool and I trying to generate the XML file for the application for diagram a subprocess. Dont know why its not showing the task inside the subprocess.

Here is the output.

<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="" xmlns:bpmndi="" xmlns:di="" xmlns:dc="">
  <bpmn:process id="Process_1" isExecutable="false">
  <bpmn:startEvent id="StartEvent_1" />
<bpmn:subProcess id="Testing_SubProcess">
  <bpmn:task id="Task_1111" name="Task_1111" />
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
  <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
    <dc:Bounds x="173" y="102" width="36" height="36" />
  <bpmndi:BPMNShape id="Testing_SubProcess_di" bpmnElement="Testing_SubProcess">
    <dc:Bounds x="276" y="71" width="350" height="200" />
  <bpmndi:BPMNShape id="Task_1111_di" bpmnElement="Task_1111">
    <dc:Bounds x="303" y="117" width="100" height="80" />

Hope that can anybody help me. Thanks in advance.

Hi @guiles,

in your XML you defined a collapsed sub process. If you want the child elements to be visible, the sub process needs to be expanded. Just set the isExpanded property:

<bpmndi:BPMNShape id="Testing_SubProcess_di" bpmnElement="Testing_SubProcess" isExpanded="true">

Thanks @pedesen, it was just that attribute… :smile:

@guiles Hi, im currently working on the same thing of generate the xml file for bpmn. Can you share something with how to generate the <bpmndi:BPMNDiagram …> part by coding? Thank you so much!

Hi @kaiyingzhang

Firstly, please do not necrobump old topics, instead, open a new thread with your new question.

Regarding your question: we do not offer a solution for generating the DI part of a diagram directly. We have a no-longer-maintained solution for that:, but it’s not stable.