Schedule Timer to wake up at specific date

Schedule Timer to wake up at specific date

  

hi all,

im looking for a solution to wake a timer for a specific day and time.

For example after i click in save button it will save in the database the given date and create timer to wake up event at that date.

I can use schedule to check database in every 5 min, but that would waste to many resources.


regards,

Ricardo Portela

Hi Ricardo,

That is described here in the documentation. It's covered by "Implement logic that changes the Timer schedule at runtime".

HI Killian,

in that doc i can schedule timer to cycle times or wake at the moment.

what i need is to schedule timer to specific date after click on button.  

Hi Ricardo,

Unfortunately, you cannot schedule Timers for any random date, and you cannot schedule them to execute only once (with the exception of "When Published"). There's various workarounds depending on what you want to do exactly (and the limits thereof), but there's no single solution.

no matter what you do, you always need some kind of watchdog to check the datetime...



Ricardo Portela wrote:

hi all,

im looking for a solution to wake a timer for a specific day and time.

For example after i click in save button it will save in the database the given date and create timer to wake up event at that date.

I can use schedule to check database in every 5 min, but that would waste to many resources.


regards,

Ricardo Portela

Hello Ricardo,

I think you can do this using these system tables. As a suggestion I think you should create a separate eSpace to try and explore a bit but I think it might be a solution to your problem.


I hope it helps :)

Regards,

João Cabaço

Hi João,

I don't think manipulating System Entities will improve much over setting the Timer's Schedule Parameter (which I linked to). The Entities you showed all have a "Schedule" Attribute that is the same as the Schedule Parameter, and still don't allow running a timer once, at a specific date/time.

Kilian Hekhuis wrote:

Hi João,

I don't think manipulating System Entities will improve much over setting the Timer's Schedule Parameter (which I linked to). The Entities you showed all have a "Schedule" Attribute that is the same as the Schedule Parameter, and still don't allow running a timer once, at a specific date/time.

This is true, but if the entities are editable (and they are), in the action started by the timer, you can disable it... This would have the same effect as schedule to run a single time...

EDIT:

While I'm also not fond of messing with the system entities, it's a known practice to set the Next Run through logic, from inside the action executed by the timer, for example, when you need more control over when the timer will run. 


But I would say that the problem is more complex than it appears at first.

The OP (Ricardo Portela) is talking about creating timers "on the fly".
I don't think this is possible. Is it?

Because besides being able to add entries to the System entities, you would need to know to which action you will bound the timer, what I think it is not possible.

So, I would say that doing what the OP wants is not possible at all.

What can be done, I think, and probably is the better way to go, is to run a timer (a fixed) one, that look for the data in the entity and find the records that must do something, like, every half an hour. 

For most of situations this would be sufficient. You limit the times the user can set the operation to happen, but well, it's a trade off...

But...

If the you have A SINGLE timer that must be set to specific hours, you can leave the default schedule empty, and I think, probably the SCHEDULE also, and set only the NEXT RUN. So, on saving, you set the NEXT RUN and it will run only that time. 

Cheers.

Why do you think it costs too many resources?


Thx all for quick answer. João our solution i think would work but i dont want mess around system entities (still new at outsystems).

 i will stay with 5 min timer. i still think is waste of resources because most of times will run for nothing. But so far best solution i found.

Hi Ricardo,

Do you allow the users to schedule at 5 minute intervals? If not, e.g. when they can only schedule at whole hours, you can set the "5 min timer" to a lower frequency.

hi Kilian the main idea is to send notification to user about event and it need to be at specific  time.

i wanted to make timer to wakeup at that specific time to send notification.

it also work with 5 min cycle timer ( not not so efficient and precise)

Well, you could use BPT to do it, and specifically with a "wait", which has a timeout.

When the wait is finished, put an automatic activity that wakes the timer. Then again, you could probably just send the notification from within the automatic activity and then you don't need a timer.

BPT master class

errr. a 5min timer

 checks with an aggregate "do i need to do something"..

no. ok stop

yes. do it and stop.

in my book that is not that many resources...