Skip to main content
August 2, 2024
Question

How to append CDT from subprocess in a single variable of array type?

  • August 2, 2024
  • 15 replies
  • 0 views

Hello Everyone,

I have an "multipleMeetings" array process variable which of MAP type, its holding the meeting related data as shown in below image, I am running a subprocess(to store it in a database) for each meeting present in multipleMeeting PV by enabling MNI. In the subprocess by inserting the meeting data in database, storing meeting data in meetingDataPV which is single type of meetingInfo CDT, so every time the sub process completes it execution it returns the meetingDataPV to parent process now in parent process i want to append it to another variable which is also a meetingInfo CDT type, but the problem is its appending the last executed instance's meeting data only.

Can anyone help me in this?

    15 replies

    August 6, 2024

    can you provide as to which variable do you need to append ? and i am assuming you are trying to append  it after the write to data store entity. 

    August 6, 2024

    Yes, i am trying to append it in meetingInfo process variable after the write to data store entity sub-process by using script task and that process variable is of same CDT type array varaible

    August 6, 2024

    Provide the screenshot of the process model instance for clarity.

    August 6, 2024

    In this subprocess i am calling Write to data store entity process and passing the data of multipleMeetings variable one by one by enabling MNI, the data is in format of the below image and in the subprocess after inserting meeting details in db i am storing the meeting data in different variable meetingInfo which is of meetingData CDT single type and getting as the output in variable which is same type and then in script task tried appending it in a multipleMeetingInfo variable which is of meetingData CDT multiple types 

    August 6, 2024

    mikes0011
    Brainy
    August 8, 2024

    This is one of those places where trying to use MNI might be 10x the effort of simply building an in-process loop that does what you want manually (and using 3 or 4 nodes instead of the 2 you currently have).  And even then I'm not sure (barring a lot of trying and teeth-gnashing) whether the MNI approach is even feasible here.

    The issue stems from the confusion caused by trying to pass back data from the subprocess while the subprocess is also configured for MNI, because the multiple instances are set to "run at once" and may all complete instantaneously (thus not giving the parent process the chance to update the array before the next value is passed up to the parent and overwrites the instance you were hoping to append).

    My overall suggestion: ditch the subprocess MNI and build a loop.  Or put the loop in your subprocess and pass back the whole array.  Either way the result will be similar.

    August 20, 2024

    Yes looping worked as per my requirements.

    Thanks