This is my 2nd question on the forum as a BpmnJS newbye (but who loves it after having spent a few days developing with it…).
I would like to add workflow capabilities to my client/server application:
- the client uses Angular, and would allow users to model workflows with BpmnJS, that would then run on the server.
- the server runs on Node/Express, and would have to execute workflows stored in a MySQL database.
Right now I am confident to be able to use BpmnJS so that it fits with my business requirements, and let users model workflows in the Angular client.
What is not clear to me, is how to then transfer the workflow models to the server, and execute them.
My assumption is that I would have to transfer the BPMN-2.0 XML file from the client to the server, so that the server stores that XML in a SQL blob in the database.
However, in order to implement the handling of the various activities/events/branches, I think it would be better that I store each node of the diagram as individual records in the database, each having its own properties.
On the other hand, storing the XML is required (I assume), so that, at least, the (x,y) coordinates of each node can be restored when the user wants to visualize its workflows later on.
So I would have to store 2 redundant (thus possibly inconsistent) data: 1) the XML, and 2) the nodes/links structure.
So, a few questions:
- what would be your recommendation to store a workflow modelled with BpmnJS in a database?
- is there a BpmnJS API to retrieve the nodes and links from an XML file (and all their related attributes)
- I have read and (mis?)understood on this forum that Camunda could be an alternative solution, that would avoid me to implement a workflow engine by myself. But then I don’t understand how to invoke my server-side functions to handle each activity/events/branches of the workflow from the Camunda engine. Do you think Camunda would be a good fit for me?
- Overall, I have the impression to reinvent the wheel, but on this forum it looks like nobody has to do what I do, which puzzles me quite a bit, and make me think I have missed something.
Many thanks for any guidance!!