There is a Job Variable names ADTJobRestartCount that gets increment for each restart (will be 0 on the first run).
So you can add a second Response to the job with event "Job Succeeded," then use a script so that the Response only runs when the restart count is > 0. In the event properties, check the option to "Use a script to determine whether the Response will be activated." Create a new script using VB.NET with the following code:
Imports System
Imports System.Collections.Generic
Imports ArcanaDevelopment.adTempus.Shared
Imports ArcanaDevelopment.adTempus.ApplicationIntegration
Public Class UserScript
Inherits ArcanaDevelopment.adTempus.ApplicationIntegration.ResponseEventScriptBase
Public Overrides Function Run() As Object
Dim restartCount=CInt(adTempus.JobVariables("ADTJobRestartCount"))
Return restartCount > 0
End Function
End Class
If the restart count is 0 (initial run), this will return False so the response does not run. For restarts it returns True so the response runs.
Hi, Bill thanks a lot for your attention.
In the scenario below:
Is there a way to verify if the previous status was Failed?
If instance 5 was run by a Response doing a job restart, then it knows that the previous status was Failed, because it's being run by a Response that only runs on failure. (It knows it's being run by a restart because the ADTJobRestartCount is > 0.)
If instance 5 is run manually or by a trigger (i.e., not by the failure response) then it has no knowledge of the previous instance. It's possible to get that by querying adTempus using the API, but it's more complicated. Is this what you're looking for--a way for it to also work if it's not run by a Response?
Replies are disabled for this topic.