Active IQ Unified Manager Discussions
Active IQ Unified Manager Discussions
I am trying to create and use a return variable created by Add-WfaWorkflowParameter as part of an execution expression, and I would be gracious for some help. We are running WFA 5.0.0.0.1 Build 5039721.
Some background:
For DR in my environment, I have to mount SnapMirror destination volumes and make them available via CIFS or NFS, depending on the security style. WFA doesn't allow uninitialized "DP" volumes to be given a junction-path, so my WFA workflow has to initialize the SnapMirror relationship before I can mount the volume.
To error-proof this process, I have added logic to the "Create SnapMirror" command Powershell to create a WFA Return Parameter (called "SnapMirrorInitialized"). If the SnapMirror initialization is successful, the value is set to "True"; in any other result (SnapMirror can't be created or initialized), the value is set to "False".
After the "Create SnapMirror" step is the "Mount Volume" step. For the Parameters information, under the "Advanced" tab, I have configured "Execute this command:" to "If the following expression is TRUE". The expression is ' SnapMirrorInitialized="True" '.
The workflow is configured so that if the source or the destination volume cannot be created (i.e, the creation fails or the volume already exists), the "Create SnapMirror" step is disabled, and this works as expected.
However, When I run a preview of the workflow while specifying a volume that already exists, every step is properly disabled except for the "Mount Volume" step. The "If the following expression is TRUE" doesn't seem to be applying, and the step executes even though "SnapMirrorInitialized" shouldn't exist.
Here are my questions:
Thank you for your time.
Shirley,
If I am following the question correctly, this is expected behaviour. The preview function, does not execute any of the command code. If just checks inputs, filters, finders, templates and input functions for the commands. Since your code sets the variable, that variable does not exist during preview.
Mike
Good Afternoon Mike,
Thank you for the fast response!
Since your code sets the variable, that variable does not exist during preview.
Because the variable doesn't exist during preview, then, the step shouldn't execute because the (SnapMirrorInitialized="True") expression isn't true.
That's what's puzzling me, and some clarification on how and where Return Parameters can be used would really help me out.
Surely,
Shirley
If I'm not mistaken, expressions in WFA are written in MVEL (a subset of Java), and a conditional like you have should have 2 '==' signs, like this:
SnapMirrorInitialized=="True"
I believe that your expression as written ( SnapMirrorInitialized="True") assigns the string value of "True" to the variable ' SnapMirrorInitialized', which evaluates to 'True', and the step is executed.
Thanks for catching that!
With the correction in place, when I attempt to run a preview of the workflow, I get the following error:
I attempted to predefine the return parameter for testing:
But I receive the same error. Can I use return parameters in "Execute this command" expressions?