The Camunda Engine can be used in a Spring Boot application by using provided Spring Boot starters.Spring boot starters allow to enable behavior of your spring-boot application by adding dependencies to the classpath.

These starters will pre-configure the Camunda process engine, REST API and Web applications, so they can easily be used in a standalone process application.

If you are not familiar with Spring Boot, read the getting started guide.

To enable Camunda BPM auto configuration, add the following dependency to your pom.xml:

  1. <dependency>
  2. <groupId>org.camunda.bpm.springboot</groupId>
  3. <artifactId>camunda-bpm-spring-boot-starter</artifactId>
  4. <version>3.0.0</version>
  5. </dependency>

This will add the Camunda engine v.7.9 to your dependencies.

Other starters that can be used are: camunda-bpm-spring-boot-starter-rest and camunda-bpm-spring-boot-starter-webapp.

Overriding Camunda Version

If you want to override the version used by default, add the camunda.version property to your pom.xml with the version you wantto use and add the camunda bom to the dependency management:

  1. <properties>
  2. <camunda.version>7.9.0</camunda.version>
  3. </properties>
  4. <dependencyManagement>
  5. <dependencies>
  6. <dependency>
  7. <!-- Import dependency management from camunda -->
  8. <groupId>org.camunda.bpm</groupId>
  9. <artifactId>camunda-bom</artifactId>
  10. <version>${camunda.version}</version>
  11. <scope>import</scope>
  12. <type>pom</type>
  13. </dependency>
  14. </dependencies>
  15. </dependencyManagement>

Please check version compatibility when selecting Spring Boot Starter and Camunda BPM versions.

Using Enterprise Edition

To use Camunda Spring Boot Starter with Camunda EE you need to:

  • Override the camunda.version with the desired EE version:
    1. <properties>
      <camunda.version>7.9.0-ee</camunda.version>
      </properties>

<dependencyManagement>
<dependencies>
<dependency>
<!— Import dependency management from camunda —>
<groupId>org.camunda.bpm</groupId>
<artifactId>camunda-bom</artifactId>
<version>${camunda.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>

  • Use the EE version of the webapp (camunda-bpm-spring-boot-starter-webapp-ee instead of camunda-bpm-spring-boot-starter-webapp), see also Web Applications:
    1. <dependency>
    2. <groupId>org.camunda.bpm.springboot</groupId>
    3. <artifactId>camunda-bpm-spring-boot-starter-webapp-ee</artifactId>
    4. <version>{project-version}</version>
    5. </dependency>

Supported deployment scenarios

Following deployment scenario is supported by Camunda:

  • executable JAR with embedded Tomcat and one embedded process engine (plus Webapps when needed)
    There are other possible variations that might also work, but are not tested by Camunda at the moment.

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