Hello, I'm studying how timers work better and I have some questions.As far as I have investigated, we have 3 entities related to the execution of these cycles.
My first question is about deactivating timers after time out. Is the default behavior to deactivate the timer after 3 attempts with time out?My second question is related to manual deactivation, through the Service Center. Is it normal to deactivate the timer through the Service Center and for it to still have the is_active = true attribute in the Meta_Cyclic_Job entity?
My third question is related to reactivation (internal actions). Is it possible to activate a Timer that was deactivated by time out attempts or manually deactivated in the Service Center, through Internal System Actions?
Hello Emerson,
Hope you're doing well.
Replying to your question:
1. No, timers won't be deactivated after 3 attempts with timeout. When a timer fails, that timer will be executed a certain number of retries (this number is configurable in Service Center), and by default it is set to 3 retries. If these retries timeout, the timer will stop that execution, but it will eventually be executed again in the next scheduled date (set in Next Run).
2. If you're working with a single-tenant module, the information of the timers is present in Cyclic_Job_Shared entity. When you deactivate a timer, the Next_Run attribute is set to 3000-01-01. This entity doesn't have an Is_Active attribute, the activation / deactivation is fully controlled by the value present in Next_Run attribute.
3. It is not possible to deactivate a timer programatically by default, the platform only gives you the possibility to wake timers.
For extra information about timers, consider to take a look at this article by Kilian Hekhuis. It should have everything you need to know in here :)
Kind regards,
Rui Barradas
Thank you very much for the quick response!
Regarding point 1, even if the timer is scheduled when publish, will the behavior always be to calculate the new execution?I ask because I have the following scenario below.3 executions with timeout and then automatic deactivation of the timer.Regarding point 2, in this same scenario above, let's suppose that it has been automatically disabled and the Next_Run attribute has the value 3000-01-01. Can I then programmatically update the record of this timer in the Cyclic_Job_Shared entity so that it reactivates the execution, right?
Regarding point 1, that's probably because you don't have a schedule defined for that timer. Like I said before, everything is controlled by the Next_Run attribute. Does the timer have the next run calculated?
Regarding point 2, yes, you should be able to programmatically update this record, however I'd suggest for you to be extremely careful when doing this, since you're working with system tables.
Thank you very much!
The next execution is not calculated, it has that attribute 3000-01-01.
I will be careful and do some more tests to be sure.