Is there any listener for element delete?


#1

i want to have a listener for my task element, when a task deleted trigger some functions.
is there any listener in eventBus for that or any other option?( i want task id for my functions)
like this:

    eventBus.on("element.delete", function (event) {
       console.log(event.element.id , "element id")
       alert("element deleted");
       // do some function( event.element.id) 
    });

#2

this method works fine for me

var eventBus = modeler.get('eventBus');
eventBus.on("shape.remove", function (event) {
    if (event.element.id.indexOf("Task") >= 0) {
        console.log(event.element, "event")
    }
});

#3

You have ‘shape.delete’ and ‘elements.delete’