[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.modeling.mdt.uml2.ocl] Re: evaluating in between 2 models.

Hi, FranÃois,

Given that you don't want to use Class.allInstances() to find B, you will
have to provide a variable that carries B at run-time.  The usual way in
OCL do define variables is as parameters of an operation signature. 
However, that doesn't really help you.  What you may need to do is to
manually add Variables to the Environment.  And add corresponding bindings
for these Variables in the EvaluationEnvironment at run-time.

I don't think that this will have anything to do with the AST model.

Does this help?

Christian


FranÃois Lagarde wrote:

> Hello,
> 
> I am interesting to constraint two models element among two distinct
> models.
> 
> Let me considering the following arbitrary example, with a class A and a
> class B having the same meta-model and conform to the same meta-element in
> two distinct models; I would like to write the following constraint (i
> don't want to use the allInstance since i want to check the two particular
> classes, and I want to use a text constraint format because I want to
> allow a user to specify it):
> 
> A.name=B.name
> 
> how can I realize that since there are no common context roots between
> these two elements.
> 
> Should I have to consider AST modification investigation? something like
> evaluating A.name first.
> 
> 
> pardon my english and hopping to be clear enough.
> 
> best regards.
>