Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Applying OCL at models (vs metamodels)
Applying OCL at models (vs metamodels) [message #1692999] Tue, 21 April 2015 07:35 Go to next message
Wilbert Alberts is currently offline Wilbert AlbertsFriend
Messages: 209
Registered: June 2010
Senior Member
Hi,

I defined a language called sys using the ecore facilities. This language provides means to define so called Entities which are having Typed Attributes. (Very similar to ecore/uml classes.)

I know that I can add OCL constraints at this level to add additional validation capabilities.

I would like to give this language to users. They will make models containing Entities.

However, I would like to give them the ability to also add additional constraints. For instance, if they define an Job Entity which is having a weight, they might want to add an invariant to it stating that the weight should not exceed a certain amount. This invariant is not imposed on the sys language, but on a model expressed in the sys language.

Would it be possible to use OCL for this purpose? I think that I need to map certain OCL concepts to concepts in the sys language. For instance, what are objects in the sys language and what does it mean to dereference an object.

Has such thing tried before? Are they any examples, articles or anything else that I could study?

Greetings,
Wilbert

Re: Applying OCL at models (vs metamodels) [message #1693165 is a reply to message #1692999] Wed, 22 April 2015 08:16 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

It's only software ... almost anything is possible.

More specifically I think you are looking at
https://bugs.eclipse.org/bugs/show_bug.cgi?id=457627.

Regards

Ed WIllink


On 21/04/2015 08:35, Wilbert Alberts wrote:
> Hi,
>
> I defined a language called sys using the ecore facilities. This
> language provides means to define so called Entities which are having
> Typed Attributes. (Very similar to ecore/uml classes.)
>
> I know that I can add OCL constraints at this level to add additional
> validation capabilities.
>
> I would like to give this language to users. They will make models
> containing Entities.
> However, I would like to give them the ability to also add additional
> constraints. For instance, if they define an Job Entity which is
> having a weight, they might want to add an invariant to it stating
> that the weight should not exceed a certain amount. This invariant is
> not imposed on the sys language, but on a model expressed in the sys
> language.
>
> Would it be possible to use OCL for this purpose? I think that I need
> to map certain OCL concepts to concepts in the sys language. For
> instance, what are objects in the sys language and what does it mean
> to dereference an object.
> Has such thing tried before? Are they any examples, articles or
> anything else that I could study?
>
> Greetings,
> Wilbert
>
>
Re: Applying OCL at models (vs metamodels) [message #1698815 is a reply to message #1693165] Thu, 18 June 2015 07:05 Go to previous messageGo to next message
Denis Nikiforov is currently offline Denis NikiforovFriend
Messages: 343
Registered: August 2013
Senior Member
Hi

I need to achieve a similar thing. Suppose there is an UML model with a Person class. The Person class has an age attribute.
Is it possible to define the following OCL-constraint?

import mymodel : 'MyModel.uml'

package Root

context Person
inv: age > 0

endpackage


Is it possible to edit and validate such a constraint in the Complete OCL editor?

Does Eclipse OCL support a simillar scenario for Ecore-based model instances? For example I created an mydsl.ecore model. Is it possible to define constraints on the M1 layer (somemodel.mydsl) instead of M2 layer (mydsl.ecore)?
Re: Applying OCL at models (vs metamodels) [message #1698816 is a reply to message #1698815] Thu, 18 June 2015 07:19 Go to previous message
Denis Nikiforov is currently offline Denis NikiforovFriend
Messages: 343
Registered: August 2013
Senior Member
Sorry for stupid question Smile At least for UML it works fine Smile
Previous Topic:Access unnavigable opposites of reference and composition relations in Ecore
Next Topic:How to import an UML element into a pivot model?
Goto Forum:
  


Current Time: Tue Mar 19 09:56:25 GMT 2024

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

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

Back to the top