Multiple Node Instances Sub Process Index

Hi all,

I am trying to iterate a number of dynamic approval tasks using Multiple Node Instances.  I learned that this is possible but I have a question about how to get the index of the current array element.  For example.  My CDT with a list of approvers is approverData and I can iterate the list of approvers using approverData[index].approverUser.

So suppose I set up a sub process with MNI and I want to call up these dynamic tasks, within the sub process, how can I reference the current item so I can pass rule input variables back and forth to/from form and pv, sub process and main process etc?

Thanks!

  Discussion posts and replies are publicly visible

Parents Reply Children
  • In that case, the entire array values are appended into each sub process.  For instance with pv!var1={1,2,3,4,5} and pv!var2={"a","b","c","d","e"}, a MNI sup process running over each item in pv!var1, input to a text variable as =pv!var1 & pv!var2, each subs receives "1;2;3;4;5a;b;c;d;e".  

    To get the desired behavior, tp!instanceindex is the solution here:

    =pv!var1[tp!instanceindex] & pv!var2[tp!instanceindex]

    Resulting in:

    1a

    2b

    3c

    4d

    5e

  • 0
    Certified Lead Developer
    in reply to Chris

    I think maybe you added a new PV in your parent process?  I wanted a new parameter in the subprocess to test different ways of passing in the values in the parent's subprocess node (and to specify, testing how it works without utilizing tp!instanceIndex).

  • I had added new variables in both the parent and the sub for testing.

    Similarly, if we use an input from the parent as you note =pv!var1 & "test", the entire pv!var1 is passed to each sub process, such as "1;2;3;4;5test".

    In my testing if the array variable is not the only input to the sub process for that parameter, it's entirety is sent for each instance - not automatically sending only the instance of the array per instance of sub process.