Applying same value over whole array

Hi All,

 

I have a scenario where I am trying to apply the same value to many instances of an array in the process model. I am trying to do it on the output of a script task to no success. Below is what I am trying the below. The pv!currentContract is a cdt and the pv!arrangementList is a nested cdt. So for example, pv!currentContract can only have 1 supervisor, but pv!arrangementList can have multiple supervisors. As it stands, it can update the first row of pv!currentContract.arrangementList but wont apply it to the rest of the rows.

 

 

I have tried editing the 'Other' tab to run the amount of instances in the pv!currentContract.arrangementList but I feel like it just keeps writing over the first line.

 

Any help is greatly appreciated.

 

Thanks

  Discussion posts and replies are publicly visible

Parents
  • Hi Ryan!
    I suggest you create two expression rules:
    The first one should take as paramaters an arrangement CDT - together with the new supervisor id, this rule should use the updateCDT function to set the value of the CDT, and return an arrangementCDT with the updated supervisor id.

    The second rule should take an arrangementCDT list as a paramater, and the new supervisor id.
    This rule should use the apply() function to call the first rule for every arrangementCDT list item (with the new supervisor id as a paramater), and then return an arrangement CDT list.
    - you should be able to test this rule and see the returned List of arrangement CDT's with the supervisor ids set.

    If this works out you should be able to plug this second rule into the output table of the script task, and store the result back into the contract.arrangementList child CDT list.
Reply
  • Hi Ryan!
    I suggest you create two expression rules:
    The first one should take as paramaters an arrangement CDT - together with the new supervisor id, this rule should use the updateCDT function to set the value of the CDT, and return an arrangementCDT with the updated supervisor id.

    The second rule should take an arrangementCDT list as a paramater, and the new supervisor id.
    This rule should use the apply() function to call the first rule for every arrangementCDT list item (with the new supervisor id as a paramater), and then return an arrangement CDT list.
    - you should be able to test this rule and see the returned List of arrangement CDT's with the supervisor ids set.

    If this works out you should be able to plug this second rule into the output table of the script task, and store the result back into the contract.arrangementList child CDT list.
Children
No Data