Hi, im trying to prevent deployment of some processes. I have the following structure:
`resources:
- processes:
- a:
- processA.bpmn
- b:
- processB.bpmn`
now in my application.yml im specifying resource pattern:
camunda:
bpm:
deployment-resource-pattern: classpath*:processes/a/*.bpmn
Now i want only processes from resource folder processes/a/
to be deployed.
Since im using @EnableProcessApplication annotation, i have also created META-INF with empty processes.xml
as suggested in this topic for autodeployment, however i can see in logs that no matter how i configure deployment-resource-pattern
, always both processes are getting deployed.
What mistake am i doing? How to properly use deployment-resource-pattern
?
it’s important for me to be able to configure deployment-resource-pattern
within application.yml
1 Like
As mentioned in the post you linked, the behavior you’re looking for with deployment-resource-pattern
isn’t going to work if you’re using @EnableProcessApplication
since auto deployment is essentially disabled (remove @EnableProcessApplication
and you can achieve the behavior you’re looking for, at the risk of enabling auto deployment).
The closest I could see to achieve what you’re looking for is to update your processes.xml
to be relatively empty, but include the desired resources and turning off the scan (as documented here):
<process-application
xmlns="http://www.camunda.org/schema/1.0/ProcessApplication"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<process-archive>
<resource>processes/a/processA.bpmn</resource>
<properties>
<property name="isDeleteUponUndeploy">false</property>
<property name="isScanForProcessDefinitions">false</property>
</properties>
</process-archive>
</process-application>
Unfortunately with this route, I didn’t see an obvious way to specify a pattern.
when you configure in application.yaml
file correct indentation must be used. Otherwise those configuration properties will be ignored
i know i can use processes.xml with the following property:
<properties>
<property name="resourceRootPath">classpath:processes/a/</property>
</properties>
and this works, however i need this property to by changed dynamically, depending on the environment, and since its all in META-INF therefore its packaged during build and i can not swap it later, therefore i wanted to use deployment-resource-pattern
copy-paste issue, these properties are formatted with indentation, fixed it in the original post
Sorry I couldn’t be of more help, as far as I can tell you’re stuck between two methods with slightly different implementations. Hopefully someone else chimes in with another suggestion, but I only see two options:
- Decide if removing
@EnableProcessApplication
is suitable for your project (more info here) and thus re-enabling auto-deploy.
- You could maintain a
processes.xml
deployment descriptor for each environment and maintain a custom property in application.yml
that sets the location for the corresponding environment.