cancel
Showing results for 
Search instead for 
Did you mean: 

Using the jBPM Business Calendar to set the task due date?

jdbrown
Champ in-the-making
Champ in-the-making
I have a workflow where a task should have a due date of 3 business days relative to the the day the task is created.

The "business" day is the catch as one could easily use a task-created event and set:
 taskInstance.dueDate = new Date() + 3; 
   However, that does not take business days into account.

I see Alfresco already includes the jBPM business calendar and wondering what the notation would be to access this in script within a task event?  I believe the business calendar can be used by Timer event in the workflow by something like
<timer duedate="3 business days" transition="launch" >
  So, I was wondering if there is something similar in notation for setting the task due date directly?

If not, any recommendations on what is the best practice for implementing this type of logic, as it seems it would be a fairly common need?

Thanks.
4 REPLIES 4

jdbrown
Champ in-the-making
Champ in-the-making
After looking deeper, I am sure this is not possible out-of-box or using Javascript so I have created an custom ActionHandler to handle this logic in Java.

dgenard
Champ on-the-rise
Champ on-the-rise
Hi, I'll have to implement a similar logic using rules and javascript actions.
Would you mind sharing the code of your java ActionHandler ?

Thanks,
Denis

jdbrown
Champ in-the-making
Champ in-the-making
No problem.  Give me a day to get it tested and cleaned up.

jdbrown
Champ in-the-making
Champ in-the-making
Posted some instructions and the code in my blog:
http://blogs.citytechinc.com/jeffbrown/?p=15