Objective
The objective of this sample is to demonstrate how to use the AgentRunner.
Time Required
You should allow 20 minutes to build and run this sample.
Before You Begin
To build and run this sample you need to have Notes 4.6 or higher installed.
Set up your Workbench for using the samples by following the steps in the Domino Samples Overview.
Set up your Lotus Notes and VisualAge for Java environments to support the Domino AgentRunner by following the steps in the task file Setting up for the AgentRunner and return to this sample.
Description
This sample is a simple agent that will tell you the title of the database on
which the agent is running.
Running the Sample
Once you have set up your Lotus Notes and VisualAge for Java environments you have to:
1. Export the .class File
To export the .class file from the com.ibm.ivj.examples.intro package in
VisualAge for Java to the file system so it can be read by Notes:
When you export files to the file system, the directory path of the file is maintained.
For example, if you entered X:\VAJexport
as your export destination,
the Intro.class file will be in X:\VAJexport\com\ibm\ivj\examples\domino\intro.
2. Create the Agent in Notes
For the AgentRunner to work in the IDE you have to provide it with a context for running
your agent. To create an AgentContext document:
Running the Agent in Notes
From the Actions menu of the Domino database, select MyIntro.
The agent will run but the session will return Null. An AgentContext document will be
created in the AgentRunner.nsf
3. Using the AgentRunner
Now you are ready to run the agent in the AgentRunner.
To run your agent from the Workbench:
The Domino AgentRunner will run your agent using the AgentContext document that you created in Notes. The Console will give you a message that the Intro Agent is running. When it has run against your Notes database, it will return the title of the database in which you created the agent in Notes.