Examples: NumActions property (Log - Java)

This agent prints the number of each action in the action message.

import lotus.domino.*;
import java.util.Vector;
public class JavaAgent extends AgentBase {
  public void NotesMain() {
    try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();
      // (Your code goes here) 
      Log log = session.createLog("Counting actions");
      Vector v = new Vector();
      v.addElement(session.getUserName());
      log.openMailLog(v, "Here's your log");
      log.logAction("Action number " +
      log.getNumActions());
      log.logAction("Action number " +
      log.getNumActions());
      log.logAction("Action number " +
      log.getNumActions());
      log.close();
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}