Create fill a new participant programatically

Hello,
My root object is a Collaboration, and I want to add shapes in a new Participant programmatically.
So far I’ve done this,

              participant = modeling.createShape(
                    { type: 'bpmn:Participant', businessObject: bo },
                    { x: null, y: null },
                    parent
                );

And then proceed to create shapes using “participant” as a parent. Everything works fine, except the “participant” is collapsed when added, and I lose the items when I do the save. How can I create a new “expanded” participant?

Thanks!

Hi,

Please see how we create particpants in bpmn-js: https://github.com/bpmn-io/bpmn-js/blob/master/lib/features/modeling/ElementFactory.js#L188

So, if you don’t want your participant to be collapsed, you also need to create a process related to the new participant.

Best,

Maciej