|
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.
|