Version Differences for Agent Filter

Line 32:
       
  return Where.is(new PropertyEqualsAgentVar("my.property.name", "agent.property.name")); </pre>    return Where.is(new PropertyEqualsAgentVar("my.property.name", "agent.property.name")); </pre> 
       
    + = Agent Filter Script to Choose the Agent of the First Job of the Originating Workflow =  
       
    + ==== AHPSCRIPTS-21 ====  
    + <pre>import com.urbancode.anthill3.domain.agent.Agent;  
    + import com.urbancode.anthill3.runtime.scripting.helpers.*;  
       
    + Where myWhere = new Where() {  
    + public Agent[] filter(Agent[] agents) {  
    + // assumes that the build job was the first job in orig-workflow  
    + Agent targetAgent = BuildLifeLookup.getCurrent().getOriginatingWorkflow().getJobTraceArray()[0].getAgent();  
       
       
    + boolean found = false;  
    + for (int i = 0; i < agents.length; i++) {  
    + if (agents[i].equals(targetAgent)) {  
    + found = true;  
    + break;  
    + }  
       
    + }  
    + if (found) {  
    + return new Agent[]{targetAgent};  
    + }  
    + else {  
    + return new Agent[0];  
    + }  
    + }  
    + };  
       
    + return Where.is(myWhere); </pre>