OCLInEcore: restrict the scope of references [message #916012] |
Tue, 18 September 2012 12:01 |
|
I'd like to restrict the scope of an association relationship between two classifiers so that the instance of the referred EClass can only be chosen among a subset of the existing instances.
Suppose you have, at M2, an Ecore with a container EClass A which has composition relationships (containment=true) with two contained EClasses B and C. Now suppose B has an association with C (containment = false).
Now suppose to have at M1 a model, instance of the describet meta-model, where you have:
- two A instances: say a1 and a2
- a1 owns one B instance (say b1) and one C instance (say c1)
- a2 owns one B insance (say b2) and one C instance (say c2)
when trying to set the b1 association to a possible C instance the editor depicts all the C instances (i.e. c1 and c2). I would instead it to just depict the C instances contained within the b1's container (which means just c1 as it is the C instance contained by a1 which also contains b1).
May I express this constaint by means of the OCL in the meta-model ecore? would it be taken into account proactively by the editor? or just when the validate menu is invoked?
Follow me on Twitter @andreasindico
|
|
|
|
Powered by
FUDForum. Page generated in 0.02971 seconds