Search code examples
springactiviti

Deploying dynamically created BPMN model using Activiti REST API


I am new to Activiti. I am working on a project in which i should be able to create process dynamically using spring mvc. I have come acrossed http://stacktrace.be/blog/2013/03/dynamic-process-creation-and-deployment-in-100-lines/

Is it possible to deploy the dynamically created process using REST API directly or we should create bpmn-20.xml and deploy it. Also is there any example for creating complex process such as using boundary events dynamically.

Thanks


Solution

  • It is possible through this endpoint /activiti-rest/service/deployment! Please check this forum thread for further infos + sample code.

    You do not have to really create the file on your disk, just simulate it with an InputStream of some sort:

    MultipartEntityBuilder builder = MultipartEntityBuilder.create();
    builder.addBinaryBody("deployment", new ByteArrayInputStream((<put-something-here>).toByteArray()), ContentType.DEFAULT_BINARY,"test.bpmn20.xml")