<html><body><div>Hi Christopher,</div><div><br></div><div>Thank you for the push in the right direction. It turned out to be a quoting issue. The necessary way to quote (for my tcsh) was "&quot;/Users/wernsing/rest.py&quot;". The escaping of the back slashes was not necessary. I also tried double quotes inside of single quotes but that gave me the same issue I originally wrote about.</div><div><br></div><div>I am back to "loving" Kepler.</div><div><br></div><div>--Gary<br><br>On Dec 05, 2013, at 10:38 AM, Christopher Brooks <cxh@eecs.berkeley.edu> wrote:<br><br></div><div><div><blockquote type="cite"><div class="msg-quote"><div class="moz-cite-prefix">Hi Gary,<br> Do you have a small test case?<br> <br> A few thoughts:<br> 1) Passing in a string parameter value might require including double quotes in the value.  Getting these double quotes to not be stripped off by kepler.sh could be tricky.  Kepler uses Ptolemy II as its execution engine and <a class="moz-txt-link-freetext" href="http://ptolemy.eecs.berkeley.edu/ptolemyII/ptIIfaq.htm#invoking%20Ptolemy%20II" data-mce-href="http://ptolemy.eecs.berkeley.edu/ptolemyII/ptIIfaq.htm#invoking%20Ptolemy%20II">http://ptolemy.eecs.berkeley.edu/ptolemyII/ptIIfaq.htm#invoking%20Ptolemy%20II</a>? discusses setting Parameter in Ptolemy II.  In particular:<br> <br><blockquote type="cite"><p>Note that strings need to have double quotes converted to <code>&quot;</code> so to set a parameter named <code>c</code> to the string <code>"bar"</code> it might be necessary to do something like:</p><pre>   $PTII/bin/ptolemy foo.xml -a 5 -y.b 10 -c "\&quot\;bar\&quot\;"
   </pre>The <code>&quot;</code> is necessary to convert the double quote to something safe to in an XML file. The backslashes are necessary to protect the <code>&</code> and <code>;</code>from the shell in the shell script.<p>Note that the ptolemy.actor.parameters.ParameterSet attribute is a better way to set parameters at run time. ParameterSet is an attribute that reads multiple values from a file and sets corresponding parameters in the container.</p></blockquote>Kepler and Ptolemy use different start up scripts, but it might be worth trying "\&quot;/Users/wernsing/rest.py\&quot;"<br> <br> 2) The fact that the model works ok from the GUI is interesting, it could be that there is something up with type resolution.  I'm not sure if Kepler 2.4 is based on a version of Ptolemy II that has backward type inference, but you could try setting the enableBackwardTypeInference top level parameter, <a class="moz-txt-link-freetext" href="http://www.mail-archive.com/kepler-users@kepler-project.org/msg02468.html" data-mce-href="http://www.mail-archive.com/kepler-users@kepler-project.org/msg02468.html">http://www.mail-archive.com/kepler-users@kepler-project.org/msg02468.html</a> says:<br> <br><blockquote type="cite"><div class="msgHead"><h1><span class="subject"><a rel="nofollow" href="http://www.mail-archive.com/search?l=kepler-users@kepler-project.org&q=subject:%22Re%3A+%5Bkepler-users%5D+How+do+I+set+the+backward+type+inference+for+a+particular+actor%3F%22" data-mce-href="http://www.mail-archive.com/search?l=kepler-users@kepler-project.org&q=subject%22Re%3A+%5Bkepler-users%5D+How+do+I+set+the+backward+type+inference+for+a+particular+actor%3F%22"><span>Re: [kepler-users] How do I set the backward type inference for a particular actor?</span></a></span></h1><p class="darkgray font13"><span class="sender pipe"><a rel="nofollow" href="http://www.mail-archive.com/search?l=kepler-users@kepler-project.org&q=from:%22Christopher+Brooks%22" data-mce-href="http://www.mail-archive.com/search?l=kepler-users@kepler-project.org&q=from%22Christopher+Brooks%22"><span><span>Christopher Brooks</span></span></a></span> <span class="date"><a rel="nofollow" href="http://www.mail-archive.com/search?l=kepler-users@kepler-project.org&q=date:20131022" data-mce-href="http://www.mail-archive.com/search?l=kepler-users@kepler-project.org&q=date:20131022"><span>Tue, 22 Oct 2013 18:01:54 -0700</span></a></span></p></div><div class="msgBody"><tt>Search for "Parameter", drag it in, rename it to </tt><tt>"enableBackwardTypeInference" and set the value to "true". </tt><tt>Unfortunately, Kepler does not have the model-specfic context menu that </tt><tt>allows one to add a parameter by right clicking on the background, </tt><tt>There is probably a bug here to be reported, which I will do now. </tt></div></blockquote><br> How I would proceed is by creating small examples that exercise setting parameter, setting a Parameter that is a String, setting a PortParameter, settng a PortParameter connected to a Python actor etc.<br> <br> _Christopher<br> <br> On 12/5/13 4:42 AM, GARY WERNSING wrote:<br></div><blockquote type="cite"><pre>I am trying to pass a parameter to a workflow via the command line. Chapter two of the user manual suggests it is straight forward and that adding '-x 4 -y "foo"' to the command line would set both x and y. I am starting to think there is something unspoken about actually using this technique.

I have a workflow that executes properly when I run it from the Kepler GUI but fails when run from the command line. My command line is:

/Applications/Kepler-2.4/Kepler.app/Contents/Resources/Java/kepler.sh -runkar -ScriptLocation "/Users/wernsing/rest.py" /Users/wernsing/KeplerData/workflows/MyWorkflows/RESTviaPython.kar

At some point later I get

...
    [null] Command failed.
    [null] ptolemy.actor.TypeConflictException: Types resolved to unacceptable type . .RESTviaPython due to the following objects:
    [null]   (variable .RESTviaPython.ScriptLocation: unknown)
...

My workflow has three Port Parameters one of which is named "ScriptLocation". When I run the workflow from the Kepler GUI I get the expected result (a file appears on my desktop) so I have some confidence that the workflow is correct. I am baffled as to how to get the command line invocation to set the Port Parameters.

Any advice and/or magic incantations would be greatly appreciated.

--Gary
_______________________________________________
Kepler-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Kepler-users@kepler-project.org" data-mce-href="mailto:Kepler-users@kepler-project.org">Kepler-users@kepler-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users" data-mce-href="http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users">http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users</a>
</pre></blockquote><br> <br><pre class="moz-signature">-- 
Christopher Brooks, PMP                       University of California
Academic Program Manager & Software Engineer  US Mail: 337 Cory Hall
CHESS/iCyPhy/Ptolemy/TerraSwarm               Berkeley, CA 94720-1774
<a class="moz-txt-link-abbreviated" href="mailto:cxh@eecs.berkeley.edu" data-mce-href="mailto:cxh@eecs.berkeley.edu">cxh@eecs.berkeley.edu</a>, 707.332.0670           (Office: 545Q Cory)
</pre></div></blockquote></div></div><style class="_message-styles">div.msg-quote { background-color:#FFFFFF;}
</style></body></html>