Running agents in Build Manger; Advanced Features
Bookmark :
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.
( read more...)
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
Part One: set up database and signers on the target server.
1. Make sure AgentParameters.nsf is saved in the Teamstudio directory of the target
server (the server where the database containing the agent is located).
2. Make sure the ID promoting the database in Build Manager has Editors rights for
AgentParameters.nsf.
3. Make sure the signer of the targ et agent has Editor rights for AgentParameters.nsf.
Part Two: include the TSAgentParameters library and code to call it.
1. Copy the TSAgentParameters script library from AgentParameters.nsf.
2. Use your custom code to call the methods exposed by the global object
TSAgentParameters. For more detailed documentation of these method s, view the
script libraries source code, especially the “TSAgentParameterMgr” class.
The following code fragments illustrate common operations:
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:
Copying the underlying parameter item to a new document
A complete example: