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.
In the WebLogic Console, create the president user.
In the JDeveloper, open the AddEmployee process.
Right-click HrOfficer swimlane, choose Add Role and add the President role.
Change the Canonical Model, adding JobName and Salary elements.
Due to the two new elements added, you need to delete and regenerate the AddEmployeeUI project.
Create a Process Data Object, name it as isJobReviewRequired and choose boolean as type.
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.
Open the CheckJobRules.rules file, add a new Global variable and name it as PresidentVariable.
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.
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.
Open the PresidentReviewHT.task file.
Click the Form button, choose Auto-Generate Task Form and name it as PresidentReviewUI.
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.
Create a Process Data Objects, name it as salary and choose string as type.
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.
Click the Data Associations link, go to Output section and associate salary and employee.salary nodes.
Open the CheckSalaryRules.rules file and rename the RuleSet1 as CheckSalaryRuleSet.
Add a Decision Table and name it as SalaryDecisionTable.
Add a default sequence flow between PresidentReview and CheckSalary activities.
Done! Our Process looks like the following image.
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.
Click the OK button, and the SetSalary and SaveEmployee activities will be executed.
PresidentReview activity won’t be executed, if you set another value to JobName.