|
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 =
|
|
|
+ |
<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();
|
|
|
+ |
for (int i = 0; i < agents.length; i++) {
|
|
|
+ |
if (agents[i].equals(targetAgent)) {
|
|
|
+ |
return new Agent[]{targetAgent};
|
|
|
+ |
return Where.is(myWhere); </pre>
|