I need a source and target of a sequenceflow before removing the connection. So I have done this by adding the following event into events and executed eventbus.
but when I try to print context in console, it is printing as expected but not source and target, any idea how I can get source and target for a connection remove?
However, I’d be careful when listening to commandStack events via eventBus since you’ll never know when the context will be available. I’d rather go with a CommandInterceptor, the UnsetDefaultFlowBehavior can be a good example.
If I implement commandStack.shape.delete.preExecute for removing gateways, unfortunately its removing all incoming and outgoing connections. Is there a way to get incoming sequence flow for gateways?
It’s true that the connections got removed alongside the gateway. However, as I mentioned before, dealing with commands should be done via a CommandInterceptor. With that, you can get those connections before the deletion happens.