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

Ports

 Post Reply Post Reply
Author
Message
salking View Drop Down
Member
Member
Avatar

Joined: 14.Apr.2008
Location: USA
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote salking Quote  Post ReplyReply Direct Link To This Post Topic: Ports
    Posted: 14.Apr.2008 at 19:53

I'm using the MetaEdit evaluation tutorial.  In section 4.2 "Adding representational precision with ports" while drawing the relationships I receive the error "you cannot create a relationship between 2 males and female starting from a male with those ports."  There doesn't seem to be a quick way to verify the port definitions.  I used the "graph tool" to reveiw "types" and "bindings" settings and they looked good (matched what example was expecting).   I used the "object tool" to verify ports on symbol were correct.

Any suggestions would be appreciated.
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: 14.Apr.2008 at 23:07

With tutorials, it's always a little hard to guess what might have gone wrong - hard for you and for me! The key things to check would be these (you've already mentioned 2 and 3, but double-checking against the information here would be sensible):

  1. that you are clicking in the right places in the diagram, to select the appropriate ports: the right edge of the Father, the left edge of the Mother, and the top edge of the Child. As you hover over the symbols, you can see the closest port's connectable highlighted.
  2. that the Male symbol has one connectable with a Child port on the top edge (Fig 4-9 and 4-10) and another with a Parent port on the right edge (Fig 4-11). For the Female symbol: Child on the top as before, but Parent on the left (Fig 4-12).
  3. that in the Graph Tool's Bindings tab, the Family relationship has the following connections (Role:Port:Object):
    • Parent:Parent:Male
    • Parent:Parent:Female
    • 0..N Child:Child:Person
  4. that you have created only one Port type, Family Port, and for that only two instances, Parent and Child:
    1. Select the Type Browser tab of the MetaEdit+ main launcher,
    2. select the Family Tree project in the Projects list on the left,
    3. select Show: Ports in the pull-down list bottom center, and
    4. select Family Port in the Port types list in the middle (it should be the only Port type, assuming you have only Family Tree open).
    5. The right list should now show just Child and Parent. If it shows multiple occurrences, e.g. two Child instances, double-click the extra one and change its name to Child_OLD or similar.
    6. You can then check the ports in the Symbol Editor for Male and Female, and in the Graph Tool Bindings tab, and delete any occurrences of Child_OLD, replacing them with Add Existing... and choosing the Family Port type, then its instance Child.

If that doesn't help, maybe you could export your diagram and post it here? From the Diagram Editor choose Graph | Export To... | MetaEdit+ Patch File - it will probably give a couple of warnings which you can ignore, and will ask for a name for the repository (e.g. salking), and for the file (e.g. salking.mec). You can upload and attach a file to a post with the zip icon in the full posting editor (the Quick Reply field only has the most basic toolbar buttons; click the diagonal arrow button on its toolbar to get the full editor).



Edited by ForumDBA - 13.Nov.2019 at 12:53
Back to Top
salking View Drop Down
Member
Member
Avatar

Joined: 14.Apr.2008
Location: USA
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote salking Quote  Post ReplyReply Direct Link To This Post Posted: 15.Apr.2008 at 19:39
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.Apr.2008 at 00:27
Thanks for your perseverance! The problem was in the ordering of connections. In the metamodel you had Female in the first role, then Male then the Child. When you were drawing the relationship, you were presumably trying from Male. If you click the Female first, then the Male, then the Child, it works fine. In the Evaluation Tutorial, the order given is Male, Female, Child, for both metamodel (as in Fig 4-13) and model (although I suppose people who read right to left could get that back to front).
 
By default, MetaEdit+ has a setting for relationship creation called "First object always in first role". This requires the first object selected in a model to be of the first type in the binding definition in the metamodel. That's why the error message you saw ended with "...starting from a Male". If you turn the setting off (Repository | Options | Preferences page), MetaEdit+ will allow the modeler to be more lax in the selection order: it will try all possible orderings of the objects selected. However, that's not always a good idea: for instance, if you're drawing an inheritance relationship in a class diagram, and you drag from the subclass to the superclass, MetaEdit+ will then have to offer you a dialog asking whether you wanted the first class to be the subclass or the other way around.
 
You could also improve the Family Tree language to allow either parent to be chosen first: rather than correct your current binding, just add a new similar binding but with Male first. We could do that in the tutorial, but we're trying to keep things simple.
 
Thanks very much for your feedback: we'll now be able to help others avoid this by making it clearer in the text that you have to use the same order in the model as in the metamodel.
 
By the way, I spotted something else in your metamodel that's not quite right: you have the cardinality for Child set to 1..N, rather than 0..N as shown in Fig 4-13.
Back to Top
salking View Drop Down
Member
Member
Avatar

Joined: 14.Apr.2008
Location: USA
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote salking Quote  Post ReplyReply Direct Link To This Post Posted: 16.Apr.2008 at 04:34
Thanks for your rapid response!
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.055 seconds.