Deployment aware not working for the desired architecture

Hello,

I have the following Architecture:
1 - Camunda instance without any additions or modifications, used for rest API and its cockpit.
2 - A Spring boot application with Camunda process engine instance, internal tasks definitions, and some custom rest APIs attached in its war file

Each of those are deployed on its own tomcat environment on different machines.
Both have access to the same databases.
Both are process executor deployment aware.

I want to deploy BPMN files that have the task definitions of their processes in the 2nd environment.

When I do that, I found out that tasks fail because of things like :

org.camunda.bpm.engine.ProcessEngineException: Unknown property used in expression: ${myCustomDelegate}. Cause: Cannot resolve identifier ‘myCustomDelegate’

I know failure comes from the 1st instance,
I noticed that if I deploy the BPMN file through the 2nd instance nothing goes wrong except when I trigger the process from the 1st instance.

I need both instances and I need to run processes from both instances, and deploy BPMN files from both, but only tasks that are available to each instance should run on that instance.

Thank you for your help.

Hello @Kerolos_Bisheer,

Could you post configurations of both applications?

  • processes.xml
  • application.properties

I’m using an environment like yours, with empty processes.xml and application.properties with the following config:

//...
camunda.bpm.process-engine-name=default
camunda.bpm.job-execution.deployment-aware = true
//...

Note that you will have problems to call a process from 1st instance that was deployed on 2st instance.
Because 1st instance doesn’t know java files of 2st instance to execute them.

Hope it helps.

Hello @regissantana

My observations are the following:
1 - When a process is deployed using 2nd (custom) Camunda APIs, it all its tasks are run successfully, whether it is started using the 1st or 2nd Camunda instances. (all the tasks in the process are async before)
2 - When it is deployed from 1st (raw) Camunda, It always fails, whether it is started using the 1st or 2nd Camunda instances.

What I concluded:

  • Deployment aware means that a process will run only on the instance it was deployed from.
  • Meaning it is a BPMN Process based deployment awareness.

What I need:

  • I need the a Task based deployment aware flag,
    – Meaning that a task will be executed on the Camunda instance that has the task implementation.

I am using one Camunda instance from the following docker link

The 2nd one is custom, and it has its configuration overridden in code

@Primary
@Bean
public ProcessEngineConfigurationImpl getProcessEngineConfiguration(
		 @Qualifier("dataSource1") DataSource dataSource,
        PlatformTransactionManager transactionManager,
        ApplicationContext context) {
    SpringProcessEngineConfiguration pec = new SpringProcessEngineConfiguration();

    pec.setDataSource(dataSource); 
    pec.setDatabaseSchemaUpdate("true");
    pec.setJobExecutorActivate(true);
    pec.setJobExecutorDeploymentAware(true);
    pec.getProcessEnginePlugins().add(CamundaReactor.plugin());
    pec.setTransactionManager(transactionManager);
    pec.setJobExecutorActivate(true);

    return pec;
}

@Bean
public ProcessEngine processEngine(ProcessEngineConfigurationImpl pec, ApplicationContext applicationContext) throws Exception {
    ProcessEngineFactoryBean pe = new ProcessEngineFactoryBean();
    pec.setHistoryLevel(HistoryLevel.HISTORY_LEVEL_FULL);
    pe.setProcessEngineConfiguration(pec);
    pe.setApplicationContext(applicationContext);
    return pe.getObject();
}