Bug #5435
openpassing string into a parameter for headless execution doesn't work
0%
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
Updated by Daniel Crawl over 13 years ago
This also happens when trying to run from Ptolemy:
- $PTII/bin/ptolemy
x "xxx" ptparamx.xmland --------------
Change failed: <property name="x" value="xxx"/>
ptolemy.kernel.util.IllegalActionException: Error evaluating expression: xxx
in .paramx.x
Because:
The ID xxx is undefined.
-------------
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.
Updated by Christopher Brooks over 13 years ago
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