BPM, Workflow, and Case

  • 1.  Multiple Cases Complete at once

    Posted Mon October 18, 2021 10:08 AM
    I was following the article (Call Complete() from In-Basket Widget in IBM Case Manager 5.2.x / 5.3.x - iparagons blog/) for trying to complete multiple cases at once in BPM Process. But when I am trying to run it like the below image, I am getting the following error.




    This is the code I am using.

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

    console.log("start");
    console.log(selectedWorkItems);


    require(["dojo/_base/array"], function(array) {
    if (dojo.isArray(selectedWorkItems)) {

    console.log("1");

    try {
    console.log("2");
    array.forEach(selectedWorkItems, function(currentWorkItem, idx) {
    console.log(currentWorkItem);
    currentWorkItem.retrieveAttributes(function(currentWob) {
    console.log("3");
    try {
    currentWIE = currentWob.createEditable();

    console.log(currentWIE);
    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 {

    console.log("else");
    currentWorkItem = selectedWorkItems;
    currentWorkItem.retrieveAttributes(function(currentWob) {
    console.log("e1");
    console.log(currentWorkItem);
    try {
    currentWIE = currentWob.createEditable();
    console.log("e2");
    console.log(currentWIE);
    currentWIE.lockStep(function(currentWIE) {
    console.log("e3");
    try {
    currentWIE.setSelectedResponse(CONST_RESPONSE);
    console.log("Response");
    console.log(CONST_RESPONSE);
    currentWIE.completeStep(function() {
    console.log("e4");
    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); } });



    } catch (Error) {
    alert(Error.name + " - " + Error.description + "\r\n" + Error.message);
    }
    });
    } catch (Error) {
    alert(Error.name + " - " + Error.description + "\r\n" + Error.message);
    }
    },function(errcurrentWIE) {
    console.log(errcurrentWIE);
    });
    } catch (Error) {
    alert(Error.name + " - " + Error.description + "\r\n" + Error.message);
    }
    });



    }
    });


    ------------------------------
    Alistair Gardner
    ------------------------------


  • 2.  RE: Multiple Cases Complete at once

    Posted Tue October 26, 2021 01:15 AM
    Any Update?

    ------------------------------
    Alistair Gardner
    ------------------------------



  • 3.  RE: Multiple Cases Complete at once

    Posted Thu October 28, 2021 11:16 AM
    Hi.

    That custom code will not in BAW with BAW process tasks as it was originally written to perform FileNet process task APIs only since that is all ICM knew about.

    You should be able to look at the work item data and get the BAW process task reference ID and use that with any available BAW process APIs via REST.

    ------------------------------
    DAVE PERMAN
    ------------------------------