BPM, Workflow, and Case

BPM, Workflow, and Case

Come for answers. Stay for best practices. All we’re missing is you.

 View Only

Issue Setting Multi-Valued Business Object in Case Details Page - BAW 23.0.1

  • 1.  Issue Setting Multi-Valued Business Object in Case Details Page - BAW 23.0.1

    Posted Tue April 22, 2025 04:52 PM

    Hello, I am encountering an issue while setting a multi-valued business object in the case details page. Below is the code I am using:

    // var data = [{"AgencyName": {"displayName": "AgencyName","value": "Joe"},"AgencyNumber": {"displayName": "AgencyNumber","value": 45}}];

    var newCaseProperties = new tw.object.Record();

    newCaseProperties.setPropertyValue("T3_Name", "IBM");

    var data = new tw.object.listOf.contentObject.T3_Agency();

    data[0] = new tw.object.contentObject.T3_Agency();

    data[0].AgencyName = "Boston";
    data[0].AgencyNumber = "33617";

    newCaseProperties.setPropertyValue("T3_Agencies", JSON.stringify(data));

    tw.system.saveCaseProperties(tw.local.caseID, "TARGET", newCaseProperties, true);

    However, I am receiving the following error:

    [4/22/25 16:11:40:432 EDT] 00000356 EJBWorkflowMa E com.lombardisoftware.server.ejb.workflow.EJBWorkflowManagerBean doResumeWorkflowEngine An exception occurred in Service Flow with name "SetAgencyName". Details: 
    com.lombardisoftware.component.common.workflow.WorkflowProcessItemException: An exception occurred in activity "Script task" of "Service Flow" with name "SetAgencyName". Task instance id "null". Details: "Runtime error in script ("Process: 'SetAgencyName' ProcessItem: 'Script task' Type: 'ITEM'" -1:-1). Internal Script error: com.lombardisoftware.core.TeamWorksRuntimeException: com.lombardisoftware.core.TeamWorksException: Type mismatch. Value "Boston" must be instance of structured IBM Business Automation Workflow type. Java class found: java.lang.String

    The individual property T3_Name is being set correctly, but the multi-valued business object (Agencies) is throwing the above error.  I suspect the issue might be related to the type mismatch, but I am unsure how to resolve it. I have attached screenshots for your reference.  Could someone please help me identify the root cause and provide guidance on how to fix this issue?  Thank you in advance for your assistance!



    ------------------------------
    Hari Krishna
    ------------------------------