wenn32
wenn32

Reputation: 1382

Running java agents in lotus notes

Hi I am using lotus notes 8.5 and in view -> Agents i created a new Agent and selected java language and tried to test the basic running of the Agent.

import lotus.domino.*;

public class JavaAgent extends AgentBase {

    public void NotesMain() {

        try {
            Session session = getSession();
            AgentContext agentContext = session.getAgentContext();

            System.out.println("Sample Test of Lotus Notes Agent!");
        } catch(Exception e) {
            e.printStackTrace();
        }
    }
}

so basically the above code must print in the java debugging console as "Sample Test of Lotus Notes Agent!" but it doesn't work.

BTW it is triggered to run at "After new mail has arrived" also i don't have Domino designer client. I must somehow make it work in lotus notes itself(cannot install any other tools like eclipse..)

EDIT: like i have mentioned in the comments i even tried to schedule and also tried event triggers but this doesn't work but i can manually run the agent by selecting "RUN" from the menu.

Thank You!

Upvotes: 0

Views: 2731

Answers (2)

Panu Haaramo
Panu Haaramo

Reputation: 2932

You could add LotusScript code to Queryrecalc event of the Inbox folder. That way the code will run on client when Inbox is refreshed. You can also start a Java agent from this LotusScript code.

Another possibility is to replicate the mail databases to client and run even based or scheduled background agents there.

Upvotes: 0

Per Henrik Lausten
Per Henrik Lausten

Reputation: 21709

An "After new mail has arrived" agent is run by the Agent Manager server task - on the server and not on the client. If you have the required access to run agents on the server, you should see the result of the System.out.println() in the log file on the server (log.nsf).

Upvotes: 3

Related Questions