How to differentiate shape.change and shape.delete


How can I differentiate whether shape.remove event is triggered by task type change or by delete from properties panel?

As shape.remove is called by both.


Short answer: You can’t. :sob:

What is the location of code that binds the icons of properties panel with their corresponding actions?

What do you mean by the icons of properties panel? Do you mean the input fields?

Sorry, I mean palette having icons with type change, delete, etc.

PaletteProvider, here you go.

Any event to listen particular click in palette in angular 8?

Please forget about frameworks for a minute. They are irrelevant.

This is the context pad:


You want to find out if a particular command was triggered through the context pad, right?

As I want to differentiate whether shape.remove event is triggered by task type change or by delete from palette.
So what I am thinking is to listen the particular icon click event from palette and write code accordingly

Can you describe in more detail what you’re ultimately trying to achieve? Depending on that the solution might be trivial or a bit more complicated.

Currently shape.remove event is triggered when we delete any task/event and also when we change type of event/task.

In my system when shape.remove event is triggered I have logic to call delete task/event api call to delete task/event .
I want to bypass this call if any task/event type is changed, as shape.remove is triggered while task/event type change and delete task/event

How do you persist the API call information? Do you save the information to the element itself?

Bpmn diagram is maintained itself but we try to keep log of each task/event , sequence flow etc data in database also.

So you’re basically storing the same information in two places? What information to you need to store in the database that you cannot store in the diagram XML itself (using extension elements)?

I think I confused you. Let me me back up a little. All I want to know is how an icon and its click event (delete or add a particular element ) are bind together. As I want to bypass certain behavior.

hi everyone
I have a problem
I want to get JSON data of BPMN when the workflow ends

eventBus.on('element.changed', function (event) {
    var element = event.element;

    if (element.parent || element === canvas.getRootElement()) {
      event.gfx = elementRegistry.getGraphics(element);

    if (!event.gfx) {
      console.log('===== element have been deleted =====');