Dynamice Sub procs with multi values CDT's

hi all,

I'm currently playing with sub processes and the ability to dynamically start a given number of them (MNI), but I'm having a few problems. I'm not sure if's it a gap in my Appian knowledge or a mis understanding of how the product works.

I've created a basic multi-value CDT, 

TEST

fieldA

fieldB

fieldC

 

This is populated in my master process and so I end up with effectively an array.

fieldA      id1    id2    id3

fieldB      AA    BB     CC

fieldC      DD   EE      FF

 

I have configured MNI to run a separate instance of the sub proc for each instance in the CDT. So using the above I get 3 instances of my sub proc started. This I'm happy with.

However my issue is with the data. My sub proc has a pv with the same type of the CDT. In the parent process I have mapped the parent CDT to the sub proc pv.

 

what I was expecting, is that each instance of the sub proc will have it's pv populated with the one instance from the original CDT. i.e

sub proc instance 1 would have id1, instance 2 would have id2 etc. What I'm seeing though is that the full CDT is being mapped over to each instance of the sub proc. 

 

Any ideas ?

  Discussion posts and replies are publicly visible

Parents Reply Children
  • Brill that was the problem. Out of interest is this documented anywhere ?
  • 0
    Certified Lead Developer
    in reply to pauls985
    I haven't seen anywhere...We have used the same approach in our design...
  • ok so I now have this working and my master proc will start X number of sub procs :)
    Each sub proc should perform validation on the data I've passed to it, and Id like it to map to another array within the master proc. So once all the sub procs complete I am left with an array in the master of all the instances where validation failed.
    However the return mapping doesn't allow it ? I can map back to a multi entry field - but at run time the last sub instance to run is overwriting the prev instances. So I'm not getting an array ..
  • 0
    Certified Lead Developer
    in reply to pauls985

    pauls985 , here comes the difficulty..

     

    If the you are capturing only the validation message in sub process, have a process variable of type list in both parent and sub process

    • Pass the pv as reference to the sub process (or we can have a separate output)
    • In sub process , add your validation message by appending to it.(here we can either append to the list or add at specific index i.e tp!instanceindex) 
    • In main process we can then process the pv now.

    If the variable is cdt, it is not recommended to pass as reference.(we do as pass as reference - not a best practice)

    • In this case , we have move the flow in main process when each instance completes
    • Have pv as cdt in input mapping and capture the sub process out when each instance completes.
    • Have another cdt of (same type as above)list, and in script task append the sub process out put to this list
    • After script task add wait node , to wait for all instances completes(have a logic to find out all instances completed)