Camunda XML--> JSON ---> XML

We are using BPMN tool usting Cmaunda, is there a way to have a separate UI, with custom source and custom target as per business requirement. But it would be involving Camunda XML internally. Is there way we can convert cmaunda XML to JSON before it taken to UI and Vice-versa before it is fed to Camunda Engine.

Any help will be greatful.
Thanks

1 Like

Do you mean the BPMN model?

Why exactly are you trying to do that?

Is there a way to have custom UI built on Camunda Engine(OSS) using JSON format as input and output from Custom UI to Camunda Engine which uses XML.

Let me know if you need any more info.

Thanks

You can build an independent front end which communications to the Engine via the REST API.
What exactly are you trying to do in JSON specifically? sending JSON variables?

Is there any open source project wherein we can refer for REST API created to consume Camunda Engine XML

Is there any library which can convert Camunda XML to JSON and vice-versa.?

Good Morning @Niall,

Did you got any chance to look on my above request for json converter for CAMUNDA XML?

Thanks in advance,
Jerin

I’m still not really sure what you’re talking about when you say “Camunda XML” can you show me a code example of what you’re trying to do and EXACTLY what your problem is?

Hey @Niall,

This is simple camunda BPMN XML i’m talking about

    <?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_0jzb72q" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.0.0-dev.20200326">
<bpmn:process id="Process_0ye1h4e" isExecutable="true">
    <bpmn:startEvent id="StartEvent_1">
    <bpmn:outgoing>Flow_0f6chi5</bpmn:outgoing>
    </bpmn:startEvent>
    <bpmn:task id="Activity_0nplidw" name="Sample Task">
    <bpmn:extensionElements>
        <camunda:executionListener class="asas" event="start" />
    </bpmn:extensionElements>
    <bpmn:incoming>Flow_0f6chi5</bpmn:incoming>
    <bpmn:outgoing>Flow_181d2qm</bpmn:outgoing>
    </bpmn:task>
    <bpmn:sequenceFlow id="Flow_0f6chi5" sourceRef="StartEvent_1" targetRef="Activity_0nplidw" />
    <bpmn:endEvent id="Event_1ye7eyt">
    <bpmn:incoming>Flow_181d2qm</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:sequenceFlow id="Flow_181d2qm" sourceRef="Activity_0nplidw" targetRef="Event_1ye7eyt" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_0ye1h4e">
    <bpmndi:BPMNEdge id="Flow_0f6chi5_di" bpmnElement="Flow_0f6chi5">
        <di:waypoint x="215" y="117" />
        <di:waypoint x="310" y="117" />
    </bpmndi:BPMNEdge>
    <bpmndi:BPMNEdge id="Flow_181d2qm_di" bpmnElement="Flow_181d2qm">
        <di:waypoint x="410" y="117" />
        <di:waypoint x="512" y="117" />
    </bpmndi:BPMNEdge>
    <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
        <dc:Bounds x="179" y="99" width="36" height="36" />
    </bpmndi:BPMNShape>
    <bpmndi:BPMNShape id="Activity_0nplidw_di" bpmnElement="Activity_0nplidw">
        <dc:Bounds x="310" y="77" width="100" height="80" />
    </bpmndi:BPMNShape>
    <bpmndi:BPMNShape id="Event_1ye7eyt_di" bpmnElement="Event_1ye7eyt">
        <dc:Bounds x="512" y="99" width="36" height="36" />
    </bpmndi:BPMNShape>
    </bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>

Is it possible convert this big xml to json and way back to xml while sending it to camunda engine?

Thanks
Jerin

Hi @JerinJ,

this library uses a JSON representation for BPMN processes internally: https://github.com/bpmn-io/bpmn-js.

But I’m not a JavaScript expert, so I can’t tell you how you can export the JSON (if you need to).

Hope this helps, Ingo

Thanks @Ingo_Richtsmeier, but it again gives me output as an XML.

Also i didnt find any reference of json there.

Looking forward for any more ref. you can provide.

Hi @JerinJ,

sorry, I’m out. My last general idea is to access the model and write the plain JSON structure to a file with the help of this: GitHub - bpmn-io/bpmn-moddle: Read and write BPMN 2.0 XML from JavaScript.?

What do you want to with the JSON once you have it?

Hope this helps, Ingo

With help of json, we can create any UI any without dependency of basic camunda UI.

Like a custom UI which has task and all other components, but in a different UI.