This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal


Jun 10, 2016, 9:16 AM
6 Posts
topic has been resolvedResolved

How to call another agent from "before new mail arrives" agent?

  • Category: Application Development
  • Platform: All Platforms
  • Release: 9.0.1
  • Role: Developer
  • Tags: agents
  • Replies: 7

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?

Jun 10, 2016, 6:04 PM
100 Posts
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?

Jun 10, 2016, 6:04 PM
100 Posts
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?

Jun 10, 2016, 9:27 PM
40 Posts
Before New Mail agents are restricted
Because they are run by the router, and to not impede mail delivery of other mails, have strict rules they adhere to.

If you need the documents to only become available after the modifications have been done, I suggest you deliver them to an intermediate destination, where they can be then acted upon.

If you really need them to be processed as soon as possible, you could look at XOTS technology.  I refer you to Paul Withers blog
http://www.intec.co.uk/xots-background-and-multithreaded-tasks-the-openntf-domino-api-way-part-one/
http://www.intec.co.uk/xots-background-and-multithreaded-tasks-the-openntf-domino-api-way-part-two/
http://www.intec.co.uk/xots-background-and-multithreaded-tasks-the-openntf-domino-api-way-part-three/
http://www.intec.co.uk/xots-background-and-multithreaded-tasks-the-openntf-domino-api-way-part-four/

Jun 13, 2016, 9:34 AM
6 Posts
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.

Jun 13, 2016, 9:44 AM
6 Posts
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.

Jun 13, 2016, 9:44 AM
6 Posts
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.

Jun 21, 2016, 7:20 AM
6 Posts
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:

- Called agents must be modified to accept session.DocumentContext besides agent.ParameterDocID

- I have not found equivalent for agent.RunOnServer


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal