jerryfiunam (61) [Avatar] Offline
#1
Hi,

I have read the articule "Dynamic Process Creation and Deployment in 100 Lines of Code". This articule is very interesting and useful. I just have a question, the example shown in that post is intended to show how you can build a process definition from scatch programatically. But what about if you already have a .BPMN file and you want to add something in it programativally or you only want to read the content with this API. Is it possible to build a BpmnModel object passing a .BPMN file to it and maniuplate the content in order to modify it (add more elements or delete elements), or simple just read the conent with this API?

Do you have JavaDoc of the Model API?
tijs.rademakers (494) [Avatar] Offline
#2
Re: Question about Dynamic Process Creation and Deployment in 100 Lines of Code
Hi,

Yes that's possible. We'll do some more blogs around this topic and we'll cover this as well. For the 5.13 this will be documented in a better way.
You can use the BpmnXMLConverter class to read the bpmn file content and you'll get back a BpmnModel instance. Then you can programmatically add everything you want and generate the XML again using the same BpmnXMLConverter class.

Best regards,

Tijs