Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCLInEcore: restrict the scope of references
OCLInEcore: restrict the scope of references [message #916012] Tue, 18 September 2012 12:01 Go to next message
Andrea Sindico is currently offline Andrea SindicoFriend
Messages: 266
Registered: November 2010
Senior Member

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

Re: OCLInEcore: restrict the scope of references [message #916050 is a reply to message #916012] Tue, 18 September 2012 13:02 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
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?
>
>
Previous Topic:Juno: Parsing OCL in Guards
Next Topic:[Announce] Eclipse OCL 4.0.1 (Juno SR1) RC4 is now available
Goto Forum:
  


Current Time: Tue Apr 23 11:07:00 GMT 2024

Powered by FUDForum. Page generated in 0.02971 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top