Examples: IsActivatable property

This agent enables those scheduled agents in the current database that are activatable and disables those that are not.

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) 
      Database db = agentContext.getCurrentDatabase();
      Vector agents = db.getAgents();
      for (int i = 0; i < agents.size(); i++) {
        Agent agent = (Agent)agents.elementAt(i);
        if (agent.getTrigger() == Agent.TRIGGER_SCHEDULED) {
          if (agent.isActivatable())
            agent.setEnabled(true);
          else
            agent.setEnabled(false);
          agent.save();
        }
      }

    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}