Hello,
I have a requirement where in I create a package into Guvnor and then I add multiple bpmn2 files to that package with corresponding ftl files to added to the Guvnor. my question is how can i do this programatically or using a batch process.
One way that I have found out is using the REST API.
This will create a package inside Guvnor.
/packages | POST | application/json and application/xml | application/json and application/xml | Creates a package from JSON or XML. Returns the newly created package in JSON or XML format. |
This will create an Asset inside the particular package named {packageName}. This takes the input as Atom Feed and the out is also an Atom Feed.
/packages/{packageName}/assets | POST | application/atom+xml | application/atom+xml | Creates an asset in package {packageName} from the Atom Entry provided. Following info are required from the input Atom Entry: asset name, asset description, asset initial category, asset format. |
I have experience of using the REST API to do the following using Java API - we used Apache Abdera API. (This API is used to return data as ATOM feeds).
/packages/{packageName}/assets | GET | application/atom+xml | none | Returns the list of rule assets contained in package {packageName} as an Atom Feed. |
Regards,
Chetan