[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] Re: GMF mapping Audit Rules

Hi, Achilleas,

GMF validation evaluates the constraints that are defined in the context of the particular EClass of each element in your model, in turn. There is nothing that attempts to discover related elements and validate them, too (although extension points are available that sort-of allow for this).

So, basically, validation doesn't know that it should also check model B when checking model A, unless some constraint in model A seeks out elements in model B for itself and checks them.

As far as I understand the generic description of your constraint, you have attributes ValueA from one metamodel and ValueB from another metamodel. I would never consider their values to be comparable if their *types* are from these different metamodels. Unless they are both typed by the same Ecore primitive type, say, like EString.

Perhaps getting a little more concrete in your description of what you are trying to achieve would help me to understand the nature of the problem.

Cheers,

Christian

Achilleas wrote:
Hi Christian,

I have followed your recommendation for qualifying names and it worked, although the gmfmap validation was showing errors. Luckily I discovered another post of another guy that you adviced him to ignore the validation errors and run an instance of the editor.

I did that and altough the validation errors on .gmfmap exist the constraint runs ok. Although it always gives me a constraint validation even if the two values are equal.

Let's say that I have two instances: one of the Metamodel A---Model A---Value A and one of the Metamodel B---Model B---ValueB.
What I don't understand is how does it know, when I am running the validation on the editor of Model A, that it should check also Model B. My guess is that it does not know and therefore it cannot check the Value A of Model A against the Value B of Model B. That's why it the constraint check fails each time.


Do you agree on this? Is there a way to resolve this so I can get it working?

Thanks,

Achilleas