IBM Case Manager (ICM), IBM Case Manager Builder, IBM Case Manager Client

Call Complete from In Basket Widget in IBM Case Manager 5.2.x / 5.3.x

July 30, 2019

There is very good post about how to call complete() from In-Basket widget which illustrate well on developerswork post.

Following are the steps to achieve this requirement:

  • Open Page designer of In-Basket widget in IBM Case Manager Builder.
  • Add custom menu on In-Basket widget settings.
  • Select action type Event Action and name Label Complete(s) Case as described below:
call complete from in basket widget
  • Add the following code in execute section of custom event action.

Code:

var selectedWorkItems = payload.WorkItemReference;
var currentWorkItem;
var CONST_RESPONSE="
Complete";
var processedItems =[];
var currentWIE;

if (dojo.isArray(selectedWorkItems)) {
require(["dojo/_base/array"], function(array) {
try {
array.forEach(selectedWorkItems, function (currentWorkItem, idx) {
currentWorkItem.retrieveAttributes(function (currentWob) {
try {
currentWIE = currentWob.createEditable();
currentWIE.lockStep(function(currentWIE) {
try {
currentWIE.setSelectedResponse(CONST_RESPONSE);
currentWIE.completeStep(function(){
try {
processedItems.push(idx);
if (processedItems.length == selectedWorkItems.length) {
//self.onBroadcastEvent("icm.Refresh", {});
//self.onBroadcastEvent("icm.Refresh", payload);
//this.onRefresh();
}
}
catch (Error) {
alert(Error.name + " - " + Error.description + "\r\n" + Error.message);
}
});
}
catch (Error) {
alert(Error.name + " - " + Error.description + "\r\n" + Error.message);
}
});
}
catch (Error) {
alert(Error.name + " - " + Error.description + "\r\n" + Error.message);
}
});
});
}
catch (Error) {
alert(Error.name + " - " + Error.description + "\r\n" + Error.message);
}
});
}
else {
currentWorkItem = selectedWorkItems;
currentWorkItem.retrieveAttributes(function (currentWob) {
try {
currentWIE = currentWob.createEditable();
currentWIE.lockStep(function(currentWIE) {
try {
currentWIE.setSelectedResponse(CONST_RESPONSE);
currentWIE.completeStep(function(){
try {
//self.onBroadcastEvent("icm.Refresh", {});
//self.onBroadcastEvent("icm.Refresh", payload);
//this.onRefresh();
} catch (Error) { alert(Error.name + " - " + Error.description + "\r\n" + Error.message); } }); } catch (Error) { alert(Error.name + " - " + Error.description + "\r\n" + Error.message); } }); } catch (Error) { alert(Error.name + " - " + Error.description + "\r\n" + Error.message); } });
}

  • Once done, save and close the widget settings.
  • Deploy the solution.
  • Test the custom Call complete from in basket widget in IBM Case Manager Client.
  • Output will be like:
complete multiple cases

Note: Similar requirement can be achieved by change response name and move case(s) step forward as well.

You Might Also Like

6 Comments

  • Reply aditya July 5, 2021 at 3:53 pm

    how to save work item on field updated ?

  • Reply Danushka October 26, 2021 at 10:21 am

    How to Implement this functionality on IBM BAW?

    • Reply Junaid Azam November 22, 2021 at 9:49 am

      Hi DANUSHKA,

      Right now, we’re upgrading from IBM Case Manager to Business Automation Workflow (BAW). Surely , let you know once done. Thank you.

  • Reply JayR November 2, 2021 at 9:29 am

    I also want to Implement on IBM BAW. Please help me

    • Reply Junaid Azam November 22, 2021 at 9:50 am

      Hi JAYR,

      Right now, we’re upgrading from IBM Case Manager to Business Automation Workflow (BAW). Surely , let you know once done. Thank you.

    Leave a Reply

    error

    Subscribe