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:
- 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:
Note: Similar requirement can be achieved by change response name and move case(s) step forward as well.
6 Comments
how to save work item on field updated ?
Hi ADITYA,
Please refere this link: https://www.ibm.com/docs/en/case-manager/5.2.1?topic=SSCTJ4_5.2.1/com.ibm.casemgmt.development.doc/jsdoc/symbols/icm.model.WorkItem.html
How to Implement this functionality on IBM BAW?
Hi DANUSHKA,
Right now, we’re upgrading from IBM Case Manager to Business Automation Workflow (BAW). Surely , let you know once done. Thank you.
I also want to Implement on IBM BAW. Please help me
Hi JAYR,
Right now, we’re upgrading from IBM Case Manager to Business Automation Workflow (BAW). Surely , let you know once done. Thank you.