AnsweredAssumed Answered

BPMN model transformation and back

Question asked by norberts on Apr 10, 2013
Latest reply on Apr 11, 2013 by tiesebarrell
I'm working on a plugin for Activiti where I can model limited BPMN processes in Activiti and then transform them via my plugin to an internally used workflow graph representation. On that workflow graph I want to run analyses and small further transformations (combination of elements to new ones, splitting up elements or introducing new elements in the graph) via source code. This of course has to be displayed again as BPMN process in the Editor afterwards so the user gets some feedback on how it looks.
This work is meant for educational use in a university, so not really meant for the business world outside yet.

I'm aware of that I have to change Activiti itself for it.
So here's my idea so far: Create a new extension point (or miss/reuse the validator extension point reactivated) on save in the Activiti Editor. I give the BPMN model to the plugin and then I can transform it to whatever I define there. I'm aware of the fact that you want to reintroduce the validation extension point and if you do, I can adapt my solution to it. It's just for now.
Where I'm struggling is on how to give it back to Activiti to display it in the Editor. I first thought of the setEditorInput method but I guess that is reading from the bpmn-file if I understand that correctly?
And I can't just export it into the bpmn file and then reread it, since I want to give the opportunity of rewind automatic changes and I don't want to change the file all the time. So I would need to just adapt the visual model of Activiti.

So my questions are: Is it a good idea to do call the plugin on the save action? Through that I already have the BPMN model and can work on this and hand it over to the plugin. Secondly, do I need to adapt only the BPMN memory model or also the Graphiti diagram manually? Or is the conversion from Activiti to Graphiti somehow magically done inside of Activiti?
And most importantly: How would I be able to give a BPMN model back to Activiti so it is displayed in the Editor? Set the model in the ModelHandler and let the Editor read it out somehow?

Thanks for the time and your patience. :)