AnsweredAssumed Answered

Boundary Event, timeDuration based on process variable

Question asked by hheckel on Dec 8, 2010
Latest reply on Dec 28, 2011 by jgardner
Hello,

just wondering, if I can define the timeDuration for a timerEvent using Expression Language to access a process variable similar to:


<boundaryEvent id="myBoundaryEvent" cancelActivity="true" attachedToRef="timeoutNode">
   <timerEventDefinition>
      <timeDuration>${timeoutValue}</timeDuration>
     </timerEventDefinition>
</boundaryEvent>


So far, when creating a process instance and passing in timeoutValue as a process variable, I receive the following error message

Exception in thread "main" org.activiti.engine.ActivitiException: couldn't resolve duedate: ${_timeoutValue}
   at org.activiti.engine.impl.calendar.DurationBusinessCalendar.resolveDuedate(DurationBusinessCalendar.java:44)
   at org.activiti.engine.impl.runtime.ExecutionEntity.initialize(ExecutionEntity.java:167)
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:38)
   at org.activiti.engine.impl.pvm.runtime.ExecutionImpl.performOperation(ExecutionImpl.java:521)
   at org.activiti.engine.impl.pvm.runtime.ExecutionImpl.start(ExecutionImpl.java:362)
   at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:66)
   at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:29)
   at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:22)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:37)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
   at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:48)
   at com.acme.Test.main(ProcessEngineTest.java:41)
Caused by: java.lang.IllegalArgumentException: ${_timeoutValue}
   at org.apache.xerces.jaxp.datatype.DurationImpl.<init>(Unknown Source)
   at org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl.newDuration(Unknown Source)
   at org.activiti.engine.impl.calendar.DurationBusinessCalendar.resolveDuedate(DurationBusinessCalendar.java:36)
   … 11 more

Thanks,
Holger.

Outcomes