[Anthill-pro] Setting a Property to the name of the Executing Workflow

Eric Minick etm at urbancode.com
Thu Oct 11 17:42:50 CDT 2007


Chris,

I think you're just missing semi-colons at the end of your lines. Try:

workflowname = WorkflowLookup.getCurrent().getName();

PropertyLookup.setValue("workflowname", workflowname);

Alternatively you can skip that step and use short form scripts:
builds-anthill-${bsh:WorkflowLookup.getCurrent().getName()}-${env/COMPUTERNAME}

Note, the getCurrent() method delivers the actual workflow configuration 
object, so you have to add a getName() to get it's name. The getName() 
trick works on most everything you assign a name to the interface.

-- Eric

Chris Stoy wrote:
>
> Hello,
>
> I’m trying to set up my Workflow so that when I create a new 
> Clientspec for Perforce it will name it according to the name of the 
> Workflow.
>
> So, in my Source Config section I selected “Create new clientspec” and 
> set the name to be:
>
> builds-anthill-${property:workflowname}-${env/COMPUTERNAME}
>
> Then, in the first Job of my Workflow I added as the first step an 
> Evaluate Script step with the following Beanshell code:
>
> workflowname = WorkflowLookup.getCurrent()
>
> PropertyLookup.setValue("workflowname", workflowname)
>
> When I run the Workflow, I get the following error:
>
> BeanShell script error: Parse error at line 5, column 1.  Encountered: PropertyLookup BSF info: noFile at line: 0
>
> Obviously, I’m not doing something right, but I don’t know Beanshell, 
> so I’m sure there is something wrong with my script.
>
> Any ideas, or is this just a crazy thing to try and do in the first place?
>
> Thanks.
>
> Chris.
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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