How to deploy an application as WAR and a BPMN model via REST?

Hi,

I was following the Get started guide (https://docs.camunda.org/get-started/bpmn20/) and everything worked just fine. I was able to implement my own Service task class and a BPMN model. Everything worked fine while it was in one WAR file.

However when I deployed Java (as WAR) and BPMN (via REST) seperately I got an error:

The process could not be started. :
Cannot instantiate process definition my-proc:1:23697c9e-c313-11e7-b86a-0242ac11000e: ENGINE-09008 Exception while instantiating class ‘com.example.HelloWorld’: ENGINE-09017 Cannot load class ‘com.example.HelloWorld’: com.example.HelloWorld from [Module “deployment.camunda-webapp-jboss-7.7.0.war:main” from Service Module Loader]

How can I map a Service Task and a BPMN model?

Hi @andis.krauklis,

it looks like you’re using process application to deploy your Java Delegate. Please look at this comment then: Delegates from ServiceTasks are not found if started from Camunda TaskList

Thanks for the replay!

How can I inject this code

during REST call?

You can’t unfortunately.

ManagementService#registerProcessApplication is not exposed to the REST API, as well as the other way to do it: RepositoryService# createDeployment(ProcessApplicationReference processApplication)

You should find the other way around. E.g. re-estimate again, whether you really need to deploy BPMN and classes separately.