lab 6 using dynamic teams with ibm process designer · 2015-07-30 · ibm software lab 6 –...

27
IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks within business processes are most often assigned to “teams” – in IBM BPM, a team is used to reference one or more individuals who can participate in a business process. Very often, teams are simply mapped to groups that exist in the organization’s user registry – normally an LDAP repository. In many circumstances, however, you might need to identify the members of a team in a dynamic way – at run-time – rather than by statically associating the team to a group of users. For example, you may need to deploy your solution in different environments, where a certain step of the process might be assigned to different sets of users. Or, you may want to perform some skills-based assignment, with the intent of assigning a certain task the persons who are likely to be the best fit for the task. In IBM BPM, this dynamic task assignment can be accomplished thanks to Team Retrieval services and Team Filter services. Team Retrieval services can formulate the composition of a team based on arbitrary business logic – you can use them to dynamically retrieve the appropriate users for a certain task, for example. Team filter services – on the other hand – can be used to refine the task assignment by “filtering out” (eliminating) users that we may not want to assign the task to. A classic example of a team filter is the implementation of the “four eyes principle”, where we want to make sure that a certain task isn’t assigned to a user that has previously operated on the process. Clearly, Team Filter services have the freedom to make arbitrary changes to the composition of the team – they can also add users based on arbitrary logic. Introduction In this lab, we use the Mortgage Approval Process to demonstrate an example of Team Retrieval and Team Filter services. We are going to use a Team Retrieval service to dynamically formulate the composition of the team that is responsible for the Underwriting step of the process. Then, we are going to use a team filter service to assign the final approval of the mortgage application to selected managers, depending on the level of income of the applicant. The idea is that each manager specializes in dealing with applicants of certain level of income. 6.1 Preparation for the lab You need to perform some preliminary work in preparation for the actual activities. Make sure you have started your VMware image, the Process Center and the Process Designer (see Lab 1).

Upload: others

Post on 20-Feb-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 1

Lab 6 Using Dynamic Teams with IBM Process Designer

Overview Tasks within business processes are most often assigned to “teams” – in IBM BPM, a team is used to reference one or more individuals who can participate in a business process. Very often, teams are simply mapped to groups that exist in the organization’s user registry – normally an LDAP repository. In many circumstances, however, you might need to identify the members of a team in a dynamic way – at run-time – rather than by statically associating the team to a group of users. For example, you may need to deploy your solution in different environments, where a certain step of the process might be assigned to different sets of users. Or, you may want to perform some skills-based assignment, with the intent of assigning a certain task the persons who are likely to be the best fit for the task.

In IBM BPM, this dynamic task assignment can be accomplished thanks to Team Retrieval services and Team Filter services. Team Retrieval services can formulate the composition of a team based on arbitrary business logic – you can use them to dynamically retrieve the appropriate users for a certain task, for example. Team filter services – on the other hand – can be used to refine the task assignment by “filtering out” (eliminating) users that we may not want to assign the task to. A classic example of a team filter is the implementation of the “four eyes principle”, where we want to make sure that a certain task isn’t assigned to a user that has previously operated on the process.

Clearly, Team Filter services have the freedom to make arbitrary changes to the composition of the team – they can also add users based on arbitrary logic.

Introduction

In this lab, we use the Mortgage Approval Process to demonstrate an example of Team Retrieval and Team Filter services.

We are going to use a Team Retrieval service to dynamically formulate the composition of the team that is responsible for the Underwriting step of the process.

Then, we are going to use a team filter service to assign the final approval of the mortgage application to selected managers, depending on the level of income of the applicant. The idea is that each manager specializes in dealing with applicants of certain level of income.

6.1 Preparation for the lab

You need to perform some preliminary work in preparation for the actual activities.

Make sure you have started your VMware image, the Process Center and the Process Designer (see Lab 1).

Page 2: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 2

6.1.1 Adding users to the user registry

We are going to add a few users and a group to the user registry, so that we can reference them later on in Process Designer. Additionally, we are going to set some user attributes, so that we can use those in our team filter.

