If a ‘user’ saves a document with the correct combination of values I need AgentA to run 90 minutes later and then 180 minutes later.
Options I have come up with:
- The document save could launch AgentA and SLEEP would delay the agent 90 minutes, run the code and then delay another 90 minutes before running again.
Downside - Server doc probably will not allow an agent to run for 3 hours.
- The document SAVE launches an AgentZ which enables AgentA. AgentA is set to run more than once a day (every 10 minutes maybe) and each time it loads, it checks to see if 90 minutes has elapsed from the document MODIFIED date/time, if not, it exits. If 90 minutes HAS elapsed, enable AgentB and disable self. AgentB does the same thing but is looking for 180 minutes to have elapsed from the document MODIFIED date/time.
Which sounds more likely to work?
Other ideas?
Thanks in advance,
Marc Robson
Subject: Agent schedule options
I would use one agent, enabled all the time and running every 10 minutes. The agent looks for documents that need to be processed, checks the modification time, and either leaves them for later or processes them and marks them processed.
Subject: Agent schedule options
-
sleepVery very very bad idea. No other agents would run, you will be blocking everyone else. And you administrator is likely to have set up a time out way before that (at least I hope so to prevent people from doing exactly this or writing infinite loops)
-
Better. I would make it run every 30 or 45 mins. Why do you want it to run so frequently? The more often you run for no good reason, the more likely is that all agents will fall behind the schedule. What if there is another guy in your organization that will think of a sleeping agent? Having one agent enable another requires both agents to be signed the same (or the signer would need to have very high priviledges).
-
Does it have to be exactly 90 minutes? I would try to simply and just have a plain scheduled agent run once an hour and check some document which tells it what it needs to do.
Did you read Agent FAQ articles? “Minimizing delays in the Agent Manager” might be helpful, and the one that discusses Release 6.0 features has a section of agents saving other agents.