IBM Support

One example to customize the Get Next feature in ICM 5.2

Technical Blog Post


Abstract

One example to customize the Get Next feature in ICM 5.2

Body

Author:      Yan Fen Guo (gyfguo@cn.ibm.com), ICM Case Client QA tester;
                   Xiao Ji Tian (tianxj@cn.ibm.com), ICM Case Client developer.

Automatically “Get Next” is a common feature in business process, IBM Case Manager (ICM) as an application which can conveniently unites content, process and people, certainly it has this feature to provide flexible process controls, this blog entry will show you how “Get Next” works in ICM 5.2 and how to customize it to get next without showing the work items list.

 

Difference between ICM 5.1.1 and ICM 5.2

Assume you open a work item which is not the first one in In-basket, in ICM 5.1.1, after all the following work item has been processed, it can go back to the first one to process the rest; But from ICM 5.2, if a case worker doesn’t choose the first one to start, we think he doesn’t want to process the first one, so “Get Next” won’t go back to work items which are above the one just he opened. This means in ICM 5.2, “Get Next” will only handle the work items which are sequenced following the one you opened, after all done, even there are still some work items in In-basket (which above the one you opened),  it will pop up a dialog says no more work items to deal with.

 

Enable Get Next feature in ICM 5.2

By default, get next feature is not enabled; this means when you complete a current work item, it will automatically close the work detail page. There are two ways to enable get next by the following steps:

1. Open Work Details page in Page Designer.

2. Open Edit Setting window of work item toolbar, switch to Toolbars tab.

3. The first way is to double click to edit “Complete” button, you should be able to see the selection “Automatically get the next work item”. If you select it, every time a case worker clicks Complete button in Work Detail page during runtime, it will automatically retrieve the next work item until all the following work items in In-basket has been processed.

4. Another way is to add a separate “Open Next Work Item” action.

image

In this way, it will add a check box with label “Get Next” to work item toolbar. If you mark “Automatically get the next work item” when adding this action, the checkbox will be selected by default, and vice versa.

image

The second way is suggested since it more intuition, and you can decide whether to get next in runtime, not to speak this setting can overwrite the setting in “Complete” button.

Other notable features about Get Next

1. Get Next won’t deal with locked work item which is locked by other users, but if the next work item is locked by current user himself, it will directly open the work item in edit mode.

2. Get Next will always open the next work item in current work detail page, even the next work item is from different task type with different work detail page.

 

Customize Get Next feature to support the push-only mode

By default, you will see all the work item list and can choose anyone to process, but under some circumstance, user is expected not to see the whole list, every time he login the application, there is only one work item displays and he can only process by sequence. This is push-only mode, like custom service in bank or insurance company. Customer supporters are not expected to choose a favorite custom to service; they just service for any custom the system push to them.

To achieve this, first, we need to hidden In-basket, which can be easily done by hidden default Work page.

Open target solution, switch to Roles tab, click to open target role, then on Pages tab, remove Work page.

            image

 

Second, we need to customize the Work Detail page to retrieve the first work item when work details page loaded. This can be done by the following steps:

1. Open Work Details page in Page Designer.
2. Add a Script Adapter widget to page then click the little black triangle on the top right, select Hide Widget to hide it. Open hidden area, you can see the hidden widget you just added. There is another default Script Adatper1 by default, ignore it since we won’t use it.

image

3. Click the Edit Settings icon on the Script Adapter widget and insert the script below into the JavaScript text area.

var self = this;

var role = self.role;

require(["icm/model/WorkItem","icm/util/WorkItemHandler"], function(WorkItem, WorkItemHandler){

        role.retrieveWorklists(function(inbaskets){

                if(inbaskets.length > 0){ /*if there are multiple In-baskets*/

                        var inbasket = inbaskets[0]; /*we choose the first one, this should be first role's In-basket*/

                        inbasket.retrieveWorkItems(function(resultSet){

                                var items = resultSet.getItems();  /*fetch the work items in this In-basket*/

                                if(items.length >0){  /*if there are multiple work items*/

                                   var first = items[0];  /*get the first one*/

                                   first = WorkItem.fromWorkItem(first);  /*this is to change an ICN work item to the format of ICM work item*/

                                   var workItemHandler = new WorkItemHandler(self);  /*open it*/

                   workItemHandler.handleCurrentPageWorkItem(first);  /*process the next first work item*/                                 

                                }

                        });

                }

        });

});

4. Open the Wire Events window and select Script Adapter, wire Page Container widget to send Page Opened event to Script Adapter.

image

 

Until now we’ve done the configuration, to use it, we need to open the work detail page directly when login ICM. Add these two properties “&page=CmAcmSTEP_DEFAULT_PAGE&pageType=StepPage” to the URL link you get by testing the solution from Case Builder. Like: http://ICMServer:PortNumber/navigator/?desktop=icm&feature=Cases&tos=%TOS%&solution=%Prefix%&page=CmAcmSTEP_DEFAULT_PAGE&pageType=StepPage.

 

When opening the link, it looks like the picture as below. No Work page and In-basket shown, and directly displays a work item.

image

 

Select Get Next checkbox and process the work item, it will automatically push next work item, when all done, the dialog “There are no more work items to be processed in this in-basket or the work item that you handled is at the end of this in-basket.” displays.

image

 

Summary

This blog entry introduces Get Next feature in ICM 5.2 and give an example on how to customize it to push only mode, hope this can give you as a reference when you using this feature.

Additional Reference

·         Getting the next work item with custom logic after completing a work item

·         ICM 5.2 infocenter

·        Push Inbasket is a new feature in ICM5.2.1, so it will be much easier to use it in ICM5.2.1, you can find introduction in this blog: Introduce ICM 5.2.1 new features from one end to end scenario

 

 

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSCTJ4","label":"IBM Case Manager"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

UID

ibm11281154