How to specify a subfolder for BPMN files?


#1

I don’t like very much that I have to put the BPMN files under the folder resources. Activiti by default wants the files under resources/processes.

Is there a properties for BPMN files location?


#2

What’s your context? I’m using spring-boot and the application scan everything at the resources folder, even sub folders.


#3

This is not true for me. Maybe I have a more recent version. I had to add

camunda.bpm.deployment-resource-pattern = classpath:workflow/*.bpmn, classpath:workflow/*.dmn, classpath:workflow/*.cmmn

#4

Hi @Marco_Sulla.

I think it would help you.
https://docs.camunda.org/manual/7.8/user-guide/spring-boot-integration/configuration/#camunda-engine-properties

I’m not declaring .deployment-resource-pattern in my application properties, so I’m using default values.

Hope it helps.


#5

@Marco_Sulla If you want to specify a custom location for the processes.xml file, you need to use the deploymentDescriptors property of the @ProcessApplication annotation:

@ProcessApplication(
    name="my-app",
    deploymentDescriptors={"path/to/my/processes.xml"}
)
public class MyProcessApp extends ServletProcessApplication {

}

The provided path(s) must be resolvable through the ClassLoader#getResourceAsStream(String) -Method of the classloader returned by the AbstractProcessApplication#getProcessApplicationClassloader() method of the process application.

Multiple distinct locations are supported.


#6

Yes, it’s the guide I followed. For me the default values seems to be classpath:/, since only bpmn files under resource, and not in subfolders, was recognized. So the custom settings I posted before.


#7

Ok, so, just put these values:
classpath*:**/*.bpmn, classpath*:**/*.dmn, classpath*:**/*.cmmn


#8

Well, it’s kind of tastes. I don’t like that Spring will search in the entire classpath, while I created a specific folder, as I’ve done in post 3

Furthermore, I’m not sure but I don’t think classpath* is useful, since you’re using wildcards to load all files with a certain extension, not a single file.