![]() |
Connectables |
Post Reply
|
| Author | |
freazer
Member
Joined: 06.Jul.2010 Points: 8 |
Post Options
Thanks(0)
Quote Reply
Topic: ConnectablesPosted: 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 |
|
![]() |
|
stevek
MetaCase
Joined: 11.Mar.2008 Points: 643 |
Post Options
Thanks(0)
Quote Reply
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. |
|
![]() |
|
Post Reply
|
|
| Tweet |
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |