import lotus.domino.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
// (Your code goes here)
Database db = agentContext.getCurrentDatabase();
Agent agent = db.getAgent("Agent to be run Java");
agent.run();
} catch(Exception e) {
e.printStackTrace();
}
}
}
This is "Agent to be run Java."
import lotus.domino.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
// (Your code goes here)
Database db = agentContext.getCurrentDatabase();
Document memo = db.createDocument();
memo.appendItemValue("Form", "Memo");
memo.appendItemValue("Subject",
"Message from Java agent");
memo.appendItemValue("Body",
"The agent is running as " +
session.getUserName());
memo.send(session.getUserName());
} catch(Exception e) {
e.printStackTrace();
}
}
}