|
|
|
|
|
|
|
|
|
|
|
|
|
|
Control your application's agents with this Agent Launchers tool (continued)
Creating self-launching agents
Using a single scheduled agent to periodically check schedules and launch agents is very flexible and can work well in most applications, with one significant exception. You might have several slow agents that execute to completion by themselves, but when run on one schedule cause the launcher agent to exceed the time limit specified in the server document.
To work around this kind of situation, you can create a self-launch schedule document and set each slow agent to launch itself. The agent should use slAGTLauncher and call fnCanLaunch before allowing itself to do anything. After executing successfully, it should then call subSuccess to update the Last Launched Date in its schedule document. The following Sample Agent is an example of a self-launching agent:
Sub Initialize 'agtSample3b
'Designed to self-launch
Dim s As New NotesSession, db As NotesDatabase
Set db = s.CurrentDatabase
Dim logThisDB As New NotesLog ("agtSample3b: Delete Draft Orders")
Call logThisDB.OpenNotesLog( db.server, db.filepath )
If fnCanLaunch ("agtSample3b", "selflaunch", True) Then
Call logThisDB.LogAction ( "Started. (UI or self-sched)" )
Call logThisDB.LogAction ( " Pretending to delete all unsubmitted draft orders." )
Call logThisDB.LogAction ( "Done." )
Call subSuccess
End If
End Sub 'agtSample3b
|
Testing
To quickly put the auto- and self- launchers through their paces, the sample database includes a "Create Sample Schedules" agent. This agent creates a set of sample schedules based on the current system time. After creating these sample schedules, you can run the launchers against them and verify that each agent's schedule was applied correctly.
The sample agents named in the sample schedules don't actually do anything, but they're named after tasks that agents commonly perform. For example, the "Sample Agent: Register" agent can be run by any user, but only from the user interface. The "Sample Agent 5: Archive Old Orders" agent can be run by an administrator at any time, and it's scheduled to auto-launch monthly.
To make it easy to see which agents were launched and when, the sample database contains the design elements of a standard Notes Log (from the StdR4AgentLog template). Each agent prints to this log as it executes:
Sub Initialize 'agtSample1
Dim s As New NotesSession, db As NotesDatabase
Set db = s.CurrentDatabase
Dim logThisDB As New NotesLog ("agtSample1: Register")
Call logThisDB.OpenNotesLog( db.server, db.filepath )
Call logThisDB.LogAction ( "Started. (UI)" )
Call logThisDB.LogAction ( " Pretending to register the current user." )
Call logThisDB.LogAction ( "Done." )
End Sub 'agtSample1
|
The Agent Log is pictured in Figure E.
FIGURE E
 
Here is the Agent Log. Roll over picture for a larger image.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Sophisticated Meets Simple For Document Management
Share. Control. Manage.
Documents, emails, and content in the context of how work is done.
Native to Lotus Domino. The User Experience unseen for Lotus Domino.
Do more with less. Really.
See the possibilities Docova unleashes for Lotus Domino. |
-- Advertisement --
Integrate your Notes Applications with Microsoft Office and Symphony
Integra for Notes Integrates Microsoft Office and/or IBM Lotus Symphony
Requires NO change to the design of the appliation or Installations of DLL's and EXE's
- Integra is a ready to use solution, enhance static reports with Excel data analysis, pivot tables, macros
- User friendly aproach, using a point and click access to features
- Reports from any Lotus Notes databases
- Runs reports through a Notes client, web browser and scheduled basis
- Allows use of LotusScript for advanced data manipulation
- Enables self service reporting capabilities to end-users
Learn more at www.integra4notes.com. |
|
|
|
|
|
|
|
|
|
|