cancel
Showing results for 
Search instead for 
Did you mean: 

Task DueDate v boundary timer

mikepoole
Champ in-the-making
Champ in-the-making
Please excuse my ignorance on this matter

Could someone tell me the difference between a task DueDate and a boundary timer event - as in, when shoudl you use one and when should you use the other?

Is it as simple as a boundary event takes you to another step whereas the DueDate simply marks a task so that it can be queried as being overdue or not?

Many thanks

Mike
7 REPLIES 7

frederikherema1
Star Contributor
Star Contributor
Mike,

You're assumption is right. The dueDate on the task is just a property of the task, query able through our API. An expired due date doesn't influence process-flow. A timer can.

mikepoole
Champ in-the-making
Champ in-the-making
Thanks so much Frederik.

Really appreciate it

Regards

Mike

mikepoole
Champ in-the-making
Champ in-the-making
Mike,

You're assumption is right. The dueDate on the task is just a property of the task, query able through our API. An expired due date doesn't influence process-flow. A timer can.

So is there a way to tie the two together? ie: do all your logic to set the boundary event's timeDate property and always have the task's DueDate equal that value?

Mike

frederikherema1
Star Contributor
Star Contributor
The timer declaration allows you to specify a "date" using an expression.

<boundaryEvent id="escalationTimer" cancelActivity="true" attachedToRef="firstLineSupport">
   <timerEventDefinition>
    <timeDate>${dateVariable}</timeDate>
  </timerEventDefinition>
</boundaryEvent>       
The Task's dueDate can be set using an expression:


<userTask id="theTask" name="Important task" activiti:dueDate="${dateVariable}"/>

Than it's just a matter of setting the "dateVariable" on your process BEFORE the flow reaches the task (eg. service-task that contains your logic for calculating date in front or ExecutionListener on the transition before the task, …)

mikepoole
Champ in-the-making
Champ in-the-making
Fantastic. Makes perfect sense

Thanks again Frederik

mikepoole
Champ in-the-making
Champ in-the-making
Can I ask what format the activiti:dueDate should be on the User Task?

For the boundary timer, I have no problem setting a process variable to "2012-06-18T11:55:00" but any attempt to put anything else in for the task due date causes a "cannot resolve to a Date" error

Many thanks

Mike

frederikherema1
Star Contributor
Star Contributor
Mike. This is a minor issue I guess, can you create a JIRA for this? The timer accepts ISO-XXX date string, but the dueDate currently only expects an expression that resolves to a java.util.Date.

A current workaround would be to define a bean (using spring or de beans-list on process-engine configuration), e.g.. 'dateBean', and use that to convert ISO-XXX date to actual date:


activiti:dueDate=${dateUtil.convertToDate(timerDateVar)}