Automator Timer Retry

Altair Forum User
Altair Forum User
Altair Employee
edited June 2017 in Community Q&A

Hi,

 

I am using v14.0 of Automator and when I try to run the process below it should be running with all 3 input files but for some reason only runs the top one. When I remove the timers it runs properly but I need the timer as the reports may not be saved to the server yet. I'm still new to the Timer tool, did I set this up correctly? The Timer is set to retry every hour for at most 8 times.

Thanks,

image

Tagged:

Answers

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited June 2017

    The timer is used to allow a process workflow to be retried if it fails.  It takes either a Check File, Check Cmd, or Check Input as its input, and it's output should point to a Report Export, Table Export, or Summary Export or Hub.  Have you tried pointing it back to the hub instead of the check input node?  Is there anything in the log file that is generated that might shed some more light on where it is failing?

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited June 2017

    The timer is used to allow a process workflow to be retried if it fails.  It takes either a Check File, Check Cmd, or Check Input as its input, and it's output should point to a Report Export, Table Export, or Summary Export or Hub.  Have you tried pointing it back to the hub instead of the check input node?  Is there anything in the log file that is generated that might shed some more light on where it is failing?

    Putting it to the hub worked. Thanks Chris

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited August 2017

    Hello, I am also new to Automator and found your post very helpful.

    I have been trying to create a process where I only get alerted a single time after a retry timer fails.  It will be normal for the retry to occur a few times but I want to be notified if it finally doesn't work. 

    I have gotten this to work with the process flow below and thought it might be helpful to others trying to figure out how to do this.

    Overview.png

    Cause Error.png

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited August 2017

    Hello, I am also new to Automator and found your post very helpful.

    I have been trying to create a process where I only get alerted a single time after a retry timer fails.  It will be normal for the retry to occur a few times but I want to be notified if it finally doesn't work. 

    I have gotten this to work with the process flow below and thought it might be helpful to others trying to figure out how to do this.

    Overview.png

    Cause Error.png

    Timer.pngHub.pngcheck timer.pngDistribution On Failure.pngDistribution On Success.png

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited August 2017

    Timer.pngHub.pngcheck timer.pngDistribution On Failure.pngDistribution On Success.png

    Also, this might be helpful to those trying to figure out how to use API.GetEvents()

     

    I am reposting the vb code in the sample process above here as text for easier reading

     

    'Cause Error - this script serves to simulate a failure in your process

    'Pause for a second to make log timing easier to determine

    System.Threading.Thread.CurrentThread.Sleep(1000)

     

     

    'leave all code below commented to simulate a success on first run

     

     

    '------------------------------------------------------------

    'uncomment just this line of code to force a complete fail simulating retry limit reached failure

    'Throw New Exception("intentional error")

     

     

    '----------------------------------------------------------

    'uncomment this code to simulate a retry success after initial failure

    'If Not API.HasRuntimeFieldValue("HasRun") Then

    'API.AddRuntimeFieldValue("HasRun", "True")

    'Throw New Exception ("First Time through script - intentional error")

    'End If

     

    '************************************************************

    'check timer - this code reads the events from a timer named "Timer" in your process

    'When the timer has reached it's last retry it will throw an error so that you can control flow from this script

    'to execute just once after the timer has failed

     

    'Reads Events from Timer

    Dim listOfEvents As List (Of Datawatch.Services.DataPump.Common.Scripting.ProcessLogItemApiEvent) = API.GetEvents("Timer")

    API.AddEvent("FirstScript Has " & listOfEvents.Count & " Events")

    For i as Integer = 0 to listOfEvents.Count-1

    If listOfEvents(i).Message.Contains("Retry will occur at most 0 times") Then

    Throw New Exception("Retry Failure")

    End If

    Next i

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited August 2017

    Also, this might be helpful to those trying to figure out how to use API.GetEvents()

     

    I am reposting the vb code in the sample process above here as text for easier reading

     

    'Cause Error - this script serves to simulate a failure in your process

    'Pause for a second to make log timing easier to determine

    System.Threading.Thread.CurrentThread.Sleep(1000)

     

     

    'leave all code below commented to simulate a success on first run

     

     

    '------------------------------------------------------------

    'uncomment just this line of code to force a complete fail simulating retry limit reached failure

    'Throw New Exception("intentional error")

     

     

    '----------------------------------------------------------

    'uncomment this code to simulate a retry success after initial failure

    'If Not API.HasRuntimeFieldValue("HasRun") Then

    'API.AddRuntimeFieldValue("HasRun", "True")

    'Throw New Exception ("First Time through script - intentional error")

    'End If

     

    '************************************************************

    'check timer - this code reads the events from a timer named "Timer" in your process

    'When the timer has reached it's last retry it will throw an error so that you can control flow from this script

    'to execute just once after the timer has failed

     

    'Reads Events from Timer

    Dim listOfEvents As List (Of Datawatch.Services.DataPump.Common.Scripting.ProcessLogItemApiEvent) = API.GetEvents("Timer")

    API.AddEvent("FirstScript Has " & listOfEvents.Count & " Events")

    For i as Integer = 0 to listOfEvents.Count-1

    If listOfEvents(i).Message.Contains("Retry will occur at most 0 times") Then

    Throw New Exception("Retry Failure")

    End If

    Next i

    Sorry, this line should be corrected to make it a little more clear.

     

    API.AddEvent("FirstScript Has " & listOfEvents.Count & " Events")

    ->

    API.AddEvent("Timer Has " & listOfEvents.Count & " Events")