Return code for job step and notification issue

TJ (32 posts)
January 30, 2020 08:23 AM
Accepted Answer

Hi Support,

I have two questions about failure result handling.

1. I have defined "ProcessExitCode" 0 as True and else as False in a return script and also defined task failed using this return script with action sending out email notification.

  when I execute the job, this step failed and in script debug log, I do see "Script completed with result: false". However I do not receive any email from this step.

One thing I want to mention is that in response tab, I use event "Step failed", I wonder if that is the right event I should use for my intention.

I do have second step if this step is a success, and it did go to the second step successfully.   

 

2. If it is programmatic failure, I receive 255 from adtempus, does adtempus have the ability to send out notification for the failure. 

 

Thanks in advance  

Bill Staff (599 posts)
January 31, 2020 08:04 AM
Accepted Answer

I don't understand your setup/question for #1. Please clarify, or add screen captures of your settings, or post a configuration report for the job (Right-click the job, choose "Configuration Report...", click the Save button in the top left of the window, save it as an HTM or MHT file, and upload it. The file won't be publicly visible in the forum).

I'm not sure I understand question #2 either. If you have a step that runs a program and the program returns an exit code of 255, then by default adTempus will treat that as a failure. You can send notification with a Response using the "Task Failed" event. You can also configure different Responses based on specific exit codes using the "Task completed with the specified result" event.

TJ (32 posts)
January 31, 2020 01:12 PM
Accepted Answer

what is the differences between "step failed" and "task failed". I used step failed and that does work for me. and I use VB script to determine the result.

My VB script is: 

 Select Case CInt (adTempus.JobVariables("ProcessExitCode"))

 Case 0

  return True

Case Else

 return False

 End Select 

    

Bill Staff (599 posts)
January 31, 2020 01:56 PM
Accepted Answer

Where are you running this script? Is it a separate step in the job, or are you running it for the "Success Criteria" of the step that runs the program? Or something else?

It doesn't look like you need a script at all--the default behavior of adTempus is already to do what you're doing with the script: Just change the "Success Criteria" to "Decide based on the program's exit code" and set the criteria to "=0". If the exit code is anything other than 0, the step will be treated as a failure.

"Step Failed" and "Task Failed" are almost the same, and in your situation, as far as I can tell, they should behave the same. Task Failed happens when the task being run by the step reports a failure (based on exit code, etc.). Step Failed can happen if something fails within the step other than the task itself--such as a condition failure, etc. Generally you would want to use Step Failed to cover the most situations.

TJ (32 posts)
February 5, 2020 11:11 AM
Accepted Answer

It does not work for me when I use "step fails" while "task fails" works.

 

I also run into another issue, I am creating a step to execute a *.cmd program which kicks off sql script. I created a response that if the script execution time reached a threshold (5mins), it will be terminated and send out notification. However, it does not seem the case, it keeps as running status.

 

Bill Staff (599 posts)
February 5, 2020 12:03 PM
Accepted Answer

You'll need to upload your job configuration or open a support case if you want more help on the Step Fails/Task Fails response.

Same with the response to terminate the task. This worked correctly when I did a quick test, so we need more details if it's not working for you, including what version of adTempus you are using.

 

Replies are disabled for this topic.