Business Rules in BPM Suite 12c

If you use the Business Rules feature in Oracle BPM Suite 12c, the business rules you created can be modified at runtime using the BPM Composer. This way you do not need to spend time changing and re-deploying your application. This feature works the same way in BPM Suite and SOA Suite.

As a starting point, I will use the BPM application created here: Creating a simple BPM Manual Process. Download the sample application: BpmBusinessRulesApp.zip.

In the WebLogic Console, create the president user.

business-rules-in-bpm-suite-12c1

In the JDeveloper, open the AddEmployee process.
Right-click HrOfficer swimlane, choose Add Role and add the President role.

business-rules-in-bpm-suite-12c2

Change the Canonical Model, adding JobName and Salary elements.

business-rules-in-bpm-suite-12c3

Due to the two new elements added, you need to delete and regenerate the AddEmployeeUI project.

business-rules-in-bpm-suite-12c4

Create a Process Data Object, name it as isJobReviewRequired and choose boolean as type.

business-rules-in-bpm-suite-12c5

Create a Business Rule to check if employee needs review, according the Job name.
Add a Business Rule activity between AddEmployee and SaveEmployee activities and name it as CheckJob.
In the Implementation tab, create a new Business Rule and name it as CheckJobRules.
Add the employee node as Input Data Object and the isJobReviewRequired node as Output Data Object.

business-rules-in-bpm-suite-12c6

Open the CheckJobRules.rules file, add a new Global variable and name it as PresidentVariable.

business-rules-in-bpm-suite-12c7

Rename the RuleSet1 as CheckJobRuleSet.
Add two General Rules and name them as ReviewRequiredRule and ReviewNotRequiredRule.
Click the Insert Test link and add a simple test.

business-rules-in-bpm-suite-12c8

Create a Human Task to review added employees.
Add a User activity inside President swimlane and name it as PresidentReview.
In the Implementation tab, create a new Human Task and name it as PresidentReviewHT.
Add the employee Data Object inside Parameters section.

business-rules-in-bpm-suite-12c9

Open the PresidentReviewHT.task file.
Click the Form button, choose Auto-Generate Task Form and name it as PresidentReviewUI.

business-rules-in-bpm-suite-12c10

Add an Exclusive Gateway between CheckJob and SaveEmployee activities and name it as “Is President Review Required?”.
Add a conditional sequence flow between “Is President Review Required?” and PresidentReview activities.

business-rules-in-bpm-suite-12c11

Create a Process Data Objects, name it as salary and choose string as type.

business-rules-in-bpm-suite-12c12

Create a Business Rule to define the salary of employee, according the Job name.
Add a Business Rule activity between “Is President Review Required?” and SaveEmployee activities and name it as CheckSalary.
In the Implementation tab, create a new Business Rule and name it as CheckSalaryRules.
Add the employee node as Input Data Object and the salary node as Output Data Object.

business-rules-in-bpm-suite-12c13

Click the Data Associations link, go to Output section and associate salary and employee.salary nodes.

business-rules-in-bpm-suite-12c14

Open the CheckSalaryRules.rules file and rename the RuleSet1 as CheckSalaryRuleSet.
Add a Decision Table and name it as SalaryDecisionTable.

business-rules-in-bpm-suite-12c15

Add a default sequence flow between PresidentReview and CheckSalary activities.
Done! Our Process looks like the following image.

business-rules-in-bpm-suite-12c16

Go to Business Process Workspace, log in as hrofficer user and add a new employee.
Set the JobName as President and click Submit.
Log in as president user to review the added employee.

business-rules-in-bpm-suite-12c17

Click the OK button, and the SetSalary and SaveEmployee activities will be executed.

business-rules-in-bpm-suite-12c18

PresidentReview activity won’t be executed, if you set another value to JobName.

business-rules-in-bpm-suite-12c19

Waslley Souza

Author: Waslley Souza

Consultor Oracle com foco em tecnologias Oracle Fusion Middleware e SOA. Certificado Oracle WebCenter Portal, Oracle ADF e Java.

Leave a Reply

Your email address will not be published. Required fields are marked *