[Anthill-pro] Multi Select properties and Iterations
Eric Minick
etm at urbancode.com
Thu Feb 4 09:48:20 CST 2010
Currently, you cannot set the number of iterations dynamically -- unless you
are running each iteration on a unique agent and use an agent filter that
monitors the property(ies) and only returns the valid agents.
More likely you need a job precondition applied to the iteration that
compares the iteration configuration to the properties on the workflow.
This example precondition checks a property:
https://bugs.urbancode.com/browse/AHPSCRIPTS-29
You'll want to compare the value of two properties at least if I'm reading
correctly.
--eric
On Thu, Feb 4, 2010 at 9:42 AM, <anitha.kasturirangan at thomsonreuters.com>wrote:
> Hi,
>
>
>
> I have a question regarding working with Multi Select properties. I have
> a workflow that has two jobs.
>
>
>
> 1. The first job is a evaluate script job that splits the values in a
> multi select property and puts them into a array. The script looks like
> this
>
>
>
> import com.urbancode.anthill3.domain.agent.Agent;
>
> import java.util.*;
>
>
>
> String[] agentNames =
> PropertyLookup.getValues("choice");
>
> for(i=0;i<agentNames.length;i++)
>
> {
>
> if(agentNames[i].equals("Pit"))
>
>
> PropertyLookup.setValue("SCMenv1",agentNames[i]);
>
> else if(agentNames[i].equals("Cert"))
>
>
> PropertyLookup.setValue("SCMenv2",agentNames[i]);
>
> else if(agentNames[i].equals("nycProd"))
>
>
> PropertyLookup.setValue("SCMenv3",agentNames[i]);
>
> else if(agentNames[i].equals("prod"))
>
>
> PropertyLookup.setValue("SCMenv4",agentNames[i]);
>
> else
>
> print("Hi");
>
> }
>
>
>
> 2. The second job is a UNIX and ANT command that runs on a remote
> server. At present this is job is iterated 8 times( 2 times for each
> environment - 1st time the UNIX command runs for SCMenv(i) and 2nd time
> the ANT command runs for SCMenv(i) - "i" is the environment number being
> set by the script.). The iteration properties look like
>
> cd ${bsh:PropertyLookup.get("SCMenv1")};pwd;
>
> cd ${bsh:PropertyLookup.get("SCMenv2")};pwd;
>
> cd ${bsh:PropertyLookup.get("SCMenv3")};pwd;
>
> cd ${bsh:PropertyLookup.get("SCMenv4")};pwd;
>
>
>
> 3. At present if the user selects just 2 environments (say SCMenv1 and
> SCMenv3 are selected) , the iterations that corresponds to those env
> selected (SCMenv1 and SCMenv3) is a success while the iterations
> corresponding to those which are not selected (SCMenv2 and SCMenv4) and
> not set by the script is a failure, which in turn shows the status of
> the workflow as FAILED.
>
> 4. My question here is can I control the number of iterations based on
> the env choosen by the user??? i.e Can I give a condition something like
> if(SCMenv1) then ITERATE else DON'T ITERATE ?? Or is there any other way
> to achieve what I am looking for.
>
>
>
>
>
> Thanks.
>
> Anitha Kasturi Rangan
>
> _______________________________________________
> Anthill-pro mailing list
> Anthill-pro at lists.urbancode.com
> http://lists.urbancode.com/mailman/listinfo/anthill-pro
>
More information about the Anthill-pro
mailing list