[kepler-users] using string parameter in external execution actor

Christopher Brooks cxh at eecs.berkeley.edu
Wed Jun 10 21:00:37 PDT 2009


Hi,
Do you have a small sample that illustrates the issue?

I've attached a model that was run against the development version
of Kepler (*not* kepler-1.0.0).

The model has an ExternalExecution actor that reads the value of
the environment parameter from an Parameter named 
MyEnvironmentParameter.  The ExternalExecution actor run the
"env" command, which for me, under Mac OS X, prints out the value
of the environment.  This might not work under Windows, you could
try experimenting with the DOS "set" command.

The Environment parameter is an array of Records, where in Ptolemy
a record has name=value pairs.  The docs for environment
in ptolemy.actor.lib.Exec say:

The environment in which to execute the command.
      *  This parameter is read each time the subprocess is started
      *  in fire(). Once the subprocess is running, this parameter is not
      *  read again until fire() is called again.
      *
      *  <p>This parameter is an array of records that name an environment
      *  variable and the value for the value.  The format is:</p>
      *  <pre>
      *  {{name = "<i>NAME1</i>", value = "<i>value1</i>"}...}
      *  </pre>
      *  Where <code><i>NAME1</i></code> is the name of the environment
      *  variable, and <code><i>value1</i></code> is the value.
      *  <p>For example <code>{{name = "PTII", value = "c:/ptII"}}</code>
      *  would set the value of the <code>PTII</code> to 
<code>c:/ptII</code>.</p>
      *
      *  <p>If the initial value of the parameter is <code>{{name="",
      *  value = ""}}</code>, then the environment from the calling or 
parent
      *  process is used in the new command.</p>
      *
      *  <p>Note that if this parameter sets any environment variable,
      *  then under Windows the other environment variables in the calling
      *  or parent process might not be passed to the subprocess.  This
      *  behaviour could be platform or JVM dependent. When in doubt,
      *  try setting the <i>command</i> value to "env" to print out the
      *  environment.</p>

If this doesn't help, please reply with a model.  Also, let me
know if you are using Kepler-1.0.0 or the Kepler devel tree.

_Christopher

Ufuk Utku Turuncoglu wrote:
> Hi,
> 
> I try to use string parameter in external execution actor's environment 
> parameter but i got parsing error. Is there any way to use string 
> parameter in that field? I try to put double dollar sign (that does not 
> make sense in this example, but i want to try) at the beginning of the 
> parameter name but it also gives parsing error.
> 
> --ufuk
> _______________________________________________
> Kepler-users mailing list
> Kepler-users at kepler-project.org
> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users

-- 
Christopher Brooks (cxh at eecs berkeley edu) University of California
CHESS Executive Director                      US Mail: 337 Cory Hall
Programmer/Analyst CHESS/Ptolemy/Trust        Berkeley, CA 94720-1774
ph: 510.643.9841 fax:510.642.2718	      (Office: 545Q Cory)
home: (F-Tu) 707.665.0131 (W-F) 510.655.5480
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ExternalExecutionEnvironment.xml
Type: text/xml
Size: 34699 bytes
Desc: not available
URL: <http://lists.nceas.ucsb.edu/kepler/pipermail/kepler-users/attachments/20090610/175ea28d/attachment.xml>


More information about the Kepler-users mailing list