Load process definitions from multiple modules in camunda

Akka Jaworek :

I'm trying to configure Camunda automatic resource deployment for a multimodule project. What I want to archive is that for the following project structure:

\---learnCamunda
|   pom.xml
+---application
|   |   pom.xml
|   +---src
|       \---main
|           +---java
|           |   \---com
|           |       \---camunda
|           |            \---learnCamunda
|           |               |   LearnCamundaApplication.java
|           |               \---configuration
|           |                       CustomOracleDialect.java
|           |                       FlywayConfiguration.java
|           |                       H2ConsoleConfiguration.java                 
|           \---resources
|               |   application.properties
|               |   
|               \---processes
|                       loanRequest.bpmn                      
+---contract-management
   |   pom.xml 
   \---src
      \---main
          +---java
          |   \---com
          |       \---camunda
          |           \---learnCamunda
          |               +---dto
          |               +---dts
          |               +---entity
          |               \---enums
          \---resources
              \---processes
                      DUMMY_PROCESS.bpmn

where application and contract management are modules of learnCamunda project, I want my application.properties to provide classpath for Camunda resource scan to pickup both loanRequest.bpmn and DUMMY_PROCESS.bpmn. Is that possible via application.properties in application module? (The application module has dependency on contract-management module)

If it is possible then which camunda property -- should I set it and to what?

I have already tried different combinations of deployment-resource-pattern but non of them worked.

EDIT: One thing i noticed is that PathMatchingResourcePatternResolver.findAllClassPathResources loads all resources from target, my compiled model is in target.classes.processes and classpath resource from resolver is target.classes so it seems it's not done recursively, but im having hard time to confirm this

Andrew Tarry :

You are correct to be looking at the deployment-resource-pattern property as the place to start. By default, it will include classpath*:**/*.bpmn so your file should be loaded.

That suggests the problem is either the value of deployment-resource-pattern has been changed or the contract-management jar is not on the classpath.

I suggest you try debugging the app to check the value of camunda.deployment-resource-pattern. Then have a look at the build process and make sure your application depends on contract-management, its the same version and the parent pom is building both of them.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=159384&siteId=1