Home » Modeling » OCL » Accessing OCL invariants from model diagram
| | | | |
Re: Accessing OCL invariants from model diagram [message #495728 is a reply to message #495530] |
Thu, 05 November 2009 20:32 |
Ed Willink Messages: 7655 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 #495791 is a reply to message #495756] |
Fri, 06 November 2009 07:10 |
Ed Willink Messages: 7655 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 11:48 |
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
|
|
|
Goto Forum:
Current Time: Sat Apr 20 03:44:00 GMT 2024
Powered by FUDForum. Page generated in 0.04022 seconds
|