Add a new bpmn diagram as a custom element

Hi,
My question is can we somehow use a BPMN diagram itself as a custom element?
In my case i have to open a new bpmn diag when I click on some particular task. I need to render a new bpmn diag below it using a different xml.

Does anyone have any pointers/suggestions for the above problem?

I think the best here would be to use different Modeler instances. When clicking on one element, render a fresh new diagram inside a new bpmn-js Modeler instance. Wouldn’t that work for you?

By the way, we are currently investigating improved support for collapsed sub-processes: Handle collapsed sub-processes · Issue #1443 · bpmn-io/bpmn-js · GitHub.

That will make navigation across different diagram parts via sub-processes much easier. Maybe something that would solve your issue as well?

1 Like

Hi @Niklas_Kiefer,
Thanks for your response. As you suggested using a fresh modeler instance will give me a second diagram. But how do I connect both the diagrams via sequenceFlow? Is there a bpmn.io way to connect like we connect custom elements?