[Anthill-pro] Variable.notPresent?

Chris Walquist cwalquist at DRWHoldings.com
Mon Nov 2 09:21:51 CST 2009


Hmmm, weird...do you have anthill3-logic.jar in your classpath?


 
This e-mail and any attachments may contain information that is confidential and proprietary and otherwise protected from disclosure. If you are not the intended recipient of this e-mail, do not read, duplicate or redistribute it by any means. Please immediately delete it and any attachments and notify the sender that you have received it in error. Unintended recipients are prohibited from taking action on the basis of information in this e-mail or any attachments. The DRW Companies make no representations that this e-mail or any attachments are free of computer viruses or other defects. -----Original Message-----
 

From: anthill-pro-bounces at lists.urbancode.com
[mailto:anthill-pro-bounces at lists.urbancode.com] On Behalf Of
Brian_Kelly at timeinc.com
Sent: Friday, October 30, 2009 4:05 PM
To: anthill-pro at lists.urbancode.com; rws at urbancode.com
Subject: RE: [Anthill-pro] Variable.notPresent?

Thanks, Chris, but neither worked for me.

-brian 

-----Original Message-----
From: anthill-pro-bounces at lists.urbancode.com
[mailto:anthill-pro-bounces at lists.urbancode.com] On Behalf Of Chris
Walquist
Sent: Friday, October 30, 2009 11:06 AM
To: AnthillPro user and support list.; rws at urbancode.com
Subject: RE: [Anthill-pro] Variable.notPresent?

I believe this will do it...

import com.urbancode.logic.Criteria;

or maybe

import com.urbancode.logic.*;

(Note that "Criteria" in Job and Step precondition scripts is in a
different namespace than agent filter "Criteria").

-chris


 
This e-mail and any attachments may contain information that is
confidential and proprietary and otherwise protected from disclosure. If
you are not the intended recipient of this e-mail, do not read,
duplicate or redistribute it by any means. Please immediately delete it
and any attachments and notify the sender that you have received it in
error. Unintended recipients are prohibited from taking action on the
basis of information in this e-mail or any attachments. The DRW
Companies make no representations that this e-mail or any attachments
are free of computer viruses or other defects. -----Original
Message-----
 

From: anthill-pro-bounces at lists.urbancode.com
[mailto:anthill-pro-bounces at lists.urbancode.com] On Behalf Of
Brian_Kelly at timeinc.com
Sent: Friday, October 30, 2009 9:09 AM
To: rws at urbancode.com
Cc: anthill-pro at lists.urbancode.com
Subject: RE: [Anthill-pro] Variable.notPresent?

What package is it in? Looks like I need to do an import in order for
that script to compile/parse correctly.

-brian 

-----Original Message-----
From: Ryan Smith [mailto:rws at urbancode.com]
Sent: Friday, October 30, 2009 8:49 AM
To: Kelly, Brian - Information Technology <Brian_Kelly at timeinc.com>
Cc: anthill-pro at lists.urbancode.com
Subject: Re: [Anthill-pro] Variable.notPresent?

No, Logic has been there for a while. Its contained in a dependency of
Anthill so it isn't making it into the API at the moment.

It basically has Logic.and(), Logic.or(), and Logic.not().


Ryan

