Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Accessing OCL invariants from model diagram
Accessing OCL invariants from model diagram [message #494788] Mon, 02 November 2009 11:31 Go to next message
Milan Milanovich is currently offline Milan Milanovich
Messages: 201
Registered: July 2009
Senior Member
Hi,

I'm building GMF application, based on some domain (data) model. User will be able to create a data model diagrams (similar to UML class diagram), and to define OCL invariants on some classes in a diagram. However, I want to connect such OCL invarants to one of my elements. E.g., Class will have -> hasInvariant property.

--
thx, Milan
Re: Accessing OCL invariants from model diagram [message #494896 is a reply to message #494788] Tue, 03 November 2009 01:52 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 3844
Registered: July 2009
Senior Member
Hi Milan

http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.validation.doc/references/examples/oclValidationExampl e.html

provides some guidance on the old way of extending validation. A better
integration is currently under development for the Heklios release, so
the examples have not been maintained recently, and so may be slightly
out of date.

Regards

Ed Willink

Milan Milanovich wrote:
> Hi,
>
> I'm building GMF application, based on some domain (data) model. User
> will be able to create a data model diagrams (similar to UML class
> diagram), and to define OCL invariants on some classes in a diagram.
> However, I want to connect such OCL invarants to one of my elements.
> E.g., Class will have -> hasInvariant property.
>
> --
> thx, Milan
Re: Accessing OCL invariants from model diagram [message #495461 is a reply to message #494896] Wed, 04 November 2009 19:03 Go to previous messageGo to next message
Milan Milanovich is currently offline Milan Milanovich
Messages: 201
Registered: July 2009
Senior Member
Dear Mr. Willink,

thank you on your answer.

I'm not sure that extending validation is a way to do this, because I do not want to validate my model. I want to connect one instance of an element from my metamodel, called Constraint to ANY OCL constraint added to each ecore class. I will do it by using GMF-based diagram.

Do you know how can I do it?

--
Thank you in advance, Milan Milanovic
Re: Accessing OCL invariants from model diagram [message #495496 is a reply to message #495461] Thu, 05 November 2009 01:07 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 3844
Registered: July 2009
Senior Member
Hi Milan

I do not understand what you want. Guessing at your meaning for ANY
gives too many possibilities to answer all of them.

Regards

Ed Willink


Milan Milanovich wrote:
> Dear Mr. Willink,
>
> thank you on your answer.
>
> I'm not sure that extending validation is a way to do this, because I do
> not want to validate my model. I want to connect one instance of an
> element from my metamodel, called Constraint to ANY OCL constraint added
> to each ecore class. I will do it by using GMF-based diagram.
>
> Do you know how can I do it?
>
> --
> Thank you in advance, Milan Milanovic
Re: Accessing OCL invariants from model diagram [message #495530 is a reply to message #495496] Thu, 05 November 2009 04:32 Go to previous messageGo to next message
Milan Milanovich is currently offline Milan Milanovich
Messages: 201
Registered: July 2009
Senior Member
Dear Mr. Willink,

I will try to describe this in more detail. I have OCL constraints on my ecore classes, and I want to show this on GMF diagram, i.e., to enable defining them by using diagram. Thats' one thing. Another thing is that I want to define a class in my domain metamodel, called Constraint, which will have an attribute called hasConstraint, that will be association to a OCL constraint attached to a ecore class.

--
Regards, Milan Milanovic
Re: Accessing OCL invariants from model diagram [message #495728 is a reply to message #495530] Thu, 05 November 2009 15:32 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 3844
Registered: July 2009
Senior Member
Hi Milan

You seem to be describing graphical editing problems not OCL problems.

Please ask your question on the GMF group, or just follow the GMF
tutorials for guidance on editing text.

Regards

Ed Willink.

Milan Milanovich wrote:
> Dear Mr. Willink,
>
> I will try to describe this in more detail. I have OCL constraints on my
> ecore classes, and I want to show this on GMF diagram, i.e., to enable
> defining them by using diagram. Thats' one thing. Another thing is that
> I want to define a class in my domain metamodel, called Constraint,
> which will have an attribute called hasConstraint, that will be
> association to a OCL constraint attached to a ecore class.
>
> --
> Regards, Milan Milanovic
Re: Accessing OCL invariants from model diagram [message #495756 is a reply to message #495728] Thu, 05 November 2009 17:09 Go to previous messageGo to next message
Milan Milanovich is currently offline Milan Milanovich
Messages: 201
Registered: July 2009
Senior Member
Dear Ed,

well, that's second part of the problem, how to represent OCL constraints on ecore class in a GMF diagram, but before that I need to find solution in plain ecore, as I sad, how to define a Constraint class in my domain metamodel, that will have one attribute (hasConstraint of OCL constraint type) which will be used to connect with OCL constraints attached to ecore classes.

--
Regards, Milan Milanovic
Re: Accessing OCL invariants from model diagram [message #495791 is a reply to message #495756] Fri, 06 November 2009 02:10 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 3844
Registered: July 2009
Senior Member
Hi Milan

I still have no idea what you want.

It seems this is what easily happens when meta-levels get confused.
You have a meta-model of a model and constraints. Your model has
constraints and you want your meta-model to have constraints. So
we have at least two different kinds of constraint.

I suggest that you provide an example diagram of what you would
like to achieve, and an example model/meta-model. Then it may be
possible for me to understand your question.

Regards

Ed Willink

Milan Milanovich wrote:
> Dear Ed,
>
> well, that's second part of the problem, how to represent OCL
> constraints on ecore class in a GMF diagram, but before that I need to
> find solution in plain ecore, as I sad, how to define a Constraint class
> in my domain metamodel, that will have one attribute (hasConstraint of
> OCL constraint type) which will be used to connect with OCL constraints
> attached to ecore classes.
>
> --
> Regards, Milan Milanovic
Re: Accessing OCL invariants from model diagram [message #495841 is a reply to message #495791] Fri, 06 November 2009 06:48 Go to previous message
Milan Milanovich is currently offline Milan Milanovich
Messages: 201
Registered: July 2009
Senior Member
Dear Ed,

actually, all is on the model level, except Constraint class which is defined on a metamodel level. I will try to explain this in an example, let's say we have class Person:

class Person {
string name;
string socialSecNum;
etc....

EAnnotation invariant[*]; <- here is your OCL constraints in ecore (is this correct ?)
}

I want to define a new class called Constraint, like this:

class Constraint {
EAnnotation invariant; <- this will be used to connect to the Person invariants.
}

So, in later in my GMF diagran, I will have multiple Person class instances and OCL invariants defined on those instances, but also, in the same diagram I will have some Constraint class instances, that will be used to link to OCL invariants defined on the Person class instances.

--
Regards, Milan Milanovic
Previous Topic:Parser for OCL file with constraints
Next Topic:OCL query for Coupling between Object
Goto Forum:
  


Current Time: Mon Apr 21 05:47:47 EDT 2014

Powered by FUDForum. Page generated in 0.01855 seconds