We have an application that delivers sets of Notes documents to other servers via Notes mail. Documents are sent to a dedicated database. The agent triggered in this database at the event “before new mail arrives” checks whether are already delivered all the documents from the set. If so (i.e. a last document), the agent copies the documents into the target databases. It works perfectly, the documents find themselves in target databases at one time.
We have added the ability to call on delivered documents in target databases agent who makes minor modifications according to local configurations that are not available on the sender side.
We encountered restriction “before new mail arrives” agent: “The agents are not allowed to call other agents.”
In this case, we are completing the action in the ordinary scheduled agent, unfortunately, that is, 5-minute delay. Equally as using an agent. “after new mail has arrived.”
Is there any workaround for restriction “before new mail arrives” agents and call / activate agent in another database on specified document?
Or at least run synchronously another agent (the scheduled) in the same database?
Subject: It works when calling agent via Notes C-API
I discovered that works call agent via Notes C-API. Restriction “before new mail arrives” agents are not effective.
Just the basic sequence from the C API Notes / Domino Reference function AgentRun complemented with AgentSetDocumentContext, namely:
AgentOpen
AgentCreateRunContext
AgentSetDocumentContext
AgentRun
AgentDestroyRunContext
AgentClose
When calling from LotusScript on a 64-bit platforms is insidious, that although DHANDLE is still needed to declare as Long, HAGENT and HAGENTCTX is necessary to declare as Double.
Advantages:
-
Works even from the “before new mail arrives” agents (!)
-
It is possible pass only an unsaved (in-memory) document (!)
-
It is possible redirect and read the output (!)
Disadvantages:
Subject: Intermediate destination
Yes, we have “intermediate destination”. We also move to the the target database upon receipt of the last document to “intermediate destination”. We need then to run agents on them.
Subject: Checking that I understand
So you want the destination db’s ‘before mail arrives’ agent to call another agent?
If that’s true, why not just put the ‘other agent’ code into the ‘before mail arrives’ agent?
If that’s not what you mean, can you re-explain?
Subject: Checking that I understand
So you want the destination db’s ‘before mail arrives’ agent to call another agent?
If that’s true, why not just put the ‘other agent’ code into the ‘before mail arrives’ agent?
If that’s not what you mean, can you re-explain?
Subject: Calls to another database is not possible
Agent moves documents into other databases (which might not be “mail-in”).
The path to the database and agent name are specified in the data.
Subject: Intermediate destination
Yes, we have “intermediate destination”. We also move to the the target database upon receipt of the last document to “intermediate destination”. We need then to run agents on them.