Hello, I’m trying to detect changes on element bpmn:Gateway on changes on its connected SequenceFlow (deleted/move/changed). I’m searching for a suitable event of EventBus listener to catch the change on gateway. Any hints about it please?
Thanks
What about listening to the element.changed
event for sequence flows and check whether it is / was connected to a gateway element and then doing your crazy stuff with this gateway?
import { is } from '../util/ModelUtil';
eventBus('element.changed', function(e) {
const {
element
} = e;
if(is(element, 'bpmn:SequenceFlow') {
// check for connected `bpmn:Gateway` elements, e.g. via element.incoming or element.outgoing
// do stuff
}
});
This would help if the change is just a usual update on SequenceFlow that is connected to a gateway, but it wouldn’t help in cases:
- delete SequenceFlow that was connected to a gateway => cannot detect the change on incoming/outgoing properties
- update link connection SequenceFlow from gateway to other element
So the perfect solution will be catch event changes in incoming or outgoing Array properties on any gateway element. Any help about that?
Thanks