cancel
Showing results for 
Search instead for 
Did you mean: 

Need to Implement Custom Business Calendar

ms1
Champ in-the-making
Champ in-the-making
Hello All,

I need to implement a business calendar which only counts business days for all timers, due dates, etc. For simplicity, we just want to skip Saturdays and Sundays. So, if a task is created on Friday with a 3 day due date, the due date would be the following Wednesday.

I see from other posts in the forum that I can implement my own BusinessCalendar, but I am wondering if anyone has some tips on the best way to do this. Has anyone implemented this or can offer advice on the best way to do this?

Thanks
11 REPLIES 11

ms1
Champ in-the-making
Champ in-the-making
Hi Balaji,

In order to use your implementation, you must set it in the Activiti configuration. Our application uses embedded Activiti, so I used the SpringProcessEngineConfiguration and called setBusinessCalendarManager(BusinessCalendarManager bcm). Construct the bcm with your implementations.

Mark

minhquankq
Champ in-the-making
Champ in-the-making
Hi all,

The BusinessCalendar don't have document, so I still don't understand how to implement BusinessCalendar, so I want to confirm that "resolveDuedate method will return the end date", is it right? (example, current time is Jun 27 2016, duedate is P3D, so the return of resolveDuedate method will be Jun 30 2016).

And I want to use that Calendar for 1 Boundary timer event (Intermediate timer catching event still use nomal calendar), how can I do that? I didn't see any config to set
[img]https://s31.postimg.org/bvyh3hbi3/Selection_004.png[/img]
I have found in the document that we can set in xml
<code>
<timerEventDefinition activiti:businessCalendarName="custom">
    …
</timerEventDefinition>
</code>
It is true? because it doesn't show on the gui, so, I don't know if it 's true. (I'm using version 5.20.0 (activiti-explorer nad activiti-rest), is business calendar availiable on community version?)

Thanks,

Quan Vo