[Anthill-pro] Setting a Property to the name of the
ExecutingWorkflow
Chris Stoy
chris.stoy at redstorm.com
Fri Oct 12 11:34:01 CDT 2007
Thanks Eric, this worked.
I ended up having to use the line:
workflowname = WorkflowLookup.getCurrent().getName().trim().replace('
','_');
since having spaces in the client name for P4 won't work.
Is there a reference of all the objects available for scripting? It
would be nice to have a list of the objects and what methods they expose
(like the getName() method.)
Chris.
-----Original Message-----
From: anthill-pro-bounces at lists.urbancode.com
[mailto:anthill-pro-bounces at lists.urbancode.com] On Behalf Of Eric
Minick
Sent: Thursday, October 11, 2007 6:43 PM
To: AnthillPro user and support list.
Subject: Re: [Anthill-pro] Setting a Property to the name of the
ExecutingWorkflow
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/COMPUT
ERNAME}
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
>
_______________________________________________
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