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