Hi there,
question seems to be rather dull but I can’t get the event bus to call my callback on the shape.create
event. This is what I’ve tried:
Option 1 - Create a module (preferred way):
I created a module with this descriptor:
module.exports = {
__init__: [ 'listener' ],
listener: [ 'type', require('./Listener.js') ]
};
… with following code …
function Listener(eventBus) {
eventBus.on('shape.create', 999999, function(event) {
console.log('Did you just try to create something?!');
});
}
Listener.$inject = [ 'eventBus' ];
module.exports = Listener;
This module was passed as the first of the aditionalModules
in the modelerOptions
. This didn’t work.
Option 2 - Hook after startup:
Straightforward:
/* ... code ... */
this.modeler = new BpmnModeler(this.modelerOptions);
this.modeler.get('eventBus').on('shape.create', 999999, function(event) {
console.log('Did you just try to create something?!');
});
This didn’t work neither.
What am I doing wrong?