Hi All,
I have main process and calls sup process. Suppose sub process will iterate 10 time and each iteration it will generate new id. I want all new generated id by sub process in main process.
I have implemented output option in sub process but it return only last generated id by sub process.
It is possible to get all the id generated by sub process in main process.
Regards,
Umesh
Discussion posts and replies are publicly visible
Sub-processes can be tricky but work well when iterating through a list. When choosing to use 'multi-node instance' by iterating through a list, you can reference the list as a variable to pass into or save out to and Appian will smartly choose the correct index. If you know how many sub-processes you'll be creating, I recommend creating a variable of Integer which is a multiple and calling it Ids. You can use fn!enumerate() in a script task to quickly generate a list. Have the sub-process loop through this list and save your newly generated Id back to the list. That should work, if it does not, consider passing the variable by reference, https://docs.appian.com/suite/help/21.2/Sub-Process_Activity.html#passing-a-process-variable-as-a-reference which means you don't need to save back to the variable since updates automatically persist to the parent process.
Thanks your reply Danny.it is possible without "multi node instance"?
Sure, what do you mean by 'sub process will iterate 10 times'? Are you forming a loop in the process?
As example, I have 10 records and setting in sub process "Run one instance for each item in". So sub process will execute 10 times and each call it will generate new id. I want all new id in main process.
Can you talk more about what you're doing? What activities are you running in the sub-process? What do you need to do with the IDs in the parent process? Some screenshots would be helpful too.
Hi Umesh,
Ensure that the new ID generated by the subprocess is an output variable for that subprocess. I am assuming that the pv! in the parent PM which will store all the Ids is of the same type as in the sub PM, then you will need to update the parent PM script task (where the Id is copied from sub PM to parent PM ) output Operator have the the "is appended to list" selected. refer the image below.
Hello!
I understand what the colleague is mentioning. He wants to retrieve the 'outputs' from the subprocess instances into a single variable in the subprocess node. I have a similar need, and what's happening is that the output variable is being replaced with each execution, which is why only the last record is visible. The screenshot you show doesn't apply to a subprocess node because it doesn't have the 'data' tab.
The output variables option in the configuration only has an '=' (equal) operator; there's no way to select an 'appended'
thank you !