I try to figure out how could I possibly get a deletion event, once a task is deleted in the Modeler.
For example, when a task is added, I use the following code and log the element on the console.
eventBus.on(“shape.added”, function (event) {
const element = event.element,
businessObject = element.businessObject;
if (businessObject.$instanceOf(“bpmn:Task”)) {
console.log(element);
}
});
How can I change the code above, to console.log the element that was deleted?
shape.remove(d) is only fired when a shape is removed. When you change the type of a task through the context menu what happens is that the current task will be removed and a new task with the chosen type will be added at the same position.