Timer error when set before an execution listener

Hi,

We are having a bug with the use of Timers that is very specific. I will try to explain how to reproduce it.

We have added a Timer of 60 seconds before the execution of the Receive task type activities. The Timer is defined as follows in the BPM file:

    <intermediateCatchEvent id="timer_id_1">
      <timerEventDefinition>
        <timeDuration>PT60S</timeDuration>
      </timerEventDefinition>
    </intermediateCatchEvent>

The diagram follows the following flow, it is very simple. Before the execution of each activity there is a 60 second timer:

This scheme works fine if you don’t add any special events. Now, the problem comes when the receive tasks have an execution listener configured.

For some reason, when the timer finishes and should execute the execution listener of the activity (with the name StartAgentDelegate and type “start”) it gives the following error:

2023-01-27 12:57:33,313 ERROR [org.flowable.job.service.impl.asyncexecutor.DefaultAsyncRunnableExecutionExceptionHandler] (flowable-ui-task-Executor-7) Job ae8d17c5-9e39-11ed-a613-6479f0d47bb8 failed: org.flowable.common.engine.api.FlowableException: Unknown property used in expression: ${startAgentDelegate}
        at org.flowable.common.engine.impl.el.JuelExpression.getValue(JuelExpression.java:52)
        at org.flowable.engine.impl.bpmn.helper.DelegateExpressionUtil.resolveDelegateExpression(DelegateExpressionUtil.java:38)
        at org.flowable.engine.impl.bpmn.listener.DelegateExpressionExecutionListener.notify(DelegateExpressionExecutionListener.java:43)
        at org.flowable.engine.impl.bpmn.listener.ListenerNotificationHelper.executeExecutionListeners(ListenerNotificationHelper.java:79)
        at org.flowable.engine.impl.agenda.AbstractOperation.executeExecutionListeners(AbstractOperation.java:78)
        at org.flowable.engine.impl.agenda.AbstractOperation.executeExecutionListeners(AbstractOperation.java:69)
        at org.flowable.engine.impl.agenda.ContinueProcessOperation.executeSynchronous(ContinueProcessOperation.java:153)
        at org.flowable.engine.impl.agenda.ContinueProcessOperation.continueThroughFlowNode(ContinueProcessOperation.java:125)
        at org.flowable.engine.impl.agenda.ContinueProcessOperation.run(ContinueProcessOperation.java:88)
        at org.flowable.common.engine.impl.AbstractEngineConfiguration.lambda$new$0(AbstractEngineConfiguration.java:173)
        at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:97)
        at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:81)
        at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:64)
        at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:26)
        at org.flowable.common.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53)
        at org.flowable.common.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:83)
        at org.flowable.common.spring.SpringTransactionInterceptor.lambda$execute$0(SpringTransactionInterceptor.java:57)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
        at org.flowable.common.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:57)
        at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
        at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
        at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)
        at org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnable.executeJob(ExecuteAsyncRunnable.java:127)
        at org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnable.run(ExecuteAsyncRunnable.java:115)
        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)
Caused by: org.flowable.common.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier 'startAgentDelegate'
        at org.flowable.common.engine.impl.de.odysseus.el.tree.impl.ast.AstIdentifier.eval(AstIdentifier.java:97)
        at org.flowable.common.engine.impl.de.odysseus.el.tree.impl.ast.AstEval.eval(AstEval.java:53)
        at org.flowable.common.engine.impl.de.odysseus.el.tree.impl.ast.AstNode.getValue(AstNode.java:31)
        at org.flowable.common.engine.impl.de.odysseus.el.TreeValueExpression.getValue(TreeValueExpression.java:122)
        at org.flowable.engine.impl.delegate.invocation.ExpressionGetInvocation.invoke(ExpressionGetInvocation.java:34)
        at org.flowable.engine.impl.delegate.invocation.DelegateInvocation.proceed(DelegateInvocation.java:32)
        at org.flowable.engine.impl.delegate.invocation.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:26)
        at org.flowable.engine.impl.el.JuelExpression.resolveGetValueExpression(JuelExpression.java:44)
        at org.flowable.common.engine.impl.el.JuelExpression.getValue(JuelExpression.java:50)
        ... 26 more

We have debugged the StartAgentDelegate code and we have verified that it does NOT get executed. It’s as if it didn’t exist in the code when we added the timer to the flow.
If we remove the timer from the diagram, the execution listener works perfectly.

The strangest of all is that this error only occurs when Flowable’s database is Oracle. When we use an H2 type database it works fine. Could it have something to do with Flowable’s access times to the Oracle database? H2 is much faster than an Oracle. In fact, there are times when it has even worked with an Oracle database. This makes me think that the error is probably due to the access times to the Oracle database, but I don’t know why.

Any ideas will be greatly appreciated.

Thanks and regards.

Hey @josefsabater,

This seems like a really specific problem. Can you please provide us with a minimal reproducible example that we can look into and debug?

Thanks,
Filip