cancel
Showing results for 
Search instead for 
Did you mean: 

processInstance variable in boundary timer

tgebeyehu
Champ in-the-making
Champ in-the-making
Hello everyone,

I create a boundary timer on one of my userTask. and want to set the value of <timeDate> to a process variable that i created in my task listener.

<timerEventDefinition>
        <timeDate>${execution.getVariable('time_duration')}</timeDate>
</timerEventDefinition>


the in the Task listener (which is on create) i set the processVariable   
 
      ……  //somecode
    delegateTask.getExecution().setVariable ("time_duration", df.format(c.getTime()));

i can see that the the variable is set and the date format format is correct from the listener. but the timer is not getting the value at all.

here are some of the things i tried
1. ${time_duration} on the timer - returns Unknown property used in expression error
2. i use the RuntimeService to set the variable still the timer did not get the variable
3. i test the timer with any other value (by a duration, and also date ) to make sure it is working. and it does work.

so my issue is only when i try to use a processvariable that i set on the Listener. Any help? Thank you in advance
2 REPLIES 2

jbarrez
Star Contributor
Star Contributor
Did you try setting the variable before the task is created, for example in a script task before the task or in an execution listener on the sequence flow coming into the task?

tgebeyehu
Champ in-the-making
Champ in-the-making
yeah,
i set the variables in an execution listener instead of task listener and it works fine.

Thank you for your help