- Red Hat JBoss BPM Suite (BPM Suite)
- Red Hat Process Automation Manager (RHPAM)
- How to use BusinessCalendar in BPM Suite 6.x?
- How to use BusinessCalendar in RHPAM 7.x?
- Create a property file named
jbpm.business.calendar.propertiesand . 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:
jbpm.business.calendar.propertiesunder your classpath. For Process Server, it would be
kie-server.war/WEB-INF/classes. For Business Central in BPM Suite 6,
business-central.war/WEB-INF/classes. (Note: In RHPAM 7, Business Process is no longer execution engine)
In order to enable that in your process,
A) Configuration approach
kie-deployment-descriptor.xml (You can configure via Business Central GUI)
<environment-entries> <environment-entry> <resolver>mvel</resolver> <identifier>new org.jbpm.process.core.timer.BusinessCalendarImpl()</identifier> <parameters/> <name>jbpm.business.calendar</name> </environment-entry> </environment-entries>
B) Programmatic approach
In the sample (for BPM Suite 6) 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.
Business Calendar works in BPM Suite 6.1, but does not work in 6.0.3 as reported in BZ1222064.
- Learn more
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.