[kepler-users] get list of connected ports
Edward A. Lee
eal at eecs.berkeley.edu
Tue Apr 28 18:28:18 PDT 2009
Maybe you want to use deepConnectedOutPortList() and
deepConnectedInPortList()? Note that these won't cross opaque
composite actor boundaries...
Edward
Ufuk Utku Turuncoglu wrote:
> Hi,
>
> I want to get connected port list and connected actor names. My case is
> follows,
>
> actor A has port Ap1 and this port connect to another actor (B) and its
> port Bp1. In this case, i can get actor B name from actor A using
> following code,
>
> In actor A:
>
> int i = -1;
> Iterator connections = port.connectedPortList().iterator();
> while (connections.hasNext()) {
> i++;
> // get connected ports and its containers
> connection[i] = (Port) connections.next();
> container[i] = connection[i].getContainer();
> String name = container[i].getName();
> // check: connected actor is actor B or not
> if (name.contains("Name of actor B")) {
> connected = true;
> }
> }
>
> it normally returns name of connected actor (in our case actor B) but if
> i put these two actors into a composite actor the actor name returns as
> composite actor name like "CompositeActor". I think that i miss
> something here. Is it necessary to implement a fix to handle Composite
> actor case or is there any generic solution for it.
>
> Any suggestion will be helpful,
>
> Thanks,
>
> --ufuk
> _______________________________________________
> Kepler-users mailing list
> Kepler-users at kepler-project.org
> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eal.vcf
Type: text/x-vcard
Size: 351 bytes
Desc: not available
URL: <http://lists.nceas.ucsb.edu/kepler/pipermail/kepler-users/attachments/20090428/e0b62325/attachment.vcf>
More information about the Kepler-users
mailing list