When running both Camunda 7 and Camunda 8 processes from the same process application, you will have files ending all with .bpmn
belonging to Camunda 7 OR Camunda 8.
For visual clarity, you should place the files for the different platform versions in different directories under src/main/resources
of your java project, for example src/main/resources/camunda7
and src/main/resources/camunda8
.
If you try to start your Camunda 7 process application, you will realise that your auto-deployment fails because of invalid bpmn files.
You can fix this by adjusting the META-INF/processes.xml
file of your project. This is in most cases an empty marker file.
If so, you can add this content:
<process-application
xmlns="http://www.camunda.org/schema/1.0/ProcessApplication"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<process-archive>
<properties>
<property name="isDeleteUponUndeploy">false</property>
<property name="isScanForProcessDefinitions">true</property>
<property name="resourceRootPath">classpath:camunda7</property>
</properties>
</process-archive>
</process-application>
The property with the name resourceRootPath
is the only property added compared to the default empty file. This will adjust the classpath scanning for resources to start in the directory you created (src/main/resources/camunda7
here) for your Camunda 7 resources.
If you then add the Camunda Spring SDK to the project, you can use the @Deployment
annotation to auto-deploy resources on startup.
Here, the annotation should be configured like this:
@Deployment(resources = {"classpath*:camunda8/*.bpmn"})
Other file endings (.dmn
, .form
) can be added to the array of resources
.