OCLInEcore: restrict the scope of references [message #916012] |
Tue, 18 September 2012 08:01  |
Eclipse User |
|
|
|
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?
|
|
|
Re: OCLInEcore: restrict the scope of references [message #916050 is a reply to message #916012] |
Tue, 18 September 2012 09:02  |
Eclipse User |
|
|
|
Hi
I'm afraid that I find most discussions that involve Mn levels just get
confused by the Mn usage. (The OCLinEcore defines an Mx meta-model for
instances at Mx-1).
If you are requesting the OCLinEcore editor to provide only plausible
completion assist at e.g. @@ in
property eStructuralFeatures#@@ : EStructuralFeature[*] {
ordered composes !resolve };
then the current code (Juno) already does so. Completion assist has been
steadily improving; the latest code prioritizes so that properties
appear first and together.
If you are trying to define a constraint to enforce something in your
run-time model, then I'm unclear how the editor should help.
In fact I'm not even clear which editor you refer to. Is it the
OCLinEcore editor or an EMF generated editor.
Perhaps if you provided a screen shot of whatever you consider
inadequate, I might be able to be more helpful.
Regards
Ed Willink
On 18/09/2012 13:01, Andrea Sindico wrote:
> 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?
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04780 seconds