[kepler-dev] references to Java properties from within StringParameter entry fields

Timothy McPhillips tmcphillips at mac.com
Thu May 28 12:03:05 PDT 2009


Hi Christopher,

Is there a convenient way to access the values of Java properties from  
within the entry field for a StringParameter?

For a plain Parameter it appears one can refer to Java properties in  
this manner:

Image:  property("KEPLER")+"/demos/getting-started/species- 
distribution.jpg"

But this requires using quotes to signify a string value.  In a  
StringParameter one can refer to the values of other Variables in  
scope (e.g., a Parameter defined on the workflow canvas) using the $  
symbol, and no quotes are needed.  For example, if I define a  
Parameter on the canvas named 'Directory' that refers to the value of  
the Java property 'COMAD_TESTS':

Directory:  property("COMAD_TESTS")

..then in a StringParameter of an actor on that canvas I can refer to  
the value of that Directory parameter:

File:  $Directory/test-files/TestCollectionReader_new.xml

What I can't seem to do is refer to the Java property directly in the  
entry for the StringParameter, e.g. entering

$property("COMAD_TESTS")/test-files/TestCollectionReader_new.xml

gives the exception:

ptolemy.kernel.util.IllegalActionException: Error evaluating  
expression: $property("COMAD_TESTS")/test-files/ 
TestCollectionReader_new.xml
   in .TestCollectionReader_test.CollectionReader_New.File
Because:
The ID property is undefined.


Is there an easy way to do this?

Thanks!

Tim






More information about the Kepler-dev mailing list