[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,

Thanks for the additional information. It is much clearer, now, what you are attempting to do.

The default implementation of allInstances() has two limitations that are at play in your situation:

  - it is scoped to the current resource, assuming that as the "model"
  - in any case, it would not "see" models in other editing domains
    or that are not yet loaded

The second isn't really an OCL allInstances() limitation, it's a fact of EMF life. Editing domains are intended to be treated as closed universes, and by default GMF editors all use distinct editing domains (I think?).

The first problem is easier to address, though it would require some enhancement in GMF to make it work. The EvaluationEnvironment by default creates a LazyExtentMap that searches only in the scope of the current resource, not across the entire resource set. However, a client can supply its own extent-map implementation that, for example, searches the resource set. This is where GMF enhancements would come into play, to allow the tooling model to specify the desired allInstances() scope and plug in a suitable implementation. Of course, MDT OCL could assist that by making the LazyExtentMap easier to customize ...

HTH,

Christian


Achilleas wrote:
Hi Christian,

I have two metamodels, process metamodel and an E-R metamodel. The first metamodel contains an EClass named "OExpression" with an EAttribute named "model" that is set to be of type EString. Similarly the second metamodel contains an EClass named "Entity" with an EAttribute "type" that is also set to be of the same type EString.

Therefore the type (datatype) of the two attributes ("model" and "type") is comparable since they are both set to EString.

The problem is that when evaluating the process model within its GMF editor, I am trying to check its "model" attribute against the E-R model's "type" attribute. But there is no reference or extension point (like you said) to know which E-R model should be used to evaluate the constraint. I loaded both models using there individual GMF editors to try that but that was an unfortunate assumption:)

The constraint i am using is:
context OExpression
inv: cml::Entity.allInstances()->exists(e2 | self.model = e2.type)

Do you have any idea how I can refer to the E-R model when validating the process model?

Thanks,

Achilleas