cancel
Showing results for 
Search instead for 
Did you mean: 

Boundary Timer and ISO 8601 usage

jayehsea
Champ in-the-making
Champ in-the-making
I have a user task with a boundary timer attached. The boundary timer uses a process variable to set the time/date as follows:


    <userTask id="waitTask" name="Wait for Timer Elapse" activiti:assignee="system"></userTask>
    <boundaryEvent id="boundaryDailyTimer" name="Daily Task Boundary Timer" cancelActivity="true" attachedToRef="waitTask">
      <timerEventDefinition>
        <timeDate>${nextRunTime}</timeDate>
      </timerEventDefinition>
    </boundaryEvent>

I progammatically set the value of nextRunTime to an ISO 8601 date/time format, such as '2012-12-07T10:47:00'. My process is successfully using the value to trigger the expected action within my business process. All is good.

For debugging purposes I needed to change the value of the nextRunTime process variable, so I could trigger the business process when I wanted. So I used SQL to modify the value in the database as follows:


update act_ru_variable set text_='2012-12-07T22:47:00' where text_='2012-12-07T10:47:00';

This updated the process variable in the database as expected. The application was NOT running while I made this update to the database. I restarted my application, and was surprised to find that the process using the updated process variable still fired at 10:47 AM, even though my application log showed that the nextRunTime variable value was indeed set to '2012-12-07T22:47:00' (or 10:47 PM).

I have other process executions that fire correctly for times such as '2012-12-07T22:47:00', at 10:47 PM. So it appears the 24 hour clock is honored by the boundary timer. I don't understand why my variable modifications were not honored by the processes.

So I have a couple questions:

1) Will using SQL to modify process variables in act_ru_variable have the desired effect on a process instance using that variable?
2) Are process variables maintained by the Activiti engine in another location, such as cache?
3) Is there another way that I should be modifying process variables stored in act_ru_variable table? Will this change be honored by the Activiti engine?

Thanks for helping me understand the workings of Activiti.
Jim
1 REPLY 1

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
1: If the engine was not running, I would suspect it to be taken into account… Unless a job needing this date was already created!
2: no, the processdefinition is cached…
3: the java api?

And why do you need to set it for debugging purposes?  Look at the activiti testcases, there is a clockutil (not sure if it is actually called that way) that can be used to manipulate the actual time seeen by the engine…