BPM, Workflow, and Case

 View Only
  • 1.  New case properties does not accept process data. (v20.x)

    Posted Mon November 27, 2023 02:53 PM

    Hi.

    I have a case solution project with an attached internal process. I have mapped some process data to the case properties when i initially created the process and these mappings works fine. However i wanted to add another property to the case solution and map some process data to that new property. While the new property show up in the  process, running the process results in an error as below. (Its a basic string to string value)

    [11/27/23 9:12:54:420 CET] 00026c9e BPDEngineServ E   CWLLG0371E: Failed to start Process: Perform Prolongation Restart Internal for Project: CML_Prolongation, SnapshotName: unnamed_snapshot, SnapshotId: TIP(Snapshot.deb0f383-77cc-4271-a26d-12aa6bf643a9). Error: com.lombardisoftware.core.TeamWorksDecoratingException: Runtime error in script ("Diagram: Perform Prolongation Restart Internal" 1:-1). TypeError: Cannot set property "value" of null to "test2" (<JSScript>#1)
    Script (line 1):
    <B>   1 : tw.local.caseProperties.prolongationProcessId.value = __teamworks_temp_variable_;</B>
    
    
    [11/27/23 9:12:54:421 CET] 00026c9e ExternalClien E   CWLLG2229E: An exception occurred in an EJB call.  Error: [<268message:Runtime error in script ("Diagram: Perform Prolongation Restart Internal" 1:-1). TypeError: Cannot set property "value" of null to "test2" (<JSScript>#1)
    Script (line 1):
    <B>   1 : tw.local.caseProperties.prolongationProcessId.value = __teamworks_temp_variable_;</B>
    
    ><109flowObjectID:/25.a207605a-ef31-49b5-8e71-89d089dfa0e9//403b3095-3fd0-4b92-8381-f6f854eb92d1/Step (Retrieve data from case)>]
                                     com.lombardisoftware.client.delegate.BusinessDelegateException: [<268message:Runtime error in script ("Diagram: Perform Prolongation Restart Internal" 1:-1). TypeError: Cannot set property "value" of null to "test2" (<JSScript>#1)
    Script (line 1):
    <B>   1 : tw.local.caseProperties.prolongationProcessId.value = __teamworks_temp_variable_;</B>

    As you can see on the error it is unable to map the data and shows an error that i have not seen before. 

    However i found a way to get around this error by using:

    tw.system.currentProcessInstance.parentCase.setCasePropertyValues(new tw.object.listOf.String(['CMLPR_prolongationProcessId']), new tw.object.listOf.String(["test2"]))

    But still seems odd that adding new case properties does not work with a normal property mapping?

    I have tested creating new case properties but still the same. I have tested to wait a day to see if it kicks in due to some delay but still the same. I have tested to create new snapshot of the case solution. 

    So if anyone has any insight to what could cause this problem please share.



    ------------------------------
    Christian Lejon
    ------------------------------


  • 2.  RE: New case properties does not accept process data. (v20.x)
    Best Answer

    Posted Wed November 29, 2023 01:38 PM
    Edited by Christian Lejon Thu November 30, 2023 03:21 AM

    @Christian Lejon
    We faced similar issue,not sure if its same.

    Issue was "has default" was turned on if i recall correctly.
    So basically after adding new properties ,you night have to uncheck and check "has default" again to generate new vars.

    Else
    try
    tw.local.caseProperties.prolongationProcessId ={}
    tw.local.caseProperties.prolongationProcessId.value ="New value";

    Hope it helps

    Thanks
    Robin



    ------------------------------
    Robin Rajan
    ------------------------------



  • 3.  RE: New case properties does not accept process data. (v20.x)

    Posted Thu November 30, 2023 03:21 AM

    Hello Robin.

    Thank you for sharing this with me because it solved the issue. I went back to the case and edited the case property by adding a default value to the property and then i tried running the process and now it picked up the data with no errors.

    Interesting that it is only needed for new case properties and not properties that was created initially. But at least now it works so thank you.



    ------------------------------
    Christian Lejon
    ------------------------------



  • 4.  RE: New case properties does not accept process data. (v20.x)

    Posted Thu December 07, 2023 06:04 PM

    Hi. Did the error occur when you tried opening a task from a NEWLY CREATED PROCESS or just when tried to open one from an earlier saved version of the project?



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



  • 5.  RE: New case properties does not accept process data. (v20.x)

    Posted Fri December 08, 2023 05:17 AM

    Well since we are working in our DEV environment any changes applied are saved in the TIP so any changes are sort of updated in real time. Also you question depend heavily on how you have designed your process. In our case the data mapping was performed in an initial step of the process so it only applied when the we created a new case and the system tried to initiate the process. Also as far as i know the case properties are not accessible directly inside a task (coach) so already started instances that had reached the task already was not effected by this.



    ------------------------------
    Christian Lejon
    ------------------------------