Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-12656

TimerStartEvents of EventSubprocesses can't evaluate timer expressions when started at specific activity

    XMLWordPrintable

Details

    Description

      Steps to reproduce

      • Create a sample Process with a TimerStartEvent on a EventSubprocess
      • TimerStartEvent uses expression for the timer duration, like ${escalationPeriod}
      • Process instance is started with timer expression variable (escalationPeriod = "PT1S") at specific activity
         ProcessInstantiationBuilder builder = runtimeService.createProcessInstanceByKey("dyn-timer-sample").setVariable("escalationPeriod", "PT1S");
                builder.startBeforeActivity("DO_SOMETHING"); 

      Observed Behaviour

      • Process instance starting fails
      • The following exception is printed
        org.camunda.bpm.engine.ProcessEngineException: Unknown property used in expression: ${escalationPeriod}. Cause: Cannot resolve identifier 'escalationPeriod'
        	at org.camunda.bpm.engine.impl.el.JuelExpression.getValue(JuelExpression.java:63)
        	at org.camunda.bpm.engine.impl.el.JuelExpression.getValue(JuelExpression.java:51)
        	at org.camunda.bpm.engine.impl.jobexecutor.TimerDeclarationImpl.resolveAndSetDuedate(TimerDeclarationImpl.java:131)
        	at org.camunda.bpm.engine.impl.jobexecutor.TimerDeclarationImpl.initializeConfiguration(TimerDeclarationImpl.java:99)
        	at org.camunda.bpm.engine.impl.jobexecutor.TimerDeclarationImpl.postInitialize(TimerDeclarationImpl.java:158)
        	at org.camunda.bpm.engine.impl.jobexecutor.TimerDeclarationImpl.postInitialize(TimerDeclarationImpl.java:40)
        	at org.camunda.bpm.engine.impl.jobexecutor.JobDeclaration.createJobInstance(JobDeclaration.java:125)
        	at org.camunda.bpm.engine.impl.jobexecutor.TimerDeclarationImpl.createTimer(TimerDeclarationImpl.java:185)
        	at org.camunda.bpm.engine.impl.jobexecutor.TimerDeclarationImpl.createTimerInstance(TimerDeclarationImpl.java:170)
        	at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.createTimerInstances(ExecutionEntity.java:427)
        	at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.initializeTimerDeclarations(ExecutionEntity.java:419)
        	at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.startWithoutExecuting(PvmExecutionImpl.java:297)
        	at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.startWithoutExecuting(ExecutionEntity.java:465)
        	at org.camunda.bpm.engine.impl.cmd.StartProcessInstanceAtActivitiesCmd.execute(StartProcessInstanceAtActivitiesCmd.java:87)
        	at org.camunda.bpm.engine.impl.cmd.StartProcessInstanceAtActivitiesCmd.execute(StartProcessInstanceAtActivitiesCmd.java:50)
        	at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:28)
        	at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:110)
        	at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:70)
        	at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
        	at org.camunda.bpm.engine.impl.ProcessInstantiationBuilderImpl.executeWithVariablesInReturn(ProcessInstantiationBuilderImpl.java:166)
        	at org.camunda.bpm.engine.impl.ProcessInstantiationBuilderImpl.execute(ProcessInstantiationBuilderImpl.java:132)
        	at org.camunda.bpm.engine.impl.ProcessInstantiationBuilderImpl.execute(ProcessInstantiationBuilderImpl.java:128)
        	at at.jrap.bpm.plain.DynTimerTest.shortRunFail(DynTimerTest.java:71)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        	at java.lang.reflect.Method.invoke(Method.java:498)
        	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
        	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
        	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
        	at org.camunda.bpm.engine.test.ProcessEngineRule$1.evaluate(ProcessEngineRule.java:172)
        	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
        	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
        	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
        	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
        	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
        	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
        	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
        	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
        	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
        	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
        	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
        	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
        	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        	at java.lang.reflect.Method.invoke(Method.java:498)
        	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
        	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
        	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
        	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
        	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
        Caused by: org.camunda.bpm.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier 'escalationPeriod'
        	at org.camunda.bpm.engine.impl.juel.AstIdentifier.eval(AstIdentifier.java:83)
        	at org.camunda.bpm.engine.impl.juel.AstEval.eval(AstEval.java:50)
        	at org.camunda.bpm.engine.impl.juel.AstNode.getValue(AstNode.java:26)
        	at org.camunda.bpm.engine.impl.juel.TreeValueExpression.getValue(TreeValueExpression.java:114)
        	at org.camunda.bpm.engine.impl.delegate.ExpressionGetInvocation.invoke(ExpressionGetInvocation.java:40)
        	at org.camunda.bpm.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:58)
        	at org.camunda.bpm.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocationInContext(DefaultDelegateInterceptor.java:92)
        	at org.camunda.bpm.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:63)
        	at org.camunda.bpm.engine.impl.el.JuelExpression.getValue(JuelExpression.java:60)
        	... 54 more
        

      Expected Behaviour
      The start event with variable expression should get evaluated, and no exception should be thrown.

      Hint

      • The test works when using runtimeService.startProcessInstanceByKey().
      • The startWithoutExecuting() method calls setVariables() after calling initializeTimerDeclarations() in contrast to the start() method.

      mgm-controller-panel

        This is the controller panel for Smart Panels app

        Attachments

          Issue Links

            Activity

              People

                miklas.boskamp Miklas Boskamp
                garima.yadav Garima Yadav
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Salesforce