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:
- What explains this behavior?
- Can I use return variables in this way, and if so what steps/settings am I missing?
- Are there other ways to pass a value created in a Command's Powershell script to the WFA Workflow?
- What might be an alternative solution?
Thank you for your time.