bpm-crafters / bpm-crafters/process-engine-worker
Not working auto deployment of BPMN and DMN resources
- Dominant language
- Kotlin
- Stars
- 17
- Forks
- 2
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 4
Description
### Expected behaviour
when dependency added to the project:
`
dev.bpm-crafters.process-engine-adapters
process-engine-adapter-camunda-platform-c8-spring-boot-starter
2025.11.2-SNAPSHOT
dev.bpm-crafters.process-engine-worker
process-engine-worker-spring-boot-starter
0.7.1
`
and properties set as:
`dev.bpm-crafters.process-api.worker.deployment.enabled=true
dev.bpm-crafters.process-api.worker.deployment.bpmn-resource-pattern=classpath*:/**/*.bpmn
dev.bpm-crafters.process-api.worker.deployment.dmn-resource-pattern=classpath*:/**/*.dmn
`
AutoDeploymentOnStartup scans and deploys found resources
### Actual behaviour
Autodeployment is not happening.
### Found source of the bug:
Auto configuration class ProcessEngineWorkerDeploymentAutoConfiguration has @ConditionalOnBean(DeploymentApi::class) annotation. Which in our case expects C8AdapterAutoConfiguration auto configuration kicking in sooner than ProcessEngineWorkerDeploymentAutoConfiguration.
Auto-configuration in Spring works in the way, that it scans auto-configurations imports and if no explicit dependency marked by @AutoConfigureAfter/Before then it is supposed to take them by alphabetical order and load them. In the described case, Spring finds and uses ProcessEngineWorkerDeploymentAutoConfiguration **before** processing of C8AdapterAutoConfiguration (which creates DeploymentApi bean), which resolves @ConditionalOnBean(DeploymentApi::class) as false and no beans for auto deployment get created.
### Found temporary workaround
In the current project, which uses both of those libraries the problem solved by introducing a bridge autoconfiguration like:
`@AutoConfigureAfter(C8AdapterAutoConfiguration.class)
@Import(ProcessEngineWorkerDeploymentAutoConfiguration.class)
public class DeploymentOrderingConfiguration {}`
### Proposed solution
Supposedly neither of C8adapter nor ProsessEngineWorker libraries have to know of each other. So @AutoConfigureAfter/Before is not an option here. The assumption to be checked - is to move the check of existence of DeploymentApi bean from the class level (ConditionalOnBean) on the level of methods. A bit of play with Spring Auto configuration discovery mechanism will be needed
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.