# Agent Choice

**URL:** <https://www.finalbuilder.com/forums/t/agent-choice/4921>\
**Category:** Discussion\
**Created:** [March 14, 2013, 8:55am UTC](https://www.finalbuilder.com/forums/t/agent-choice/4921 "2013-03-14T08:55:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jenasys](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/jenasys/32/888_2.png) [@Jenasys](https://www.finalbuilder.com/forums/u/Jenasys)\
**Post date:** [March 14, 2013, 8:55am UTC](https://www.finalbuilder.com/forums/t/agent-choice/4921/1 "2013-03-14T08:55:30Z")

</div>

Is it possible to have a build Trigger on an agent with a specific set of software loaded?

E.g. Office 2003, 2007, 2010, 2012 might be installed in various combinations on a range of "VM agents".

- I'll give you a scenario. 
- When you work with data files&nbsp;you can use a range of methods to read that data. 
- There are some very specific requirements to use Excel Automation rather than .net OLE drivers.
- One of my core data API allows a developer to "choose" to use Excel automation.
- I have unit tests that run those tests.
- I want to be able to use Continua to see if unit tests are different with different editions of that software.

&nbsp;

Is it possible to have a Configuration for which gets run in different environments but controlled by the software on an agent?

&nbsp;

---

<div class="post-metadata">

**Author:** ![Jenasys](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/jenasys/32/888_2.png) [@Jenasys](https://www.finalbuilder.com/forums/u/Jenasys)\
**Post date:** [March 14, 2013, 9:03am UTC](https://www.finalbuilder.com/forums/t/agent-choice/4921/2 "2013-03-14T09:03:11Z")

</div>

AKA Can I have logic in the Configuration like ExecuteOn = $Agent.Name$.

---

<div class="post-metadata">

**Author:** ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)\
**Post date:** [March 14, 2013, 9:50am UTC](https://www.finalbuilder.com/forums/t/agent-choice/4921/3 "2013-03-14T09:50:14Z")

</div>

Triggers do not get to decide which agent the build runs on. You can however set an Agent Requirement on the stage, e.g :   
  
 $Agent.Hostname$ Equals mymachine   
  
 Agents are selected based on the requirements of the stage, and the capabilities of the agent. The requirements are collected from the Stage Agent Requrements and the Actions on the stage. Agent capabilities are reported by the Agent Properties. Agent Properties are defined by Property Collectors, or you can manually define them. You can also add your own Property Collectors and this would be the recommended way of doing this. So while you can hard code a stage to a specific agent, it would be better to define property collectors that will the have the agents report the capability/property, and set the requirement on the property. That way if you add other agents later that are able to run the stage they will get used as well.   
  
 So the idea is that Continua should never assign a Stage to an Agent not capable of running it.

---

<div class="post-metadata">

**Author:** ![Jenasys](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/jenasys/32/888_2.png) [@Jenasys](https://www.finalbuilder.com/forums/u/Jenasys)\
**Post date:** [March 15, 2013, 4:28am UTC](https://www.finalbuilder.com/forums/t/agent-choice/4921/4 "2013-03-15T04:28:00Z")

</div>

I totally agree with your approach. I’ve added my own property collector for Excel 2010. Now where in the Continua UI do I use it? Having a “blond” moment.

---

<div class="post-metadata">

**Author:** ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)\
**Post date:** [March 15, 2013, 5:06am UTC](https://www.finalbuilder.com/forums/t/agent-choice/4921/5 "2013-03-15T05:06:19Z")

</div>

In the workflow editor, double click on the Stage or click on the Edit Stage Options button, switch to the Agent Requirements tab. Add a an expression , eg :   
  
 $Agent.Office.2010.Excel.Path$ Exists   
  
 BTW, note how I namespaced the property that was created by my property collector, so as I type $Agent.O I get completion for the properties.

---

<div class="post-metadata">

**Author:** ![Jenasys](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/jenasys/32/888_2.png) [@Jenasys](https://www.finalbuilder.com/forums/u/Jenasys)\
**Post date:** [March 15, 2013, 6:14am UTC](https://www.finalbuilder.com/forums/t/agent-choice/4921/6 "2013-03-15T06:14:58Z")

</div>

Oh guys your implementation on this is fantastic!

I can see the agents for each project -\> configuration that are compatible.

Attachment unavailable

---

<div class="post-metadata">

**Author:** ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)\
**Post date:** [March 15, 2013, 7:44am UTC](https://www.finalbuilder.com/forums/t/agent-choice/4921/7 "2013-03-15T07:44:25Z")

</div>

Thanks Jamie. Result of many hours at the whiteboard
