Bug #5435
open
passing string into a parameter for headless execution doesn't work
Added by Derik Barseghian over 13 years ago.
Updated over 13 years ago.
Description
If you attempt to pass in a string to a Parameter for a headless execution, the value doesn't get used. An integer works fine. Passing in a sting as the value for a String Parameter also works fine.
For example "foo" below isn't used:
./kepler.sh -runwf -nogui -x "foo" /Users/derik/KeplerData/workflows/MyWorkflows/paramx.xml
The paramx workflow attached to bug#5426 can be used for testing.
Files
This also happens when trying to run from Ptolemy:
- $PTII/bin/ptolemy
x "xxx" ptparamx.xml
Change failed: <property name="x" value="xxx"/>
ptolemy.kernel.util.IllegalActionException: Error evaluating expression: xxx
in .paramx.x
Because:
The ID xxx is undefined.
------------- and --------------
Error evaluating expression: x
in .paramx.Constant.value
Because:
Error evaluating expression: xxx
in .paramx.x
Because:
The ID xxx is undefined.
Looks like the value is not treated as a string, but the name of another parameter. I could not figure out how to escape it.
I'm attaching ptparamx.xml, which works in Ptolemy.
Take a look at
http://ptolemy.eecs.berkeley.edu/ptolemyII/ptIIfaq.htm#invoking%20Ptolemy%20II?
which gives hints. However, I ended up needing more escaping, I'll
update the faq momentarily.
ptparamx.xml worked with
$PTII/bin/ptolemy ptparamx.xml -x '\"\;xxx\"\;'
What is happening with
$PTII/bin/ptolemy ptparamx.xml -x xxx
is that the Const actor is looking for a variable named xxx.
Maybe a StringConst would be a better choice if you want to use
string values?
I agree that the escaping is a pain. To pass parameters more easily,
use ptolemy/actor/parameters/ParameterSet.java
Original Bugzilla ID was 5435
Also available in: Atom
PDF