AnsweredAssumed Answered

Switching to AsyncExecutor

Question asked by sankalpn on May 9, 2016
Latest reply on Jun 20, 2016 by jbarrez
Hi all, I am trying to switch to AsyncExecutor and want to set it up in a clustered mode (enabled on all servers). My process engine configuration looks like this:


  @Bean(name = "processEngineConfiguration")
  public ProcessEngineConfigurationImpl processEngineConfiguration() {
    SpringProcessEngineConfiguration processEngineConfiguration = new SpringProcessEngineConfiguration();
    processEngineConfiguration.setClassLoader(getClass().getClassLoader());
    processEngineConfiguration.setDataSource(dataSource()); // This is a postgres DB
    processEngineConfiguration.setDatabaseSchema(activitiSchema); // Have a separate schema for activiti
    processEngineConfiguration.setDatabaseSchemaUpdate("true");
    processEngineConfiguration.setTransactionManager(annotationDrivenTransactionManager());
    processEngineConfiguration.setJobExecutorActivate(false);
    processEngineConfiguration.setAsyncExecutorEnabled(true);
    processEngineConfiguration.setAsyncExecutorActivate(true);
    processEngineConfiguration.setHistory("full");
    processEngineConfiguration.setMailServerHost(mailServer);
    processEngineConfiguration.setMailServerPort(mailServerPort);
    return processEngineConfiguration;
  }


But when I tested a workflow with two servers, I saw both servers executed a task from the same process instance. Is this expected? How can I configure the process engine so that only one server executes any given task?

Thanks,
Sankalp

Outcomes