By default, the camunda-spring-boot-starter is configured to use the SpringProcessEngineConfiguration auto deployment feature.Since 1.2.0 you also have the possibility to do so via SpringBootProcessApplication. This disables the SpringProcessEngineConfigurationauto-deploy feature and instead uses the required META-INF/processes.xml as an indicator for resource scanning.This also allows all processes.xml configuration features described here.

To use it, just add the @EnableProcessApplication annotation to your Spring Boot application class:

  1. @SpringBootApplication
  2. @EnableProcessApplication("myProcessApplicationName")
  3. public class MyApplication {
  4. ...
  5. }

Some configuration can be done via Spring Boot configuration parameters. Check the list of currently available parameters.

Using Deployment Callbacks

As when using @EnableProcessApplication we don’t extend the ProcessApplication class,we can’t use @PostDeploy and @PreUndeploy method annotations. Instead these callbacksare provided via Spring event publishing mechanism. So you can use the following event listeners:

  1. @EventListener
  2. public void onPostDeploy(PostDeployEvent event) {
  3. ...
  4. }
  5. @EventListener
  6. public void onPreUndeploy(PreUndeployEvent event) {
  7. ...
  8. }

原文: https://docs.camunda.org/manual/7.9/user-guide/spring-boot-integration/process-applications/