[Anthill-pro] Event Selector - comparing last build status

Wes Bramhall WesB at widen.com
Fri Feb 1 12:33:25 CST 2008


Thanks Ryan, that makes a lot of sense! I'll try out your suggestions
and let y'all know how it works.

-Wes

-----Original Message-----
From: anthill-pro-bounces at lists.urbancode.com
[mailto:anthill-pro-bounces at lists.urbancode.com] On Behalf Of Ryan Smith
Sent: Friday, February 01, 2008 11:48 AM
To: AnthillPro user and support list.
Subject: Re: [Anthill-pro] Event Selector - comparing last build status

If you are calling it on a BuildLife object, then it will always return
a BuildLife object. It should be fine.

This is operating on build life statuses so you have to make sure your
build is setting the failure status when it fails. This is different
than testing the status of the workflow (which is always set). You need
a explicit step to set a build life status of 'failure'.

I would also put the testing of the event type around everything else
for performance reasons and I would limit it to WorkflowEndEvent.


Ryan

Wes Bramhall wrote:
> I am going to test this today.
> 
>  
> 
> *import* com.urbancode.anthill3.domain.workflow.*;
> *import* com.urbancode.anthill3.domain.buildlife.*;
> 
> result = false;
> 
> BuildLife current = BuildLifeLookup.getCurrent();
> *if*
(current.getPrevBuildLife().getLatestStatus().getStatus().isFailure())
> {
>         *if* (event *instanceof* WorkflowEvent
>                && event.getCase().isComplete()
>                && event.getCase().getStatus().isSuccess())
>         {
>                result = true;
>         }
> }
> *return* result;
> 
>  
> 
> My concern is that BuildLife.getPrevBuildLife() returns a 
>
|com.urbancode.codestation2.domain.buildlife.CodestationCompatableBuildL
ife 
> and not a |com.urbancode.anthill3.domain.buildlife.BuildLife and so I 
> don't know if any of the methods are the same.
> 
>  
> 
>  
> 
>  
> 
> *From:* anthill-pro-bounces at lists.urbancode.com 
> [mailto:anthill-pro-bounces at lists.urbancode.com] *On Behalf Of *Yanko,

> Curtis
> *Sent:* Friday, February 01, 2008 10:15 AM
> *To:* AnthillPro user and support list.
> *Subject:* RE: [Anthill-pro] Event Selector - comparing last build
status
> 
>  
> 
> Has there been headway on this? I have a team that wants Failures and 
> first Success. While I fundamentally disagree with this approach they 
> are the customer.
> 
>  
> 
> ===
> 
> -Curt
> 
> W: 860.702.9059
> 
> M: 860.881.2050
> 
>  
> 
>  
> 
>
------------------------------------------------------------------------
> 
> *From:* anthill-pro-bounces at lists.urbancode.com 
> [mailto:anthill-pro-bounces at lists.urbancode.com] *On Behalf Of *Wes
Bramhall
> *Sent:* Wednesday, January 30, 2008 5:33 PM
> *To:* AnthillPro user and support list.
> *Subject:* [Anthill-pro] Event Selector - comparing last build status
> 
> I am trying to make a custom Event Selector that will notify if the 
> current build is a success and the previous one is a failure. How
would 
> I access the previous build life to determine if it was a failure? I 
> don't see a way to access previous build lives except by status.
> 
>  
> 
> Thanks,
> 
> -Wes
> 
> 
> 
> This e-mail, including attachments, may include confidential and/or
> proprietary information, and may be used only by the person or entity
to
> which it is addressed. If the reader of this e-mail is not the
intended
> recipient or his or her authorized agent, the reader is hereby
notified
> that any dissemination, distribution or copying of this e-mail is
> prohibited. If you have received this e-mail in error, please notify
the
> sender by replying to this message and delete this e-mail immediately.
> 
> 
>
------------------------------------------------------------------------
> 
> _______________________________________________
> Anthill-pro mailing list
> Anthill-pro at lists.urbancode.com
> http://lists.urbancode.com/mailman/listinfo/anthill-pro

-- 
===========================================================
Ryan Smith.           		2044 Euclid Ave., Suite 600
Lead Developer                  Cleveland, Ohio 44115
Urbancode, Inc.
                                email:  rws at urbancode.com
web:     www.urbancode.com      phone:  216-858-9000
web:     www.anthillpro.com     fax:    216-858-9602
===========================================================
_______________________________________________
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