Capture any event that bpmn pass to Rails app

Hi,

I am interested in using bpmn-js with a pre-existing application that contains worksflows. I want to use this for it’s diagram drawing/connecting and use a rails backend via ajax. I am thinking that I could catch any event that happens on the bpmn frontend and save it on the backend rails app. I looked around a bit but didnt find any apps/examples doing such a thing so I am going to take a stab at it myself. I am using a state machine as my back end to create a workflow that has many attributes attached to it.

The connections that hook to each state/event will be created/updated via this diagram using the events to call ajax updates on the Rails model.

So the first thing I want to do is capture any event that bpmn does from the front end but I am not sure where to start to find this.

This is an awesome library and thanks to all who make it great!

-Mark

What events are you referring to? bpmn-js is highly event-driven and fires huge amounts of events for any kinds of purposes.

Hi Nikku,

Thanks for getting back to me.

At present I am just trying to capture a new State and Event, which translate into a BPMN task and start/end event. From there I plan to do some of my own intervention from a modal which would collect data about the given task/event which then would be translated into a state machine. WHat I am really trying to do is find how to capture those events at the moment.

We do not have a catch all for events and it is not gonna be useful in your scenario either.

You may replace the EventBus with your own to achieve that. I’d personally rather figure out which specific events I need to listen to and just subscribe to them via

modeler.get('eventBus').on([ any, event ], callback);

Thanks for that Nikku. I am going to play around with this today and see where I get. Will let you know what I come up with. Many thanks!

-Mark