How to Submit a Setup From Within a Setup

Follow

This script can be used to submit a setup from within a setup using a JAMS job.  The job will wait for the setup it submits to complete, and return an error if it fails. 

  

### Import JAMS module and define JAMS server
Import-Module JAMS
$JAMSDefaultServer = "localhost"

### Submit the setup
$entryid = Submit-JAMSEntry -Name "SetupName"

### Get the setup we just submitted
$entry = Get-JAMSEntry -Entry $entryid.JAMSEntry

### Wait for it...
Wait-JAMSEntry $entry

### Write the final status of the setup we submitted
Write-Host "Final Status of entry " $entry.JAMSentry "is" $entry.FinalSeverity

### If the setup failed, we fail the job that submits it, so the setup this job is in behaves as expected
If($entry.FinalSeverity -ne "Success"){

Throw "The child Setup has failed!"

}

   

Have more questions? Submit a request

Comments