Prevent deleting shapes

Hi,

I would like to prevent the Modeling.removeElements() action.

My use case.

  1. Select a Participant
  2. Hint Del Key or using the context menu
  3. Confirm-Message Box should come up and let the user decide to either continue the removal or cancel.

What is the purpose of this? => So, the participant is connected to a process. One of multiple participants is being deleted. So, the process is being removed, too and I would like to let the user decide, if the participant with the process should be removed.

It seems like the CustomRules are going one step before. Preventing the shape from being removed at all, before it can happen. This does not fit in my case. The user should have the ability to remove the shape, however on deletion, a confirm-box should come up.

It would be nice to have an event like: “elements.removing”
Any ideas how to solve this?

You’d want to adjust the removeSelection editor action and the context pad entry. This way you can intercept and execute your own logic.