Project

General

Profile

Bug #5435

passing string into a parameter for headless execution doesn't work

Added by Derik Barseghian over 8 years ago. Updated over 8 years ago.

Status:
New
Priority:
Normal
Assignee:
Category:
general
Target version:
Start date:
06/30/2011
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
5435

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.

ptparamx.xml (21.4 KB) ptparamx.xml Daniel Crawl, 06/30/2011 04:37 PM

History

#1 Updated by Daniel Crawl over 8 years ago

This also happens when trying to run from Ptolemy:

  1. $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.

#3 Updated by Christopher Brooks over 8 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 '\&quot\;xxx\&quot\;'

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

#4 Updated by Redmine Admin over 6 years ago

Original Bugzilla ID was 5435

Also available in: Atom PDF