How to use BusinessCalendar in BPM Suite / RHPAM?
Environment
- Red Hat JBoss BPM Suite (BPM Suite)
- 6.0.x
- 6.1.x
- Red Hat Process Automation Manager (RHPAM)
- 7.0.x
Issue
- How to use BusinessCalendar in BPM Suite 6.x?
- How to use BusinessCalendar in RHPAM 7.x?
Resolution
- Create a property file named
jbpm.business.calendar.properties
and . 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
-
Place the
jbpm.business.calendar.properties
under your classpath. For Process Server, it would bekie-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.
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.
Comments