Active IQ Unified Manager Discussions

Syntax to abort Command in WFA

skellner
3,209 Views

How can I abort a WFA command under certain circumstances? Is the following correct?

# If Snapmirror Relation exists abort

$SnapMirrorStatus = Get-NaSnapmirror $SourceVolumeName

if ($SnapMirrorStatus)

{

    Get-WFALogger -Info -message $("Snapmirror Relation " + $SnapMirrorStatus + " already exists")

    exit

}

1 ACCEPTED SOLUTION

korman
3,209 Views

Hi Stefan,

It depends on what you are trying to achieve.

  • if you would like to abort current command and continue to the next one - just use "return" statement - as a result workflow will be "green" and it will continue to the next command
  • if you would like to abort current command and workflow - just throw an exception (throw "user created message") - as a result workflow will be "red" and you will see "user created message" in error box of monitoring screen

Regards,

Sasha Korman

WFA Team

View solution in original post

2 REPLIES 2

korman
3,210 Views

Hi Stefan,

It depends on what you are trying to achieve.

  • if you would like to abort current command and continue to the next one - just use "return" statement - as a result workflow will be "green" and it will continue to the next command
  • if you would like to abort current command and workflow - just throw an exception (throw "user created message") - as a result workflow will be "red" and you will see "user created message" in error box of monitoring screen

Regards,

Sasha Korman

WFA Team

edgel
3,196 Views

Where does one actually go withing hte interface to issue the return statement once the workflow is executing?   I am stuck in an "aborting" state for several workflows with no apparted option to clear this.   There are no reserveations remaining related to these workflows to release.   Just stuck.  

 

 

Public