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

Certified Associate Developer

Hello All,

I have an array variable in my parent process model. Depending on the number of values it holds, I'm running a subprocess for each instance. Every time the sub process completes it execution it returns one value that I need to store in a variable of parent process model but i don't know exactly how I can accomplish this feature. Can someone please help me here? I can give an example to understand the requirement correctly.

 

Suppose a variable in parent process model consists below values

var1:{1,2,3,4},

Now the subprocess is running for each values in variable var1 i.e it runs 4 times as the var1 has 4 values. Everytime the subprocess executes it returns some value. Suppose subprocess returns {a,b,c,d} respectively for each values in var1. Now I need to store this returned values into an array variable inside my parent process model, So that it can hold all the returned values. 

  Discussion posts and replies are publicly visible

Parents
  • Hi ,

    If every time your instances is coming out from Sub process to Parent Process then
    1)use one Script task after that sub process node and in Output tab, while saving into that array variable use "is Append to" Operator to store /append returned value.
    2) Inside your Subprocess only (before ending process) try to append that returned value into array PV and map it "Pass by reference" with Parent Process PV.

    Hope this will work.

    Thanks,
    Sandeep
Reply
  • Hi ,

    If every time your instances is coming out from Sub process to Parent Process then
    1)use one Script task after that sub process node and in Output tab, while saving into that array variable use "is Append to" Operator to store /append returned value.
    2) Inside your Subprocess only (before ending process) try to append that returned value into array PV and map it "Pass by reference" with Parent Process PV.

    Hope this will work.

    Thanks,
    Sandeep
Children