Subscribe

Iterating a Return Variable

Hello,

Not sure if this is possible but here is the scenario I've got with WFA v2.2:

We've got a CDOT workflow that creates an NFS volume and then a number of qtrees (anywhere from 1-10).  We're converting it to work as part of a web service call to WFA from a home grown storage service.  What I'm trying to do is figure out how I can iterate through the variables that create the qtree in a row loop iteration as return variables.  In the workflow the final command determines what the qtree path is but as a return variable it's only populating it with the value from the loop's final create iteration.

I don't know if return variables can do this but figured I'd check to see if I'm missing something - thanks.

-D

Re: Iterating a Return Variable

D,

Not absolutely certain if I understand your complete requirement, but let me try.  If you want to return variables from every command execution instance in the iteration loop, you can use the WFA2.2 cmdlet Add-WfaWorkflowParameter in your create qtree command  to save the Parameter Name and its instant Value and return them as Workflow Execution parameters. So now when the workflow executes and so does the command iteration it will retrun the Name:Value as workflow execution return parameters and not just the final one.

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Re: Iterating a Return Variable

Sinhaa,

Thanks for your reply - I had a feeling this is what I needed to do and I had found a thread on it already here: https://communities.netapp.com/thread/35416

Maybe you can help clear something up for me regarding my interpretation of this new cmdlet.  When I invoke the AddAsReturnParameter cmdlet does that mean the value is automatically provided as a return parameter or is it just available as one meaning I still have to explicitly call it out in the Return Parameters tab of the Workflow Setup area?

-Dave

Re: Iterating a Return Variable

Dave,

you just need to call the API in the following manner in your command code. It need not be added explicitly in the Return Parameters tab of the workflow. Upon execution they will be available as return parameters.

Add-WfaWorkflowParameter -Name $ParamName -Value $Value -AddAsReturnParameter $true

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.