By default, a Job that completes will have an exit code of 0 and a Final Severity of “Success”. If a Job completes with any other exit code, it has a Final Severity of “Error”.
If your scripts set different exit codes, JAMS can recognize a custom set of exit code values or regular expression patterns in the output of a Job. This pattern matching feature can be used to return Success or Error for that Job. This is also useful if you need to override the Final Severity based on the content in the Job Log File. To do this, follow the steps in the section below for creating custom Execution Method.
Using Good and Bad Regular Expression Patterns
You can add good and bad regular expression patterns to an Execution Method. If both patterns were added and JAMS does not find a pattern in the Job Log file, the Job completes with a Final Severity of “Warning”. If both patterns were added and JAMS finds a bad pattern, the Job completes with a Final Severity of “Error”.
Specifying Custom Exit Codes and Regular Expression Patterns
You have a few options for which exit codes to use. You can fill in the appropriate values and separate them with commas, if you have multiple custom code values. Follow the steps below for an existing Job or custom Execution Method.
Standard Microsoft .NET regular expression language can be used for the GoodRegex and BadRegex handling.
Creating a Custom Execution Method
- Click Execution Methods from the Shortcuts menu.
- Click +.
- In the Name field, enter a name for this Execution Method.
- In the Base Method field, select an existing Execution Method.
- Click Ok.
- Click the Properties tab.
- For Good Regex patterns, ensure MessageCode is selected from the Exit Code Handling field.
If the specified pattern is not detected within the Log File tab in the Monitor Entry, the Final Severity of the Entry is set to Warning. If the specified pattern is detected within the Log File tab, the Final Severity is set to Success.
- For Bad Regex patterns, the normal integer-based Exit Code Handling, such as ZeroIsGood or OneIsGood, can be retained.
NOTE: The Final Severity will be overridden to Error if a Bad Regex Pattern match is detected regardless of the Exit Code returned by the process.
- Click Save and Close.