« CIAO make version not working? | Main| Teamstudio Tool Time »

Running agents in Build Manger; Advanced Features


Bookmark : del.icio.us  Technorati  Digg This  Add To Furl  Add To YahooMyWeb  Add To Reddit  Add To NewsVine 


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:
A picture named M2

Check that the TSAgentParameter object was created. Build Manager always passes
NoteID. If you call the agent without this parameter, no object is created:
A picture named M3

Check if it registered error, for example, if it couldn’t find the document or the parameter db:
A picture named M4

Get a single parameter by name

A picture named M5

Get all parameter names as an array

A picture named M6

Log a message to the parameter db:

A picture named M7

Mark status complete. This is what lets Build Manager know if the agent completed successfully:
 A picture named M8

Copying the underlying parameter item to a new document

A picture named M9

A complete example:

A picture named M10

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)