JBoss Community

Re: Drools Guvnor problem

created by Tihomir Surdilovic in jBPM - View the full discussion

>> Is there any way to save the  bpmn2 process, from my own save button? <<

Yes, but it would involve some trickery:

1) First you have to get the JSON representation of the process via JavaScript:

window.frames[X].ORYX.EDITOR.getSerializedJSON()

where X is the number of the frame in your doc

2) Pass the JSON to designer to get it to convert it to BPMN2 (post):

localhost:8080/designer/uuidRepository?profile=jbpm&action=toXML&data=<YOUR JSON HERE>&pp=

3) Use the Guvnor rest api to create a new asset with its source being the BPMN2 you got back from Designer:

see this class as example on that...https://github.com/tsurdilo/process-designer/blob/master/src/main/java/com/intalio/web/server/TaskFormsServlet.java

 

Hope this helps ;)


Reply to this message by going to Community

Start a new discussion in jBPM at Community