Version Differences for Agent Filter

Line 1:
  This page lists agent-filter scripts that are directly defined by the scripting site. These scripts were taken straight from the [https://bugs.urbancode.com/secure/IssueNavigator.jspa?reset=true&&pid=10110&sorter/field=issuekey&sorter/order=ASC public JIRA site]. Please note that some scripts may be ''snippets'' and '''probably WILL need''' modification to work properly for your situation. Treat these as templates that you can modify from.    This page lists agent-filter scripts that are directly defined by the scripting site. These scripts were taken straight from the [https://bugs.urbancode.com/secure/IssueNavigator.jspa?reset=true&&pid=10110&sorter/field=issuekey&sorter/order=ASC public JIRA site]. Please note that some scripts may be ''snippets'' and '''probably WILL need''' modification to work properly for your situation. Treat these as templates that you can modify from. 
       
    + = Agent Filter based on a property that contains the value of an agent property =  
       
    + Script Notes:  
    + * A general case: <pre>String propValue = PropertyLookup.get("property");  
    + return Where.is(Variable.equals("property", propValue)); </pre>  
       
    + ==== AHPSCRIPTS-10 ====  
       
    + <pre>import com.urbancode.anthill3.domain.agent.Agent;  
    + import com.urbancode.anthill3.runtime.scripting.helpers.*;  
       
    + public class PropertyEqualsAgentVar extends VariableEqualsCriteria {  
       
    + String propertyname;  
       
    + public PropertyEqualsAgentVar(String propertyname, String varName) {  
    + super(varName);  
    + this.propertyname = propertyname;  
    + }  
       
    + public Agent[] filter(Agent[] agents){  
    + String platform = PropertyLookup.get(propertyname);  
    + this.setValue(platform);  
    + return super.filter(agents);  
    + }  
    + }  
       
    + // 'my.property.name' is the name of a project or workflow property that contains the value  
    + // of the agent property named 'agent.property.name'  
       
    + return Where.is(new PropertyEqualsAgentVar("my.property.name", "agent.property.name")); </pre>