To schedule agent through coding

Hi friendz, Is there any way to schedule a agent through scripts?

I have a scheduled agent that should run according to the time that is specified in the configuration document.That time can be changed.so if that value is changed then the (scheduled) agent should run on the new time .

Note:That agent will run in daily basis.

Thanks in Advance

Thish.

Subject: To schedule agent through coding.

Hi.I"ve been working on this issue too. If you search for my name and “agent” you should find two threads about it. In short:

LotusScript does not have any classes that allow you to change the agent schedule. The “normal” way to work around this is to schedule the agent for example every hour and let your agent code look in the configuration document if it’s time to really do something. Otherwise it just exits (which it’ll do within a second).

As your agent is scheduled daily this method might work for you.

My agent should work once a week which means that the agent runs 176 times a week to once do something. As the agent exits quick if it doesn’t need to run it’s not a huge problem, but I’ve been looking for methods to circumvent it nevertheless and the only way to circumvent it is through API code. On OpenNTF you can find a LotusScript Extension class (chrysalis) which you have to add to your Domino server to have functionality to schedule agents directly. This works great, but is Windows only. In my other thread I’ve given some C API code to put in a LotusScript agent, which does the same. That code is also Windows only but can be rewritten quite easily to work on Linux too.

Subject: To schedule agent through coding.

There maybe a better way, but what I did was setup an agent to run every 15 minutes.

As you suggested, I had a configuration document with a date, time and already run flag.

Then when the agent runs it checks the configuration document’s date and time, if it’s in the past and the already run flag was not set. Then I set the flag and execute the code of the agent. Otherwise don’t do anything.

Subject: To schedule agent through coding.

Hi Stephen and Martijin,Thank u for your suggestions.I will try with those solutions.Thanx again

Regards,

Thish