diego bowen wrote: > Hello Thomas, just want to let you know that I really appreciate you > responding to my emails.... > > Using the following scriptaction in my workflow.xml (thinking that the > following snippet would display the array contents line by line): > > <scriptaction name="setReleases" language="groovy"> > <description>Rel</description> > <script> > $set ($myarr = ["one", "two", "three"]) > #foreach($item in $myarr) > $item > #end > </script> > </scriptaction> > > Error in tomcat log: > > 13.08 15:53:34 [ERROR] ** Parsing error, line 64, uri > file:///usr/local/tomcat6/webapps/webswamp/WEB-INF/conf/workflows/TEST/0.1/workflow.xml > Attribute "language" must be declared for element type "scriptaction". > 13.08 15:53:34 [ERROR] ************************************************ > 13.08 15:53:34 [ERROR] ************************************************
Hi, the language attribute is part of the <script> element, not the <scriptaction>. You can have a look at conf/workflows/Example/0.2/workflow.xml or the documentation: http://swamp.sourceforge.net/index.php?seite=doc2html&docpage=html-adminguide/x98.html to have an example. > > My ultimate goal is to use the "myarr" array to populate a field called > releasetags used in the start node and defined as a databit in the > dataset section: > > <databit name="releasetags" description="Release Tags" type="enum" > state="read-write"> > <value type="string">$myarr.get(1)</value> > </databit> > > Question1: Can i define a for loop with in the databit? You said I had > to defined the enumeration values of the databit. Would i do so like this: > > <databit name="releasetags" description="Release Tags" type="enum" > state="read-write"> > foreach($rel in $myarr) > <value > type="string">$myarr.get($item)</value> > </databit> No, that won't work. You have to set the enumvalues of your databit "releasetags" in the scriptaction. The definition of the databit in the workflow.xml is static, and can not include scripts. Greetings > > Quesiton2: Since I go the error able when attempting to use "goovy" is > there anything else i need to do other than declaring it as an attribute > in the scriptaction? > > > Thanks > > --- On *Thu, 8/13/09, Thomas Schmidt /<tschm...@suse.de>/* wrote: > > > From: Thomas Schmidt <tschm...@suse.de> > Subject: Re: How do you use a Enumeration-Array! in a ScriptAction > To: "diego bowen" <diegobo...@yahoo.com> > Cc: swamp-devel@lists.sourceforge.net > Date: Thursday, August 13, 2009, 5:34 AM > > diego bowen wrote: > > Thanks Thomas, couple questions: > > > > 1. Is there an api available that defines things like > setEnumvalues for > > Databits? > > 2. How do you declare and defined an array here...what is the looping > > syntax? > > Hi Diego, the api used from the scripts is directly the one from the > Java classes, Databit.java in this case. > > (https://swamp.svn.sourceforge.net/svnroot/swamp/trunk/swamp/src/de/suse/swamp/core/data/Databit.java) > How to declare an array in the scriptaction, please check the > velocity language reference for that: > http://velocity.apache.org/engine/releases/velocity-1.6.2/user-guide.html > It is also possible to use groovy scripts in swamps scriptaction, > please use the > language="groovy" attribute for this. > > Greetings > > > > > Thanks > > > > --- On *Wed, 8/12/09, Thomas Schmidt /<tschm...@suse.de > </mc/compose?to=tschm...@suse.de>>/* wrote: > > > > > > From: Thomas Schmidt <tschm...@suse.de > </mc/compose?to=tschm...@suse.de>> > > Subject: Re: How do you use a Enumeration-Array! in a ScriptAction > > To: "diego bowen" <diegobo...@yahoo.com > </mc/compose?to=diegobo...@yahoo.com>> > > Cc: swamp-devel@lists.sourceforge.net > </mc/compose?to=swamp-de...@lists.sourceforge.net> > > Date: Wednesday, August 12, 2009, 4:59 AM > > > > diego bowen wrote: > > > Hello Thomas, in trying to accomplish the following: > > > > > > Objective is to have a dropdown, "releasetags" populated > with contents > > > of "/Users/diegobowen/tmp/test.sh" > > > > > > I have the following dataedit and ScriptAction defined > within a node: > > > > > > > > > <field path="cmscoredataset.releasetags" mandatory="yes"/> > > > > > > > > > <scriptaction name="call_external"> > > > <description>Calling external a program</description> > > > <script> > > > $executor.setExecutable("/Users/diegobowen/tmp/test.sh") > > > $executor.execute() > > > > > > $wf.getDatabit("cmscoredataset.ps").setValue($executor.getStdout()) > > > </script> > > > </scriptaction> > > > Note: /Users/diegobowen/tmp/test.sh returns the following: > > > > > > 1.5.0 > > > 1.5.1 > > > 1.5.3.1 > > > 1.5.3.2 > > > 1.5.3.3 > > > 1.5.3.4 > > > 1.6 > > > > > > > > > And the Databit Defined as: > > > > > > <databit name="releasetags" description="testing testing" > type="enum" > > > state="read-write"/> > > > > Hi Diego, tou need to set the enumeration values of the > databit, not > > the value. > > This can be done by > > $wf.getDatabit("cmscoredataset.ps").setEnumvalues( ... ) > > after parsing the stdout into an array. > > > > Greetings > > > > -- > > Thomas Schmidt (tschmidt [at] suse.de) > > SUSE Linux Products GmbH :: Research & Development :: Tools > > "Don't Panic", Douglas Adams (1952 - 11.05.2001) > > > > > > > -- > Thomas Schmidt (tschmidt [at] suse.de) > SUSE Linux Products GmbH :: Research & Development :: Tools > "Don't Panic", Douglas Adams (1952 - 11.05.2001) > > -- Thomas Schmidt (tschmidt [at] suse.de) SUSE Linux Products GmbH :: Research & Development :: Tools "Don't Panic", Douglas Adams (1952 - 11.05.2001) ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ swamp-devel mailing list swamp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/swamp-devel http://swamp.sf.net