<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <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">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">
        <meta http-equiv="content-type" content="text/html;
          charset=ISO-8859-1">
        <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">http://www.mail-archive.com/kepler-users@kepler-project.org/msg02468.html</a>
      says:<br>
      <br>
      <blockquote type="cite">
        <meta http-equiv="content-type" content="text/html;
          charset=ISO-8859-1">
        <div class="msgHead">
          <h1>
            <span class="subject"><a
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"
                rel="nofollow"><span itemprop="name">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
href="http://www.mail-archive.com/search?l=kepler-users@kepler-project.org&q=from:%22Christopher+Brooks%22"
                rel="nofollow"><span itemprop="author" itemscope=""
                  itemtype="http://schema.org/Person"><span
                    itemprop="name">Christopher Brooks</span></span></a></span>
            <span class="date"><a
href="http://www.mail-archive.com/search?l=kepler-users@kepler-project.org&q=date:20131022"
                rel="nofollow"><span itemprop="datePublished"
                  content="2013-10-22T18:01:54-0700">Tue, 22 Oct 2013
                  18:01:54 -0700</span></a></span>
          </p>
        </div>
        <div itemprop="articleBody" 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 cite="mid:01EA5BC4-64BD-447F-918D-36CF95A0F91C@me.com"
      type="cite">
      <pre wrap="">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">Kepler-users@kepler-project.org</a>
<a class="moz-txt-link-freetext" 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" cols="72">-- 
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">cxh@eecs.berkeley.edu</a>, 707.332.0670           (Office: 545Q Cory)
</pre>
  </body>
</html>