Data Infrastructure Management Software Discussions

Syntax to abort Command in WFA

skellner

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

}

2 REPLIES 2

Re: Syntax to abort Command in WFA

korman

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

Re: Syntax to abort Command in WFA

edgel

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.  

 

 

Earn Rewards for Your Review!
GPI Review Banner
All Community Forums
Public