Use Teamstudio Build Manager to run agents automatically.
To run agents:
- Select the database document, for which you want to automatically refresh the design.
Note: You must have already created a promotion path document.
- Click the Create action button and select Run Agent. The Run Agent document appears:
- The Run Agent document is active by default. Leave this setting.
- Enter a descriptive name in the Description field (for example, Run Agent).
- Click Browse to select the database where the agent lives that you want to run.
- Click Get Agents to populate the Agent Name dropdown.
- Select an agent.
- If you want to fail the promotion if the selected agent fails to run, check the Promotion Fails if agent cannot be initialized checkbox.
Note: The following steps require you to perform additional setup detailed in a separate procedure and require the inclusion of additional LotusScript libraries and code modifications. See “Using the Advanced Features of Run Agent,” below.
- If you want to pass parameters to an agent or check its status after it runs, check the Enable additional options using agent parameter database checkbox in the Advanced Options section.
- The following advanced options appear:
- Get agent status from parameter database after agent runs
- Include messages from agent in the promotion log
- Pass parameters to agent
- If you want, check the Get agent status from parameter database after agent runs.
- The Fail promotion if agent does not confirm success—check if you want the database promotion to fail if the agent does not run to completion.
- If you want, check the Include messages from agent in the promotion log checkbox
- If you have parameters you want to pass to an agent, check the Pass parameters to agent checkbox.
Save and close the document.
The new Run Agent entry appears in the right pane, under the database to which it applies. Note: Build Manager calls the agent you specify with Run Agent using the NotesAgent.RunOnServer() method in LotusScript. Security and context for the agent
Using the Advanced Features of Run Agent
Use the following two-part procedure to set up Build Manager to use the advanced features of Run Agent, including passing parameters to the agent, logging messages from agent, and confirming successful completion of an agent.
Part One: set up database and signers on the target server.
Make sure AgentParameters.nsf is saved in the Teamstudio directory of the target server (the server where the database containing the agent is located).
Make sure the ID promoting the database in Build Manager has Editors rights for AgentParameters.nsf.
Make sure the signer of the target agent has Editor rights for AgentParameters.nsf.
Include the TSAgentParameters library and code to call it.
Copy the TSAgentParameters script library from AgentParameters.nsf.
Use your custom code to call the methods exposed by the global object
Include the library, in the options section:
Check that the TSAgentParameter object was created. Build Manager always passes NoteID. If you call the agent without this parameter, no object is created:
Check if it registered error, for example, if it couldn’t find the document or the parameter db:
Get a single parameter by name:
Get all parameter names as an array:
Log a message to the parameter db:
Mark status complete. This is what lets Build Manager know if the agent completed successfully:
Get all parameters in a LotusScript list variable:
A complete example: