MetaCase Homepage
Forum Home Forum Home > > MetaEdit+
  New Posts New Posts RSS Feed - Connectables
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Connectables

 Post Reply Post Reply
Author
Message
freazer View Drop Down
Member
Member


Joined: 06.Jul.2010
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote freazer Quote  Post ReplyReply Direct Link To This Post Topic: Connectables
    Posted: 14.Jul.2010 at 16:07
Hi,

I would like to explore all the connectables of my object in a Generator, but I can't find it in the list of the elements that can be used in a MERL script (Graph, Object, Port, Role,...). if you refer to the figure in this post http://www.metacase.com/forums/forum_posts.asp?TID=155 I would like to have this kind of output from the Generator:
-----------------------
Slave 1 on Port 1
Slave 2 on Port 1
Slave 3 on Port 2
------------------------

Thx
Back to Top
stevek View Drop Down
MetaCase
MetaCase
Avatar

Joined: 11.Mar.2008
Points: 643
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevek Quote  Post ReplyReply Direct Link To This Post Posted: 16.Jul.2010 at 02:34
It's not connectables that you want to explore, it's Ports. Connectables are a representational thing, ports are the conceptual things, and MERL deals (primarily) with conceptual things.

So you want to go through all Masters, and for each one go through its MasterSlave relationships. Actually, we'll walk first just into the Master role, and from there go on an excursion to the Slave role and Slave ("Slave 1"), and then again on an excursion to the MyPort port:

foreach .Master {
do ~Master {
    do ~Slave.Slave { id }
    ' on '
    do #MyPort { id }
    newline
}
}

It's generally best to navigate into roles rather than relationships. In this case it doesn't matter much, but if both roles were of the same type (e.g. Association End in UML), if you go to the relationship and look at the roles, they all look the same so it's hard to know which way you want to go next.

Similarly you never want to navigate on from a port. You can pop into one on an excursion, but asking for all the roles connected to "Port 1" is pretty meaningless: "Port 1" is defined in the metamodel, so every Master object has the identical same "Port 1", so you would then be following ALL roles connected to ANY Master object on Port 1.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.05
Copyright ©2001-2022 Web Wiz Ltd.

This page was generated in 0.033 seconds.