<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Michal,<br>
    The MultiIinstance.kar works for me in the Kepler trunk.<br>
    The version of the MultiInstance.kar that you sent produces two
    outputs on the Display.<br>
    <br>
    If I move the Display to the inside of the MultiInstanceComposite,
    then I get just one line, which seems odd.<br>
    <br>
    What version of Kepler are you using?<br>
    <br>
    <br>
    Yes, there are assumptions about the inner model, see the
    documentation or MultiInstanceComposite, reproduced below:<br>
    <blockquote type="cite">
      <style type="text/css">
      <!--
        body { font-family: Arial, Helvetica, sans-serif }
        p { font-family: Arial, Helvetica, sans-serif }
        td { font-family: Arial, Helvetica, sans-serif }
        tr { font-family: Arial, Helvetica, sans-serif }
        h3 { font-family: Arial, Helvetica, sans-serif }
        h2 { font-family: Arial, Helvetica, sans-serif }
        h1 { font-family: Arial, Helvetica, sans-serif }
      -->
    </style>
      <p> A composite actor that creates multiple instances of itself
        during the preinitialize phase of model execution. A
        MultiInstanceComposite actor may be used to instantiate <i>nInstances</i>
        identical processing blocks within a model. This actor (the
        "master") creates <i>nInstances</i> - 1 additional instances
        (clones) of itself during the <i>preinitialize()</i> phase of
        model execution and destroys these instances during model <i>wrapup()</i>.
        MultiInstanceComposite <b>must contain a director</b>, so that
        its Actor interface methods (<i>preinitialize(), ..., wrapup()</i>)
        are invoked during model initialization. Each instance may refer
        to its <i>instance</i> [0..<i>nInstances</i>-1] parameter,
        which is set automatically by the master if it needs to know its
        instance number. </p>
      <p> MultiInstanceComposite input ports must not be multiports and
        may be connected to multiports or regular ports. During <i>preinitialize()</i>,
        the master MultiInstanceComposite determines how its input ports
        are connected, and creates additional relations in its container
        (the model it is embedded in) to connect the input ports of its
        clones (instances) to the same output port if that port is a
        multiport. If that output port is a regular port, the clone's
        input port is linked to the already existing relation between
        that output port and the master's input port.
        MultiInstanceComposite output ports must not be multiports and
        must be connected to input multiports. The master
        MultiInstanceComposite creates additional relations to connect
        the output ports of its clones to the input port. </p>
      <p> Finally, after all these connections are made, the master's <i>preinitialize()</i>
        calls <i>preinitialize()</i> of the clones. From here on until
        <i>wrapup()</i>, nothing special happens. Type resolution occurs
        on all instances in the modified model, so does <i>initialize()</i>
        and the computation of schedules by directors of the master and
        clones. During model <i>wrapup()</i>, the master
        MultiInstanceComposite deletes any relations created, unlinks
        any ports if needed, and deletes the clones it created. To
        re-synchronize vergil's model graph, an empty <i>ChangeRequest</i>
        is also queued with the Manager. </p>
    </blockquote>
    <br>
    <br>
    <br>
    _Christopher<br>
    <br>
    <br>
    On 5/8/12 1:05 AM, Michal Owsiak wrote:
    <blockquote cite="mid:4FA8D3CC.5070409@man.poznan.pl" type="cite">Hello
      Kepler team,
      <br>
      <br>
      I have two issues with Multi Instance Composite actor.
      <br>
      <br>
      What I am trying to achieve is embedding DDF workflow within PN
      workflow where internal composite actor (driven by DDF) is started
      in N multiple instances.
      <br>
      <br>
      The workflow I am trying to embed is attached as SimpleLoop.kar
      <br>
      <br>
      The workflow I am trying to build is attached as MultiInstance.kar
      <br>
      <br>
      It looks pretty straightforward to build this workflow, however I
      have two issues:
      <br>
      <br>
      1. When I build MultiInstance workflow from the scratch it doesn't
      work at all.
      <br>
      <br>
      I have to close Kepler and reopen it to get workflow started.
      <br>
      <br>
      2. Second issue is that workflow doesn't work properly if I put
      Display actor inside. There are issues while instantiating
      components.
      <br>
      <br>
      You can validate this issue by opening MultipleInstance.kar and
      putting Display actor somewhere inside Composite actor (connect it
      to any relation inside).
      <br>
      <br>
      I have two questions regarding Multi Instance Composition.
      <br>
      <br>
      Question 1: do I have to make some assumptions regarding sub
      workflow when it comes to embedding workflow within Multi Instance
      Composite?
      <br>
      <br>
      Question 2: is it possible to use Display actor within Multi
      Instance Composite. Is there any workaround?
      <br>
      <br>
      Thanks in advance for the support
      <br>
      <br>
      Cheers
      <br>
      <br>
      Michal
      <br>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Kepler-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Kepler-dev@kepler-project.org">Kepler-dev@kepler-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev">http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Christopher Brooks, PMP                       University of California
CHESS Executive Director                      US Mail: 337 Cory Hall
Programmer/Analyst CHESS/Ptolemy/Trust        Berkeley, CA 94720-1774
ph: 510.643.9841                                (Office: 545Q Cory)
home: (F-Tu) 707.665.0131 cell: 707.332.0670 </pre>
  </body>
</html>