Unknown process variable

My BPMN includes timer and the process is deployed as part of Spring boot microservice as embedded engine.

Database is common between this microservice and other shared engine based workflows.

I have @EnableProcessApplication(“myapp”) annotation on Spring application class and also empty processes.xml. I am building the process engine via @configuration based class. Here is the code:

`@Configuration

public class CamundaProcessEngineConfig {

private static final String PROCESS_ENGINE_HISTORY_DEPTH = "full";
private static final String PROCESS_ENGINE_NAME = "mycustom-engine";

@Autowired 
private DataSource dataSource;

@Bean
public PlatformTransactionManager transactionManager() {
	return new DataSourceTransactionManager(dataSource);
}

@Bean
public ProcessEngineConfiguration processEngineConfiguration() {
    ProcessEngineConfiguration pec = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration();
    pec.setDataSource(dataSource);
    pec.setProcessEngineName(PROCESS_ENGINE_NAME);
    pec.setDatabaseSchemaUpdate("true");
    pec.setJobExecutorActivate(true);
    pec.setHistory(PROCESS_ENGINE_HISTORY_DEPTH);
    pec.setJobExecutorDeploymentAware(false);
    return pec;
}

@Bean
public ProcessEngine processEngine() {
		return processEngineConfiguration().buildProcessEngine();
 }

}`

I am expecting that only the timer jobs that corresponds to this process engine be picked but I am seeing that other workflows’ timer objects are firing into my workflow though the other workflows are part of the shared engine.

Also, seeing the following in the log

02:08:21.819 [JobExecutor[org.camunda.bpm.engine.spring.components.jobexecutor.SpringJobExecutor]] DEBUG org.camunda.bpm.engine.cmd - ENGINE-13006 Finishing command -------------------- AcquireJobsCmd ----------------------
02:08:21.819 [JobExecutor[org.camunda.bpm.engine.spring.components.jobexecutor.SpringJobExecutor]] DEBUG org.camunda.bpm.engine.jobexecutor - ENGINE-14022 Acquired 0 jobs for process engine ‘default’:
02:08:21.819 [JobExecutor[org.camunda.bpm.engine.spring.components.jobexecutor.SpringJobExecutor]] DEBUG org.camunda.bpm.engine.jobexecutor - ENGINE-14011 Job acquisition thread sleeping for 19725 millis

Why is the log statement indicates that the process engine still is default and not the one that I specified?

Is the above configuration and the building of the process engine correct? Please help with any pointers and/or solutions.

thank you

Hi @sudargudipati,

in your case you have to configure the job exector to be deployment-aware. The default setting for spring boot is false: https://docs.camunda.org/manual/7.13/user-guide/spring-boot-integration/configuration/#camunda-engine-properties

camunda.bpm.job-execution.deployment-aware: false

Hope this helps, Ingo

Thank you for the quick reply and pointers provided. I am experiencing another issue as well. Not sure if I should post here or not.

After making the job executor as deployment-aware, I am seeing that my delegate is not being executed that is supposed to execute after the timer in my workflow. I am running the workflow in my local and there are no other instances running during this time. But still I get the following exception:

> org.camunda.bpm.engine.OptimisticLockingException: ENGINE-03005 Execution of 'DELETE MessageEntity[63e45e7f-b4f1-11ea-a666-723ad87a4ecb]' failed. Entity was updated by another transaction concurrently.
> 	at org.camunda.bpm.engine.impl.db.EnginePersistenceLogger.concurrentUpdateDbEntityException(EnginePersistenceLogger.java:125)
> 	at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.handleOptimisticLockingException(DbEntityManager.java:323)
> 	at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flushDbOperationManager(DbEntityManager.java:295)
> 	at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flush(DbEntityManager.java:278)
> 	at org.camunda.bpm.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:247)
> 	at org.camunda.bpm.engine.impl.interceptor.CommandContext.close(CommandContext.java:176)
> 	at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:113)
> 	at org.camunda.bpm.engine.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
> 	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
> 	at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
> 	at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:66)
> 	at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
> 	at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobHelper.executeJob(ExecuteJobHelper.java:35)
> 	at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobHelper.executeJob(ExecuteJobHelper.java:28)
> 	at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.executeJob(ExecuteJobsRunnable.java:82)
> 	at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:56)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> 	at java.lang.Thread.run(Thread.java:748)

After the above exception, delegate is resulting in

Unknown property used in expression: ${vendorServiceDelegate}. Cause: Cannot resolve identifier ‘vendorServiceDelegate’

Stack trace is as follows:

