Search code examples
javalotus-noteslotus-domino

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!


Solution

  • 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.