How do I disable other processes in a child process to drag out?

How to prevent dragging out the contents of a child process, but the child process as a whole can still drag?
For example, in BPMN :SubProcess, there are BPMN :StartEvent, BPMN :Task and BPMN :EndEvent. These events cannot be dragged out of BPMN :SubProcess, but the whole BPMN :SubProcess can still be dragged,and within BPMN :SubProcess, they can also be dragged.
Thankyou very much!2020-05-22T11:30:00Z

1 Like


This can be achieved by writing a custom rule for elements.move command.

Then you need to inject your custom rule module to bpmn-js as an additional module.

Here’s a working CodeSandbox of what you want to achieve: Elements can be dragged unless they are inside a SubProcess:

Ok, I’ll try it first. Thank you very much!