> org.camunda.bpm.engine.ProcessEngineException: Unknown property used in expression: ${vendorServiceDelegate}. Cause: Cannot resolve identifier 'vendorServiceDelegate'
> 	at org.camunda.bpm.engine.impl.el.JuelExpression.getValue(JuelExpression.java:60)
> 	at org.camunda.bpm.engine.impl.el.JuelExpression.getValue(JuelExpression.java:48)
> 	at org.camunda.bpm.engine.impl.bpmn.behavior.ServiceTaskDelegateExpressionActivityBehavior$3.call(ServiceTaskDelegateExpressionActivityBehavior.java:103)
> 	at org.camunda.bpm.engine.impl.bpmn.behavior.ServiceTaskDelegateExpressionActivityBehavior$3.call(ServiceTaskDelegateExpressionActivityBehavior.java:98)
> 	at org.camunda.bpm.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior.executeWithErrorPropagation(AbstractBpmnActivityBehavior.java:108)
> 	at org.camunda.bpm.engine.impl.bpmn.behavior.ServiceTaskDelegateExpressionActivityBehavior.performExecution(ServiceTaskDelegateExpressionActivityBehavior.java:123)
> 	at org.camunda.bpm.engine.impl.bpmn.behavior.TaskActivityBehavior.execute(TaskActivityBehavior.java:65)
> 	at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute$2.callback(PvmAtomicOperationActivityExecute.java:57)
> 	at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute$2.callback(PvmAtomicOperationActivityExecute.java:46)
> 	at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.continueIfExecutionDoesNotAffectNextOperation(PvmExecutionImpl.java:1936)
> 	at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute.execute(PvmAtomicOperationActivityExecute.java:38)
> 	at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute.execute(PvmAtomicOperationActivityExecute.java:27)
> 	at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:89)
> 	at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.invokeNext(CommandInvocationContext.java:125)
> 	at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performNext(CommandInvocationContext.java:104)
> 	at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:79)
> 	at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:611)
> 	at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:587)
> 	at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl$5.callback(PvmExecutionImpl.java:1875)
> 	at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl$5.callback(PvmExecutionImpl.java:1872)
> 	at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.continueExecutionIfNotCanceled(PvmExecutionImpl.java:1942)
> 	at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.dispatchDelayedEventsAndPerformOperation(PvmExecutionImpl.java:1891)
> 	at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.dispatchDelayedEventsAndPerformOperation(PvmExecutionImpl.java:1872)
> 	at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(PvmAtomicOperationTransitionNotifyListenerStart.java:57)

Per document, Optimistic Lock exception will be automatically retried but it is never happening and Unknown property used in expression is the last error. My workflow is never continuing anymore.

Please help.

thanks
Sudar

Hi @sudargudipati,

Could you please provide more details here:

Do you see an incident in the Cockpit? https://docs.camunda.org/manual/7.13/webapps/cockpit/bpmn/failed-jobs/

Is the bean for the delegateExpression available in your project?

Cheers, Ingo

Yes. I see the incident through Cockpit. The error is shown on the delegate.

Delegate bean is present in the project. Delegate first executed and as one of the criteria fails, flow goes toward the timer. When timer expires, control is supposed to go back to the same delegate. This delegate is also marked as Async Before. Still I get the above exception.

Thank you
Sudar

Do you need any other input from my side? Why is the retry not happening either as mentioned in the documentation?

18:57:23.833 [camundaTaskExecutor-1] DEBUG org.camunda.bpm.engine.cmd - ENGINE-13005 Starting command -------------------- FailedJobListener ----------------------
18:57:23.936 [camundaTaskExecutor-1] DEBUG org.camunda.bpm.engine.cmd - ENGINE-13009 opening new command context
18:57:23.937 [camundaTaskExecutor-1] DEBUG org.camunda.bpm.engine.cmd - ENGINE-13005 Starting command -------------------- FailedJobListener$1 ----------------------
1

Are the above log statements correspond to retries of the failed transactions? If so, log shows there was a FailedJobListener and FailedJobListener$1. FailedJobListener$2 never was there in the log.

After the above statements, timer and sub-sequent flow is dead. How can I still solve the issue of OptimistcLock exception?

thank you
Sudar

Hi @sudargudipati,

before the engine creates an incident, it will count down the retries to zero. (default starting by three). Once the incident is visible in the cockpit, the engine will stop working on the task, until you retry the service execution: https://docs.camunda.org/manual/7.13/webapps/cockpit/bpmn/failed-jobs/#retry-a-failed-job.

The issue you described before (Unknown property used in expression: ${vendorServiceDelegate}. Cause: Cannot resolve identifier 'vendorServiceDelegate') has nothing to do with an optimistic locking exception.

Is there a bean with the name vendorServiceDelegate in your application?

Hope this helps, Ingo