cancel
Showing results for 
Search instead for 
Did you mean: 

Business calendar with activiti

iabughosh
Champ in-the-making
Champ in-the-making
Dears,
can we define a business calendar in Activiti to define working days? if yes please post the solution .

thanks in advance.
12 REPLIES 12

frederikherema1
Star Contributor
Star Contributor
I beg to differ… Look at org.activiti.engine.impl.calendar.BusinessCalendar, this class has been there since 2 years now, and subclasses are used to calculate timer-dates etc, e.g.:


if (duedate==null) {     
      duedate = businessCalendar.resolveDuedate(dueDateString);
    }

    TimerEntity timer = new TimerEntity(this);
    timer.setDuedate(duedate);
    if (executionEntity != null) {
      timer.setExecution(executionEntity);
    }

This can be plugged into the process-engine configuration, using the BusinessCalendarManager

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Uhhhmmm…. Sorry Frederik I miss the context of your remark… in what regard do you 'beg to differ'? Yes maybe my post was to short, so let me elaborate.

What this issue is about is to be able to have a duration that takes only working days into account. So a P5D issued on tuesday would 'trigger' on the next tuesday  and not on sunday, if there is only a weekend in between and no holiday's…. The current names of the implementation classes, '*BusinessCalendar' are rather misleading since they are just a plain normal calendar 'calculation'  classes and none takes holidays, weekends etc into account.

That is what my 'new/enhanced' DurationHelper class does for the DurationBusinessCalendar… Changing a P5D into B5D makes this possible…

Cheers

frederikherema1
Star Contributor
Star Contributor
Never mind… I didn't see any reference to the existing mechanism, just your remark stating that you can't "define a business calendar in Activiti to define working days?". You actually can right now by having a custom BusinessCalendar that is ALWAYS using business-days whet "P5D" is defined.

But the B instead of P-improvement will be done using an implementation of the "org.activiti.engine.impl.calendar.BusinessCalendar", which I was referring to.

Carry on, nothing to see here Smiley Wink