Generate an AgentContext Document

Before you can generate the AgentContext document you have to export your agent's .class file from the IDE to the file system so it can be read by Notes.

Export your class file to the file system

To export your agent's .class file, from the Workbench:

  1. Select your agent with mouse button 2.
  2. Select Export
  3. Select the Directory radio button.  The Export to a directory SmartGuide opens.
  4. Enter the path where you want to export the file in the text field.
  5. Select the .class check box.
  6. Click the Details button beside the .class check box.
  7. Select the .class file that you want to export.
  8. Click OK.
  9. Click Finish.

Your agent's .class file is now in the file system.  Next, you should generate your AgentContext document in a Notes database.

Generating an AgentContext document

To create a Java agent in a Notes database:

  1. Open Lotus Notes 4.6 (or higher).
  2. Create your agent in the appropriate database.
  3. Fill in the particulars for your agent.  Select the Java radio button for What should this agent run
  4. Click Import class Files and select file you exported from VisualAge for Java.
  5. Run the agent.

The AgentContext document is automatically generated in the AgentRunner.nsf when you run your agent in Notes from an agent class that extends DebugAgentBase.  A call to getSession() will, after generating an AgentContext document, return null.  Any use of the returned session will result in a thrown exception, but since the purpose of running the agent is only to generate the context document (and not to run any of the agent code), you can ignore the exception.

When you have generated an AgentContext document, you are ready to run and debug your agent in the VisualAge for Java IDE.

ngrelc.gif (533 bytes)
The Domino AgentRunner

ngrelt.gif (466 bytes)
Exporting Bytecode
Setting up for the AgentRunner
Write or Import an Agent
Running and Debugging your Agent
Creating the Production Agent