Firing Event on "updateLabel"

Hey folks,

Is it possible to fire action when an user is editing a task label? Background: I want to add a list of suggestions.
I found the handler “element.updateLabel” in LabelEditingProvider.js an tried something like this:

var bpmnModeler = new BpmnModeler();

bpmnModeler.on(‘element.updateLabel’, function() {
console.info(‘Updated Label’);
});

Is it possible in general? What am I doing wrong? Can I get the entered label?

Thank you very much,
Chris

Hey,

element.updateLabel is not an event but a registered command that is executed once you finish editing. On the event bus there would be events like commandStack.execute.element.updateLabel and so on.

For editing labels bpmn-js uses diagram-js-direct-editing which fires the following events:

  • directEditing.activate
  • directEditing.deactivate
  • directEditing.cancel
  • directEditing.complete

Thank you Philip! That was the one I was searching for. Sad to say, I’m not able to to get the id of the element with those events. Instead it turned out, that element.changed helped me here:

eventBus.on('element.changed', function(){});