cancel
Showing results for 
Search instead for 
Did you mean: 

Task DueDate / Period

skay
Champ in-the-making
Champ in-the-making
Hello,

My need has been partially resolved into

http://forums.activiti.org/content/time-duration-support-user-task-due-date

Though I'm puzzled.
Would the current implementation / the resolveDueDate 'roll' after the DateTime.now()?

UserTaskActivityBehavior

if(taskDefinition.getDueDateExpression() != null) {

} else if (dueDate instanceof String) {
          BusinessCalendar businessCalendar = Context
            .getProcessEngineConfiguration()
            .getBusinessCalendarManager()
            .getBusinessCalendar(DueDateBusinessCalendar.NAME);
          task.setDueDate(businessCalendar.resolveDuedate((String) dueDate));
        }


DueDateBusinessCalendar

  public Date resolveDuedate(String duedate) {
    try {
       
       // check if due period was specified
       if(duedate.startsWith("P")){
          return DateTime.now().plus(Period.parse(duedate)).toDate();
       }

Shoud that mean that due date will alway been pushed away in the future of the amount of specified period each time the humanTassk is claimed/trigged ??

6 REPLIES 6

balsarori
Champ on-the-rise
Champ on-the-rise
Yes, the due date will be pushed away in the future the amount of specified period but only once since the resolveDuedate method is only called once when the task is created.

If you want to set task's due date relative to task's assignment each time the task is assigned you will need to use a TaskListener check the user guide

http://www.activiti.org/userguide/index.html#taskListeners

skay
Champ in-the-making
Champ in-the-making
I have a loop with a Human Task / proposed to a group and then claimed by several participants of the group.
This loop represent an approval process.

Would in that case the relveDueDate fixed just once ??

balsarori
Champ on-the-rise
Champ on-the-rise
I'm not sure whether you mean one single task or multiple tasks (multi-instance activity). However, when a task instance is created the reloveDueDate gets called to set the due date on that task instance. So, in case you meant multi-instance user task activity, reloveDueDate will get called for each task instance created. Otherwise, if you meant single task,  reloveDueDate will get called once the task instance is created.

If this does not answer you query, you could share your process definition to better help understanding your point.

balajimurkute24
Champ in-the-making
Champ in-the-making
Hi Bassam, 
       
                  As per comment 4  resolveDuedate will get called for each task instance created.  what does it means? if we have to call resolved date explicitly how could we achieve this.Trying to this because I am implement business calendar my own and in that case I have to set this calculated  business date into that usertask-due date(which will skip the Sunday and Monday from the calendar as non working days). How could I achieve this.Thanks in advance.


Thanks,
Balaji M.

jbarrez
Star Contributor
Star Contributor
"As per comment 4 resolveDuedate will get called for each task instance created. what does it means?"

It means that every new user task entity that gets created will have this method called to determine its due date,

"if we have to call resolved date explicitly how could we achieve this"

By implementing the org.activiti.engine.impl.calendar.BusinessCalendar interface.

debajyoti_deb
Champ in-the-making
Champ in-the-making
Hello,

I am new to Activiti. my scenario is, when a task is not getting executed after the due date is passed, how can i trigger a event for escalation mails? The task will not get completed till the user completes it, that is the task will be at wait stage but escalation mails will be triggered, how can I achieve this?