Brian_Kelly at timeinc.com wrote:
> Hi Ryan,
>
> Thanks for the answer.
>
> Is that a new Class in 3.7? I'm not seeing it in the 3.6.3 API
JavaDoc.
>
> -brian
>
> -----Original Message-----
> From: anthill-pro-bounces at lists.urbancode.com
> [mailto:anthill-pro-bounces at lists.urbancode.com] On Behalf Of Ryan 
> Smith
> Sent: Thursday, October 29, 2009 5:13 PM
> To: AnthillPro user and support list.
> Subject: Re: [Anthill-pro] Variable.notPresent?
>
> return Logic.or(Where.not(Variable.isPresent("myapp/cluster")),
> Variable.matches("myapp/cluster", "a"));
>
> return Logic.or(Where.not(Variable.isPresent("myapp/cluster")),
> Variable.matches("myapp/cluster", "b"));
>
>
>
> Ryan
>
> Brian_Kelly at timeinc.com wrote:
>   
>> I guess as long as I don't go beyond two clusters the following would
>> work:
>>
>> # Agent Filter A
>> return Where.not(
>>   Variable.matches("myapp/cluster", "b") );
>>
>> # Agent Filter B
>> return Where.not(
>>   Variable.matches("myapp/cluster", "a") );
>>
>> But it's not as straightforward as I'd prefer to be.
>>
>> -brian
>>
>> -----Original Message-----
>> From: anthill-pro-bounces at lists.urbancode.com
>> [mailto:anthill-pro-bounces at lists.urbancode.com] On Behalf Of 
>> Brian_Kelly at timeinc.com
>> Sent: Thursday, October 29, 2009 4:33 PM
>> To: anthill-pro at lists.urbancode.com
>> Subject: [Anthill-pro] Variable.notPresent?
>>
>> I'm dealing with a setup where a set of applications are deployed to
>>     
> the
>   
>> same Environment Group but the Production Environment is partitioned
>>     
> in
>   
>> two - an A and B cluster. So one project might get deployed to Dev, 
>> QA and Prod A and another project might get deployed to Dev, QA and 
>> Prod
>>     
> B.
>   
>>  
>>
>> On the Production Agents I've set a variable "myapp/cluster" to 
>> either "a" or "b".
>>
>>  
>>
>> I then made an Agent Filter for each Cluster:
>>
>>  
>>
>> return Where.is(
>>   Variable.matches("myapp/cluster", "a")
>>
>> );
>>
>>  
>>
>> return Where.is(
>>   Variable.matches("myapp/cluster", "B")
>>
>> );
>>
>>  
>>
>> I then made two Deployment workflows, one that uses Agent Filter A 
>> and one that uses Agent Filter B.
>>
>>  
>>
>> Then I realized that these filters will only work in Production, not
>>     
> in
>   
>> Dev and QA. I decided that Dev and QA can run on an Agent where the 
>> variable isn't set at all, since Dev and QA belong to neither/both 
>> cluster.
>>
>>  
>>
>> Unfortunately Variable can only detect the presence of a variable, 
>> not the non-presence.
>>
>>  
>>
>> What I'd really like is the following:
>>
>>  
>>
>> return Where.any(
>>   Variable.matches("myapp/cluster", "a"),
>>   Variable.notPresent("myapp/cluster")
>> );
>>
>>  
>>
>> return Where.any(
>>   Variable.matches("myapp/cluster", "b"),
>>   Variable.notPresent("myapp/cluster")
>> );
>>
>>  
>>
>> Anybody know how to pull off a notPresent? Variable returns a 
>> Criteria object, so ! doesn't work.
>>
>>  
>>
>> -brian
>>
>>  
>>
>> PS Ideally I'd like to eventually do this even more dynamically like 
>> determining the destination cluster using a project property:
>>
>>  myapp.cluster = a
>>
>>  myapp.cluster = b
>>
>>  myapp.clsuter = a,b (for both)
>>
>>  
>>
>> _______________________________________________
>> Anthill-pro mailing list
>> Anthill-pro at lists.urbancode.com
>> http://lists.urbancode.com/mailman/listinfo/anthill-pro
>> _______________________________________________
>> Anthill-pro mailing list
>> Anthill-pro at lists.urbancode.com
>> http://lists.urbancode.com/mailman/listinfo/anthill-pro
>>
>>   
>>     
> _______________________________________________
> Anthill-pro mailing list
> Anthill-pro at lists.urbancode.com
> http://lists.urbancode.com/mailman/listinfo/anthill-pro
>
>   
_______________________________________________
Anthill-pro mailing list
Anthill-pro at lists.urbancode.com
http://lists.urbancode.com/mailman/listinfo/anthill-pro
_______________________________________________
Anthill-pro mailing list
Anthill-pro at lists.urbancode.com
http://lists.urbancode.com/mailman/listinfo/anthill-pro
_______________________________________________
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