I wanna access the ‘process’ element that is the parent of a given start event. That is very simple when there is only one process in the diagram, but when lanes are created, the parent of the event becomes the ‘participant’.
I know I can access the process throw startEvent.businessObject.$parent, but this way I get the process businessObject and I cannot call modeling.updateProperties using a businessObject, that function expects the element.
I also tried to call elementRegistry.get(‘process_id’), but the same problem arises. When there are multiple processes, the element registry doesn’t contain the processes and gets populated by participants instead.
once you create participants your’re effectifely turning a process into a collaboration so there is no process anymore. If what you want to get the parent element of an element which in your case would be a participant you can get it via element.parent. If what you want is to get the root element of your diagram be it a process or a collaboration you can get it via canvas.getRootElement().
Each participant can reference a process. And when the diagram gets deploy (in camunda engine in my case), is the processId what I use as a key to launch those processes. So I still need to access the processId that is referenced by the participant.
var participant = ...;
// may not exist for collapsed pools/participants
var proc = participant.processRef;
Checkout the full source of all defined types and relations. We are not doing any magic here. All that stuff is defined as part of the BPMN 2.0 specification.
This is the relevant piece of information we needed.
As @philippfrommealready mentioned, there is no Process element anymore in a collaboration diagram. You’d need to create your own command handler that is able to update the business object alone.