Bpmn-js: An example of using the command interceptor

A command interceptor is meant to hook into a command that is being executed. What you’re trying to do sounds more like simply executing commands which in most cases should be done by using the modeling API. Anyway, here’s an example of a command interceptor in action: Command Interceptor Example - CodeSandbox