[Anthill-pro] Re: Adding environment on deployment workflowsnotifications and event selector doubt

emerson cargnin echofloripa.yell at gmail.com
Wed May 7 05:39:44 CDT 2008


Cool thanks.
I managed now to get the environment during the email velocity
processing with the following in the context script:

// adding the environment
context.put("environment", workflow.getServerGroup().getName());

and in the email to send always except when it's on the CI environment I used:

import com.urbancode.anthill3.domain.workflow.*;

result = false;
if (event instanceof WorkflowEvent &&
    event.getCase().isComplete() &&
    !event.getCase().getServerGroup().getName().equalsIgnoreCase("CI") ) {
  result = true;
}
return result;

thanks Uldis
Emerson

On 07/05/2008, Uldis Karlovs-Karlovskis <uldisk at ctco.lv> wrote:
> Imo it fails because it is mail generation part where no Environment is
> used. Try to retrieve Environment from currentWorkflowCase.
>
> Regards,
> Uldis, C. T. Co
> uldis.karlovs-karlovskis at ctco.lv
>
>
> -----Original Message-----
> From: anthill-pro-bounces at lists.urbancode.com
> [mailto:anthill-pro-bounces at lists.urbancode.com] On Behalf Of emerson
> cargnin
> Sent: trešdiena, 2008. gada 7. maijā 12:51
> To: AnthillPro user and support list.
> Subject: [Anthill-pro] Re: Adding environment on deployment
> workflowsnotifications and event selector doubt
>
> hello? someone there?
>
> On 06/05/2008, emerson cargnin <echofloripa.yell at gmail.com> wrote:
> > Got the log from velocity template, it also gets a null object:
> >
> > 2008-05-06 20:29:18,034 ERROR JobThread-4472
> > com.urbancode.anthill3.services.template.TemplateApplication - Left
> > side ($environment) of '!=' operation has null value. Operation not
> > possible. null [line 68, column 21]
> >
> > any help is very appreciated.
> > thanks
> > emerson
> >
> > On 06/05/2008, emerson cargnin <echofloripa.yell at gmail.com> wrote:
> > > For the first it doesn't show the environment, and for sure it is not
> > > "Build-farm"
> > >
> > > For the selector I get a null pointer from the EnvironmentLookup.
> > >
> > > Any idea how to implement these two?
> > >
> > > thanks
> > > emerson
> > >
> > > On 06/05/2008, emerson cargnin <echofloripa.yell at gmail.com> wrote:
> > > > How can I show the environment in the notification when it's a
> > > > deployment workflow (a secondary workflow)
> > > >
> > > > I added to the context script:
> > > >
> > > > // adding the environment
> > > > context.put("environment", EnvironmentLookup.getCurrent().getName());
> > > >
> > > > and to template:
> > > >
> > > > <h1> Workflow: $workflow.Name
> > > > </h1>
> > > > <br/>
> > > > #if ($environment !="Build-Farm")
> > > > <h2> Environment: $environment
> > > > </h2>
> > > > #end
> > > > <br/>
> > > >
> > > > Is this right?
> > > >
> > > > Second question:
> > > >
> > > > I have changed a event selector to send emails unless it's the
> > > > continuous integration build (don't want people to get an email for
> > > > each time the CI workflow deploys...)
> > > >
> > > > ----------------------------------------------------------------
> > > > import com.urbancode.anthill3.domain.workflow.*;
> > > >
> > > > result = false;
> > > > if (event instanceof WorkflowEvent &&
> > > >    event.getCase().isComplete() &&
> > > > !event.getCase().getServerGroup().getName().equalsIgnoreCase("CI")) {
> > > >  result = true;
> > > > }
> > > > return result;
> > > > ----------------------------------------------------------------
> > > >
> > > > Is it right? It's not really working....
> > > >
> > >
> >
> _______________________________________________
> 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