In ICM 5.2.x / 5.3.x, you can simply hide or disable response button using script adaptor without removing it permanently from ICM.
Following are the steps to achieve this requirement:
- Edit the Work Details page in ICM Builder.
- Add a new script adaptor and named it unique.
- Paste the following code:
var editable = payload.workItemEditable;
if (ecm.model.desktop.currentRole.name === “TestRole”) {var workItem = editable.icmWorkItem; var newResponses = workItem.responses.filter(function(response) { return response !== "Complete"; }); workItem.responses = newResponses;
}/* Note: Change Role Name and Response Name according to yours. */
- Edit Event Wiring. Select source widget Page Container and set its incoming wiring with Send Work Item as mentioned below:
- Save, close and deploy Solution.
- Test the case where you disable response button disabled. It will be hide on that particular role.
Environment:
- WAS 7.0.0.23 / 8.5.5.x / 9.0.5.x
- ICM 5.2.x / 5.3.x.
- ICN 2.0.3.x / 3.0.7.x
Here is the DevlopersWork Post for details: https://www.ibm.com/developerworks/community/forums/html/topic?id=f650d667-b2a8-4c66-a38d-3ae58eceb9ba