Question
· Dec 21, 2023

Is it possible Triggering services/processes to run without a separate task?

Hi everyone.

I have a few processes where I rely on them being triggered by a schedule to run, and in the past I have relied on the following setup:

The Scheduled Task is a custom class that runs a minimal amount of code to simply create and send the specified service an Ens.Request, and equally the Service is also a custom class that simply passes the Ens.Request to the Process for it to kick the process off.

As scheduled tasks need to be configured on a per-mirror basis, I'd like to do away with it completely and simply have a service that just sends the Ens.Request to the Process based on a poll interval. This seems simple enough for tasks set to run every x minutes, but this doesn't seem to be suitable for instances where it needs to run once at a specific time.

Is there a better way for this to be set up, or is the task scheduling for this the best option?

Discussion (8)4
Log in or sign up to continue

"Unfortunately  the Schedule Option isn't suitable where we need the job to run only once at a set time per day"

Why not? It is definitely possible to schedule to start every day at 8:00 for example using this schedule string:

START:*-*-*T08:00:00,STOP:*-*-*T08:10:00

You start a Business Service at 8:00 and stop it at 8:10 (for example).
All you need to take care is that the BS only make one call when started.

Enrico

Well, I did something similar to create a Firebase connector, I created my own inbound adapter and define a business services to use it, after that I configured the interval in the business service and that's all!

You can review the article that I wrote about it:

https://community.intersystems.com/post/connecting-intersystems-iris-and...

For your case the interval would be 86400 seconds to execute the inbound adapter task once each day.

If you have any doubt don't hesitate to ask me.

Thanks Luis.

The issue I'd have is that the clock starts on the poll interval at the point the service is started, so a restart of the server/production would then shift the time of day it tries to run, which would not be ideal if I needed a single run at a specific time of day. I might try a combination of the large poll interval and defining a schedule (based on the other responses) and see if that has the desired effect, but I may need to just concede and continue using the task manager. 🙂