Parametric roles have been in the Oracle BPM product in releases prior to 11g. Although a portion of this powerful feature has made it back into the product in the 184.108.40.206 feature pack, until this feature supports the use of LDAP group assignments I believe that it will be of limited use. The technique described here will get you around this current limitation and it works for all releases of Oracle BPM 11g.
Many thanks to Arun Pareek for his insight on Oracle BPM 11g parametric roles.
On almost every Oracle BPM project you'll almost always run into a scenario like this one. You are working for an insurance company and you've been tasked to create an insurance underwriting process. The business has told you that there are different kinds of underwriters who are assigned to do specific types of work. Although they are all underwriters, their work is divided into the categories listed below and each category is assigned to a different group of underwriters.
- Work item instances that are for "Full Life" policies for people who work for corporations
- Work item instances that are for "Term" policies for people who work for corporations
- Work item instances that are for "Full Life" policies people who are self-insured
- Work item instances that are for "Term" policies people who are self-insured
In this example, there are two elements in a work item instance's payload (the policy type and the employer type) that determine which underwriters will get which instances. As a result, the work is divided into the four different groups of people shown above. Even though these different groups of people are doing the same activity, work item instances need to be specifically assigned to the participants assigned to only one of the four groups. One group of participants should not have visibility to the other’s instances.
Here is one approach that could automatically distribute the work.
Although creating separate swimlanes for each of the different type of underwriters solves the problem, it is extra work to model it this way, unnecessarily complicated and causes the same duplicate activity to be created in each of the four different roles.
Using the parametric role technique, your process will instead look like this when it is done.
Create the Application with the Process
In this section, you will create a new application, the process shown above and add a data object variable. If you are currently using 220.127.116.11. If you are using 18.104.22.168 and have downloaded the application, you can skip to the next section where you will begin by creating a business rule for the automatic assignment of the human task.
Create a new BPM Application.
Give the project the same name that you gave the application and name the process Underwriting Review. Select Asynchronous Service.
Business rules work with XSD based data object variables.
Add the incoming argument for the Start Event.
Open the ParametricRole.XSD file that you just downloaded.
Add the same component as a new data object variable in the process.
Map the Start Event's policy argument with the process's policy data object variable by double mouse clicking the Start Event click the Implementation tab click Data Associations map the Start event's policy to the process's policy data object. In 22.214.171.124 with the feature pack and beyond, this mapping looks like this.
Drag the End event to the right in the process. Add a new Interactive activity into the sequence flow between the Start and End events name the activity Review Order add a new role called Underwriter.
Your process should now look like this.
Double click the new interactive activity click the Implementation tab enter Review Order in the Title field click the icon to add a human task to the activity.
Name the human task ReviewOrder click the icon to add a data object drag the policy data object as shown below.
Save your project.
Create a Business Rule for the Human Task Assignment
In this step, you will assign the work item instance to a set of participants based on the data object payload sent into the interactive activity. When creating instances, you will set the employeeType element to either "CORPORATE" or "INDIVIDUAL" and you will set the policyType element to either "TERM" or "FULL LIFE".
In the BPM Project Navigator tab, open the human task in the project.
Click the Assignment tab double click the icon.
Create the ruleset that will be invoked that will assign the correct group of participants to the work item.
Create an IF/THEN rule (do not use a Decision Table for this - it will not work).
Each set of IF/THEN statements represents one rule that (if it evaluates as true) will be used to assign the current instance to a specific group. In this example, for simplicity - I have only created two of the four group assignments.
Change the rule's default name (Rule1) to the more meaningful name Corporate_Term by clicking the default rule name entering the new rule's name (note that you have to hit the Enter key for the change to take effect). This first rule will be the rule that sets the work item to the LDAP group named CorporateTerm.
Under the rule, click the IF statement's <insert test> click the operand on the left and set it to Task.payload.policy.policyType as shown below.
Click the operand on the right and type in the text "TERM" (surrounded by double quotes).
Click <insert test> again and set it to Task.payload.policy.employeeType == "CORPORATE"
Set the THEN logic by clicking <insert action> select call from the list.
Select CreateResourceList() from the list.
When this rule evaluates as true, this method will cause the instance to be sent to the participants in an LDAP group called CorpTerm. Change the users first parameter in the method to null (if you had instead wanted individual participants assigned using this this rule then they could be added here in a comma separated format - using LDAP groups is preferable in most cases so set this null) change the groups second parameter to "CorpTerm" surrounded by double quotes (the LDAP group you will create in the next section) change the approles third parameter to null (if you wanted to instead use the out of the box Oracle BPM application role definitions instead of an LDAP group, then you would enter the application role name here) change the ResponseType fourth parameter to ResponseType.REQUIRED (this needs to always be required unless this is an FYI activity that does not require a response) change the ruleName fifth parameter to "Corporate_Term" surrounded by double quotes (this needs to be the same name you gave the rule) change the lists sixth parameter to the predefined Lists variable.
Your first rule should look like this.
Create the second rule to handle FULL LIFE / CORPORATE policies by clicking the icon as shown below.
Change the name of the rule and add the IF and THEN logic as shown below.
You now two rules which is sufficient to continue to the next step. It is optional, but you may want to add the two additional rules to handle the TERM / INDIVIDUAL and FULL LIFE / INDIVIDUAL underwriter group assignments at this point as well.
Create the LDAP Groups and Assign Participants
Your rules reference LDAP groups that do not currently exist. Create them now and assign different participants to each of the four roles. If you are using the default WebLogic security realm, follow the steps below.
Log onto the WebLogic console.
Add the groups by clicking Security Realms myrealm Users and Groups Groups New add the CorpTerm, CorpFullLife, IndividualTerm and IndividualFullLife groups.
Add the users and assign them to the groups by clicking Security Realms myrealm Users and Groups Users click jcooper Groups add CorpTerm to jcooper's list of role assignments Save. Repeat this for jstein and assign this user to the CorpFullLife role. If you added the IndividualTerm and IndividualFullLife groups, then assign a different user to each of these as well.
Deploy and Test the Parametric Role Business Rules
Deploy the BPM project.
Log into Enterprise Manager. Test your work by clicking the Underwriting project click the Test button on the top row.
Enter some text in the Id field and enter TERM and CORPORATE in the PolicyType and EmployeeType fields click the Test Web Service button.
Log into the Workspace as jcooper and verify that a new work item instance has appeared in the worklist. As shown below, note that the work item instance is assigned to all users in the CorpTerm group.
Download the completed version of this application built in Oracle BPM 126.96.36.199 by clicking here (save the download as a zip file and extract it).
Having a business rule that is invoked by a human task provides a simple and easy way to maintain way to create parametric role functionality in all releases of Oracle BPM 11g.
Because it is a business rule, the business rule criteria can be modified by a business user in Composer. Because it assigns the work to users in an LDAP group, there is much less maintenance that has to be done by the administrator. Both the rules and LDAP group membership can be edited in the production system live without having to redeploy the project.