How do I decide if the new anchor of the connection change is legal?

Hi, I just started learning to use BPMN recently and use BPMN in react. I made BPMN into a component.
I want to listen to the event that the waypoints of connection is changed. I tried connection.reconnect, but it doesn’t work. Then I tried the event ‘commandStack.connection.reconnect.executed’.

For the ‘commandStack.connection.reconnect.executed’ event, I can now listen the connection waypoints update, but I need to judge whether the update can be performed according to the conditions passed in by parent components. How can I achieve it?

Because of I need to check if connect can be excused according to the conditions passed in by parent components, maybe it is not fitness for use CustomRules.

Thanks a lot if anyone can give me some advice and help.


we use a concept called rules. A rule is used to decide whether a connection can be reconnected or not: bpmn-js/BpmnRules.js at develop · bpmn-io/bpmn-js · GitHub

You can create your own rules, too: bpmn-js-examples/custom-modeling-rules at master · bpmn-io/bpmn-js-examples · GitHub