i have (may be) a trivial problem. I use the first time a orchestrator Foreach element in the context of running workflows which returns Arrays.
the Foreach workflow should collect all this returned Arrays to a new Array. but in the parameter binding it is not allowed to switch Array parameters to
Am i beeing stubpid?
You need to check the "Bind as iterator" checkbox when you click on the source parameter link.
The goal of "for each" is to iterate each element of an array and pass it as parameter input of a workflow not taking an array for input.
For example you have an array of VM and want to run "Power On VM" workflow that takes a vm input.
But how can i handle the Parmater that resturns the called Workflow.
I wrote a workflow that removes special snapshots of a given VM and returns the names of this
snapshots as an Array.
Now i wrote a workflows that should do this for some VMs. That all works fine. But i get in this workflow
only the returned Array of the last called Workflow in the foreach element. If it where only a parameter of may be "String",
than i can define that forech element put the single returned strings in to an array. so i get all return values of the iteration.
but at the moment it looks for me that orchestrator can't collect Array of Arrays.
Maybe it would be more clear with a few screenshots.
thats a good idea.
I attached 3 screenshots.
the picture "vco_WF_Delete_Snaps_for_Single_VM_Params.PNG" views the Workflows Output Parameter.
This WF should be called in the foreach element.
The pictures "vco_WF_Delete_Snaps_for_VMs_IN-Param.PNG" and "vco_WF_Delete_Snaps_for_VMs_OUT-Param.PNG" shows the INPUT/OUTPUT bindings of the foreach element to call the WF for single VMs.
May be i am at the time a blockhead...
So you use for each to get all the snapshots of all the VMs and you are willing to aggregate the arrays of the output ?
I do not think you can do such a binding for the output.
What you can do is to create a workflow that :
Such a workflow can be started in a foreach element with passing an empty array as input and should output the aggregated arrays.
There may be an easier solution.
You can also handle the loop yourself : http://www.vcoteam.info/learn-vco/creating-workflow-loops.html
I hope I got it right. If not apologies. I had a very long day.
your idea ist good 🙂
Now it runs as i need this workflow.
In short for other readers.
I have a WF "A" that returns Array of Strings (lets say retArray). i wrote another WF "Wrapper_A" with input parameter "inArray" and and output parameter
"outArray". This WF calls the WF "A" and has an Script element (only outArray = inArray.concat(retArray)).
In the workflow that shoult be iterate over the WF "Wrapper_A" i initialze a attribute "allRetArray" with empty Array.
in the foreach element i bound input parameter and output parameter of "Wrapper_A" to this attribute.
So i get the returned Arrays of all called WF iterations.
I hope its possible to understand my bumpy english 😉