How can we configure the camunda process engine name in spring boot application

Hello Team,

I try to define the process engine name in my camunda spring boot application but somehow it only load the default process engine.
Could you please share the configuration required to configure the camunda process engine name in spring boot application.

Thank you
Gaurav Gupta

@ggupta011 It can be achieved by creating a configuration class and SpringProcessEngineConfiguration bean.
Hope this helps!

@Configuration
public class CamundaAppContext {

  @Bean
  public SpringProcessEngineConfiguration engineConfiguration(DataSource dataSource, PlatformTransactionManager transactionManager) {
    SpringProcessEngineConfiguration configuration = new SpringProcessEngineConfiguration();
    configuration.setProcessEngineName("<NAMEHERE>");
    // set other attributes for datasource, schema update etc
    return configuration;
  }
1 Like

Hi @ggupta011 ,

I would like to add two more options:

  1. There is a configuration parameter camunda.bpm.processEngineName available which allows modifying the name:
camunda.bpm.processEngineName: "Insert Name!"
  1. I would avoid providing a custom bean with a configuration instance. The main reason is that the proposed answer by @Arjun1007 would disable plugins. The default process engine configuration bean provided by Camunda respects ProcessEnginePlugin beans and configured plugins via xml as well. A similar approach without this downside would be configuring the process engine name via custom plugin tho:
@Component
public class ProcessEngineNamePlugin extends AbstractProcessEnginePlugin {

    @Override
    public void postInit(ProcessEngineConfigurationImpl processEngineConfiguration) {
        processEngineConfiguration.setProcessEngineName("Insert name!");
    }
}

Kind regards
Adagatiya

3 Likes

Solution by @Adagatiya is a very neat solution. We can use plugins like these to update any configuration that we want.

This should be included in the official docs as well.