__1. Open a web browser, and go to the Process Admin web page (http://localhost:9080/ProcessAdmin).

__2. Log in as admin (password admin).

__3. Click User Management ! User Management.

__4. Let’s create three users that we will later dynamically assign to the team of underwriters. The users we want to create are Mary, Laura, and Jason.

Page 3: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 3

__a. Let’s start with Mary. Under Internal BPM User Details, type Mary for the User Name, pick a full name (“Mary Doe”), type password for the password fields – and then click Add:

__b. You’ve created a user! Create users Laura and Jason too. These three users, along with Jack who was created ahead of time for you, will be the underwriters in our scenario.

__c. Now, let’s create three more users: Tom, Anna, and Adam. These three will become the mortgage approvers, along with Mike who already exists on the system.

__d. For the mortgage approvers, we want to create a group. On the left hand side, click Group Management:

Page 4: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 4

__e. On the main pane, click New Group – and name it Mortgage Approvers:

__f. Click Save.

Page 5: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 5

__g. Now, let’s add users to this group: start typing “Mortg…” in Select Group to Modify (1), then click Mortgage Approvers (2), and click Add Users (3). Type Tom in Search for Name (4), and then click Add Selected (5):

__h. Following similar steps, add Adam, Anna, and Mike to the group:

We have a group that we can use for our approval step – later, we will define “specialties” within the group. We want Adam to specialize in the approval of “high income” applicants, Anna to specialize in “medium income” applicants, and Mike and Tom to specialize in the “low income” segment. We define user attributes to “tag” the users with their specialty.

Page 6: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 6

__2. Close the browser window. We are going to come back to Process Admin at a later time, to assign the user attributes.

6.1.2 Import the Process Application

Now that we have our users and group in place, we can start working on the application. Make sure that Process Designer is running – we are going to import the initial application that we want to modify with dynamic teams and team filters.

__1. Switch to Process Designer and click the icon in the upper-right corner. The Process Center should now be open.

__2. Make sure the Process Apps tab is highlighted in Process Center. Click Import Process

App located near the upper-right corner.

__3. Browse… to C:\BPM-V8.5.5-PoT\Lab\Workbook\TEAM\ Mortgage_Application_Process_Teams - V1_-_Initial.twx and click OK:

__4. Click Import to import the Process App.

This process app is a slightly modified version of the Mortgage Approval Process you created in Lab 1.

__5. Click Open in Designer next to Mortgage Application Process Teams (MAPTEAM):

__6. You should be redirected to the Process Designer where the Mortgage Application Process is the current process application of focus for you to work with in this lab.

6.2 Dynamic Team Retrieval

All business processes are composed of different components that are categorized on the left side of your process designer. The topic we are interested in is to how use team retrieval service to assign dynamic teams as well as how to filter certain users dynamically from a team using team filter. For this section, we will use a Team Retrieval Service and Team Filtering Service.

Let’s now use a team retrieval service to dynamically select team members for the Mortgage Underwriters.

6.2.1 Building Team Retrieval Service

We start by creating a Team, and then defining how to dynamically assign members to it.

__1. Open Mortgage Approval Process

Page 7: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 7

__2. Click Underwriters at the margin of the swim lane – where the Assess Risk is located. Notice how that swim lane is now bound to All Users:

__3. We want to change this configuration so that the Underwriters team is assigned to a set of users that is programmatically (dynamically) determined:

__a. From the library, click the plus sign by Teams and then select Team:

Page 8: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 8

__b. Name the team Underwriters and then click Finish:

Page 9: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 9

__c. The Team editor opens up. Check the Specify Team Using Service checkbox – the panel changes, and now you can click Select… under Team Retrieval Service. Select Mortgage Underwriters team retrieval service (we have created this little service for you ahead of time):

__d. Your team definition should look as follows:

__e. Save (Ctrl-S) your work and close the team editor (click on the X on top by Underwriters).

Page 10: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 10

__f. You should now be back to the process diagram. Click again Underwriters by the swim lane margin to expose the properties. In the Properties pane, click Select… by Default Lane Team and select the Underwriters team we just created:

__g. Save your work (Ctrl-S). Now, tasks that are in that lane, like Assess Risk, are by default assigned to the Underwriters team.

__7. Let’s briefly test the dynamic team definition:

__a. Make sure you still have the process editor open on the Mortgage Approval Process. If you aren’t, you can open the editor by selecting Processes and double-clicking

Mortgage Approval Process. Click the play button to run an instance of the process. Click Yes on the pop-up window that may come up. The Inspector view will open up.

Page 11: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 11

With the Active Instance and the active step highlighted, hit Play again to claim the task (your screen may look somewhat different depending on what you did in the past – but you should make sure you are running the first task of this process):

__b. You should see a pop-up window that asks you to pick a user from a team. Since the first task is assigned to All Users, you will see all the users we have configured in the pull-down. Select admin for the first task:

Page 12: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 12

__c. Click OK. The first coach opens up. Type in some information for the Applicant and the Mortgage – just make sure that the yearly income is 60000:

__d. Click Submit to complete the first task. The process now moves to the second task – Assess Risk, which will be assigned to the Underwrites team.

__e. Close the browser. Back in the Inspector, click the Refresh button:

Page 13: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 13

__f. A new task appears on the task list – Assess Risk – assigned to the role Underwriters:

__g. With that task selected, click play again.

__h. The Pick User from Team dialog appears. This time, though, the list is made only of four users (Jack, Jason, Laura, and Mary):

__i. This happens because the task is assigned to the team Underwriters and the team retrieval service has logic that retrieves only those four users. Pick for example Jack from the list and click OK (you may also be asked for the password, depending on whether you have ever used Jack in the past).

__j. The coach for the task appears. There is no need to complete the task now – just close the browser windows.

__4. Let’s now take a look at the implementation of the team retrieval service – so that you fully appreciate that those four users were selected programmatically. We have created a simple and not very realistic implementation, that’s easy to understand. In real life, you may include arbitrarily complex retrieval services.

__a. In Process Designers, switch back to the Designer perspective:

Page 14: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 14

__b. Click Implementation and then double-click Mortgage Underwriters team retrieval service:

__c. The service editor opens up. As we said, this is just a simplistic example – select the Retrieve Mortgage Underwriters box and then – in the Properties pane – switch to Implementation to look at the Javascript code:

__d. In this example, we simply create an instance of the Team object, and populate it with four users. In real life, you might run queries or services to truly dynamically populate the list.

Page 15: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 15

__e. At the top of diagram, switch to the Variables tab. Notice that the variables have a “lock” icon by them. This is because we used a template provided by the product itself to generate this service – a technique that makes it very simple and error-proof to create team retrieval services:

You can now close the service editor.

Congratulations!

You just created and tested Team Retrieval Service to dynamically select users for a team in IBM BPM.

6.2.2 Building Team Filter Service

The team filter service takes the initially resolved team as an input parameter and returns the filtered team, as a Team object. If necessary you can add extra input parameters that are required to filter the team.

In this exercise, we want to use the filter to assign the approval tasks (the third task in our process) to a subset of the Mortgage Approvers group you created a while back. That selection is based on the income level of the applicant.

But before we go ahead and use the filter, we need to create a new custom attribute to “tag” our users, so that we can define who is responsible for low, medium, and high-income approvals.

__1. Let’s create a custom user attribute called IncomeLevel for the Mortgage Approval Process application.

Page 16: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 16

__a. Click the plus sign by Data on the navigator view and then select User Attribute Definition:

__b. Call the attribute IncomeLevel and click Finish:

Page 17: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 17

__c. On the main editor pane, leave the type as String, then pick List for Obtain possible values from… and Add three values: LOW, MEDIUM, HIGH (all UPPERCASE):

__d. Save your work (Ctrl-S) and close the editor by clicking on the X on top of the panel:

__2. Let’s now go back to Process Admin for a few moments to assign this attribute to our users.

__a. Open a browser and navigate again to Process Admin (http://localhost:9080/ProcessAdmin). Log in as admin (password: admin).

Page 18: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 18

__b. Click User Management ! Bulk User Attribute Assignment

__c. On the main pane, click IncomeLevel and then type Mortgage Approvers for the Group. Click Search – the users from that group will be retrieved. Notice that the IncomeLevel attribute is still unset for all of them:

Page 19: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 19

__d. Using the checkboxes and the Assign button, make it so Adam is assigned to HIGH, Anna to MEDIUM, and Tom and Mike to LOW:

__e. Done! Close the browser and go back to Process Designer.

__3. Let’s create a new team, and associate it with the Mortgage Approvers group. Then, we also define the filter:

Page 20: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 20

__a. From the library, click the plus sign by Teams and then select Team

__b. Name the team Mortgage Managers and click Finish:

__c. This time, under Members, click Add group and select Mortgage Approvers:

__d. Save your work (Ctrl-S) and close the team editor (click on the X on top).

Page 21: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 21

__e. Now, on the process diagram, select the task called Review for Approval (1). In Properties, switch to Assignments (2), then select Team for Assign to: (3). Click Select… (4) for Team, and then pick the Mortgage Managers team from the list (5):

(Note: at this time, if you receive an exception indicating a missing resource, you can safely ignore it).

Page 22: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 22

__f. This task will now be assigned to the members of the Mortgage Managers team. One more step: we need to assign the filter service. Click Select… by Team Filter Service, and pick Filter by Income Level service:

__g. For the Team Filter Service Input Mapping, click the selection icon by yearlyIncome and pick application ! customer ! yearlyIncome:

__h. This enables the filter service to work on the yearly income of the applicant. Save your definitions (Ctrl-S).

__4. Let’s now test the filter service.

Page 23: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 23

__a. Make sure you still have the process editor open on the Mortgage Approval Process. If you aren’t, you can open the editor by selecting Processes and double-clicking

Mortgage Approval Process. Click the play button to run an instance of the process. Click Yes on the pop-up window that may come up. The Inspector view will open up.

__b. As we did before, highlight the Active Instance and the active step and hit Play

__c. If a pop-up box appears called Pick User From Role, pick for example admin and click OK (this may occur every time you run a task) .

__a. The first coach displays in a browser window. As before, the only information you need to enter here is the yearly income (set it to 60000), then click Submit.

Close the browser and go back to the Inspector in the Process Designer. Click the refresh icon

to let the Inspector show you the progress of the process and the next available step.

__d. Again, highlight the next available step (which should now be Assess Risk) and click the play button. It pops up to Pick Users from Team as we defined in the Underwriters retrieval service we’ve seen before. Complete this task as Jack (click OK, and then click Submit on the coach). You may need to enter a password for Jack of password.

Page 24: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 24

__e. Close the browser, go back to the Inspector in Process Designer and click refresh again. You should now be on the third step (Review for Approval).

__f. Select the Review for Approval step and click the play button again. This time the Pick User from Team only shows Anna as an option. She is the one who deals with middle-income applicants:

__g. Click Cancel (no need to complete the instance if you don’t want to).

__h. Go back to the Designer perspective, and launch another instance of the process. This time, specify 10000 for the Yearly Income:

__i. When you get to the third step, you will see that now you will be able to complete it as Mike or Tom, since we have defined them to the responsible for the low income applicants:

· Let’s take a quick look at the implementation of the filter service.

__a. From the process library, click Implementation and then double-click Filter by Income Level service:

Page 25: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 25

__b. The service editor shows the following diagram:

__c. There are two steps in this simple flow. The first one determines the income level of the applicant (low, medium, high); the second one performs the actual filtering. Let’s take a look at the first. Double click Determine Income Level:

__d. It’s a decision table that shows that incomes below 40,000 are classified as low; incomes between 40 and 100 thousand are classified as medium, and higher incomes as high. This decision table is implemented in IBM BPM, but you get the idea that it could be also implemented in a full-fledged rule management system, such as IBM Operational Decision Management (IBM ODM).

__e. Close this editor (click on the X a the top of the diagram):

Page 26: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 26

__f. Now, click the Filter by Income Level box on the diagram and switch to the Implementation tab in the Properties pane:

__g. There are a few lines of code – take some time to inspect them. In essence, this script does the following:

• Retrieves the members of the current (passed-in) team

Cycles through each one of the users, and determines whether the attribute “IncomeLevel” matches the value that is passed to the service:

if (aUser.attributes.IncomeLevel == tw.local.incomeLevel)

{

log.info("##!!user "+mems[i]+" found matching attribute "+ aUser.attributes.IncomeLevel);

tw.local.filteredTeam.members.insertIntoList(newTeamSize++, mems[i].name);

}

• When a match is found, the user is added to the filtered team that is then returned to the process.

Congratulations!! You have completed all the parts of the Lab!

Page 27: Lab 6 Using Dynamic Teams with IBM Process Designer · 2015-07-30 · IBM Software Lab 6 – Dynamic Teams Page 1 Lab 6 Using Dynamic Teams with IBM Process Designer Overview Tasks

IBM Software

Lab 6 – Dynamic Teams Page 27

Summary In this Lab, you learned about the dynamic team filter in the BPM Standard edition, you were able to:

● In Part 1 of this exercise you first created a Team Retrieval Service to dynamically create a team. This feature can be used to compose a team based or real time criteria, such as vacation schedules or geographic locations. The list of users can be read from a file or retrieved from an alternate database, as long as the users exist in the BPM user repository.

● In Part 2, you created a filter service to dynamically assign the tasks to the Mortgage Officer based on Income Level assignment. As part of this exercise you also created a user-defined attribute to designate the income level and then used the Process Admin Console to assign values to the IncomeLevel attribute.

● You then used the IncomeLevel attribute along with the yearly income of the applicant in the filtering service to construct the sub-team