Subscribe to all events from EventBus?

Is it possible to subscribe to all events in the event bus? The examples I have read show usage for per event subscriptions; is there a example of a catch all? Or a maintained listing of all possible events?

You could override the fire method of the event bus to log all the events that are being fired.

class EventBusLogger {
  constructor(eventBus) {
    const fire = eventBus.fire.bind(eventBus);

    eventBus.fire = (type, data) => {
      console.log(type, data);

      fire(type, data);
    };
  }
}

Example: https://codesandbox.io/s/bpmn-js-log-events-h3d94

1 Like

@StephenOTT Just to understand your request a bit better: Why would you need such a list of events? What would be the use?