How to use BusinessCalendar in BPM Suite 6?
Environment
- Red Hat JBoss BPM Suite (BPM Suite)
- 6.0.x
- 6.1.x
Issue
- How to use BusinessCalendar in BPM Suite 6.x?
Resolution
Basically you will have to create a property file named jbpm.business.calendar.properties and place it in business-central.war/WEB-INF/classes. You can refer to BusinessCalendarImpl.java to obtain further details regarding the content of this file. In the sample attached, it is setting a holiday as follows:
business.holidays=2015-07-05
business.holiday.date.format=yyyy-DD-mm
In order to enable that in your process, you will have to set that file name and BusinessCalendarImpl. In the sample provided, it is set in a Script Task as follows:
kcontext.getKnowledgeRuntime().getEnvironment().set("jbpm.business.calendar", new org.jbpm.process.core.timer.BusinessCalendarImpl());
To run this sample, you will have to adjust jbpm.business.calendar.properties content accordingly and place it in the classes directory from business central as described above, then import the process to a new business process and run it. The process should not execute if you set the current date as a holiday.
Root Cause
Business Calendar works in BPM Suite 6.1, but does not work in 6.0.3 as reported in BZ1222064.
Attachments
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
