Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Agent to read new mail

Status
Not open for further replies.

evsrcs

IS-IT--Management
Apr 13, 2003
15
US
This is my first attempt at writing an agent. I wrote a simple agent that looks at a "news" database and would like to send a message to everyone with a link in it to read the new news item. It is shared - on event - action menu selection - all new and modified documents.
Actions are to send message and mark document read. It will work fine until I modify the agent and then when it runs it will send a message for every document in the database including the ones that have already been read. Also after making changes to agent any number of times the enable/disable field is grayed out. - HELP
 
Your problem is not a bug. An agent that has been modified automatically nullifies the modified doc flag, and thus runs again on all docs.

If you wish to avoid this issue you can either (ahem) stop modifying the agent code, or set the agent to write a flag into each document it works on. That way, when you re-execute the agent, it can check if the flag is set, and if so, skip the document.

The first solution requires that you analyze the agent activity and transform all modifiable points into parameters, such as in a profile document.

The second solution is simpler to input, but it requires a longer run time since it will initiate a read/write operation on all the documents it works on.

Pascal.
 
There is a third option too:
To write a main agent calling another agent - or - alternatively calling modifiable code in a script library

This way the main agent is left unchanged (basically just a simple action calling another agent, with a script library you will need to use either LotusScript or Java)

As long as the main agent is unchanged, the flag will stay in the threated documents...

Brgds,

TrooDOS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top