Process Engine Configuration

You can use a Spring application context XML file to bootstrap the process engine. It is possible to bootstrap both application-managed and container-managed process engines through Spring.

Note that you can also use a Spring JavaConfig for bootstrapping instead of XML.

Configure an Application-Managed Process Engine

The ProcessEngine can be configured as a regular Spring bean. The starting point of the integration is the class org.camunda.bpm.engine.spring.ProcessEngineFactoryBean. That bean takes a process engine configuration and creates the process engine. This means that the creation and configuration of properties for Spring is the same as documented in the configuration section. For Spring integration the configuration and engine beans will look like this:

<bean id="processEngineConfiguration"

<bean id="processEngine"
  <property name="processEngineConfiguration" ref="processEngineConfiguration" />

Note that the processEngineConfiguration bean uses the SpringProcessEngineConfiguration class.

Configure a Container-Managed Process Engine as a Spring Bean

If you want the process engine to be registered with the Camunda 7 ProcessEngineService, you must use org.camunda.bpm.engine.spring.container.ManagedProcessEngineFactoryBean instead of the ProcessEngineFactoryBean shown in the example above. You will also need to ensure:

  1. That none of your webapps include camunda-webapp*.jar within their own lib folder, this should be at a shared level.
  2. That your server.xml contains JNDI entries for the ‘ProcessEngineService’ and ‘ProcessApplicationService’ as below:
<!-- Global JNDI resources
     Documentation at /docs/jndi-resources-howto.html

    <Resource name="java:global/camunda-bpm-platform/process-engine/ProcessEngineService!org.camunda.bpm.ProcessEngineService"
              description="Camunda Platform Process Engine Service"
              factory="org.camunda.bpm.container.impl.jndi.ProcessEngineServiceObjectFactory" />

    <Resource name="java:global/camunda-bpm-platform/process-engine/ProcessApplicationService!org.camunda.bpm.ProcessApplicationService"
              description="Camunda Platform Process Application Service"
              factory="org.camunda.bpm.container.impl.jndi.ProcessApplicationServiceObjectFactory" />

In that case the constructed process engine object is registered with Camunda 7 and can be referenced for creating process application deployments and exposed through the runtime container integration.

Configure a Process Engine Plugin

In Spring you can configure a process engine plugin by setting a list value to the processEnginePlugins property of the processEngineConfiguration bean:

<bean id="processEngineConfiguration" class="org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration">
  <property name="processEnginePlugins">
      <bean id="spinPlugin"
            class="org.camunda.spin.plugin.impl.SpinProcessEnginePlugin" />

Using Spring JavaConfig

In addition to the Spring application context XML file, you can bootstrap the process engine using Spring JavaConfig. The configuration class can look like this:

public class ExampleProcessEngineConfiguration {

  public DataSource dataSource() {
     // Use a JNDI data source or read the properties from
     // env or a properties file.
     // Note: The following shows only a simple data source
     // for In-Memory H2 database.

    SimpleDriverDataSource dataSource = new SimpleDriverDataSource();
    return dataSource;

  public PlatformTransactionManager transactionManager() {
    return new DataSourceTransactionManager(dataSource());

  public SpringProcessEngineConfiguration processEngineConfiguration() {
    SpringProcessEngineConfiguration config = new SpringProcessEngineConfiguration();



    return config;

  public ProcessEngineFactoryBean processEngine() {
    ProcessEngineFactoryBean factoryBean = new ProcessEngineFactoryBean();
    return factoryBean;

  public RepositoryService repositoryService(ProcessEngine processEngine) {
    return processEngine.getRepositoryService();

  public RuntimeService runtimeService(ProcessEngine processEngine) {
    return processEngine.getRuntimeService();

  public TaskService taskService(ProcessEngine processEngine) {
    return processEngine.getTaskService();

  // more engine services and additional beans ...


Note that you can define your custom beans in the configuration class, in combination with an additional XML file or using component scan. The following example adds a component scan to the configuration class to detect and instantiate all beans in the package “com.example”.

public class ExampleProcessEngineConfiguration {

  // ...


On this Page: