Home » Modeling » OCL » Custom Evaluation Environments(Verifying Specific Instance Models)
|
Re: Custom Evaluation Environments [message #667989 is a reply to message #667983] |
Tue, 03 May 2011 08:58 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi Andreas
In the Helios release of Eclipse OCL, you can open a UML (meta-)model
with the UML (tree) editor, then using the OCL Console, you can evaluate
OCL expressions with respect to the context selected in the UML editor.
In the Indigo release of Eclipse OCL (M7 on download site yesterday),
you can use the Complete OCL (Xtext editor) to main a document to
complement a UML meta-model. Using the Xtext OCL Console you can
potentially load additional resources to participate in evaluation. The
UML support is new in M7 and bridging the UML gap is one my main
activities in the remaining time before Indigo; I certainly cannot
promise that it has been thoroughly exercised.
EMF does not support UML instance models; you, or a tool, converts the
UML to Ecore and then you work with an Ecore instance model, which the
OCL tools support. (The Complete OCL editor for UML just does a hidden
UML to Ecore conversion.)
Constraints embedded in UML meta-models are work in progress, firstly to
use an OCL editor within for instance papayrus, and then to avoid losing
the constraints during the various conversions.
The Royal and Loyal example (installable via New->Project
Examples->OCL... on M7; broken on M6) provides a *.ocl with respect to a
*.ecore. This may give you a feel for what you can do with independent
documents. In principle just change the import *.ecore to your *.uml and
it could work.
HTH.
Regards
Ed Willink
On 03/05/2011 09:32, Andreas Graf wrote:
> Dear all,
>
> suppose I have an UML model defining a class with attributes, e.g.
> class thing { weight: int; }
>
> To specify instances for the model, I have a DSL (Xtext, Ecore), that
> references the UML-model (but is not based on the UML-meta model):
> car : thing { weight = 1500;}
> bread : thing { weight = 1;}
>
> Now I if I'd put OCL constraints on the UML model (such as self.weight
> > 0), I would like to evaluate these for my instance model.
>
> After my first research I'd guess this could be possible by writing my
> own Custom Evaluation Environments.
> I would really appreciate some feedback on
> o is this feasible?
> o what pitfalls to avoid?
> o anyone already did something similar?
>
> Best Regards,
>
> Andreas
|
|
|
Re: Custom Evaluation Environments [message #667992 is a reply to message #667989] |
Tue, 03 May 2011 09:12 |
Andreas Graf Messages: 211 Registered: July 2009 |
Senior Member |
|
|
Dear Ed,
thanks for the pointer. I will try to see if the M7 example does what I am looking for and then specify my questions more precisely
Wrt to the instance of UML models: Yes you are correct that you actually don't do instances of UML models, however, UML gives you the possibility to describe actual instances (meta-model element InstanceSpecification).
So in UML terms, what I want to achieve is to verify that the InstanceSpecifications conform to the OCL constraints of their respective classes, attributes, etc (which from the documentation seems to be supported by OCL for UML).
The difference would be, that I am not using "InstanceSpecification", but a DSL in its own resource.
Regards,
A'ndreas
Edward Willink wrote on Tue, 03 May 2011 04:58 | Hi Andreas
In the Helios release of Eclipse OCL, you can open a UML (meta-)model
with the UML (tree) editor, then using the OCL Console, you can evaluate
OCL expressions with respect to the context selected in the UML editor.
In the Indigo release of Eclipse OCL (M7 on download site yesterday),
you can use the Complete OCL (Xtext editor) to main a document to
complement a UML meta-model. Using the Xtext OCL Console you can
potentially load additional resources to participate in evaluation. The
UML support is new in M7 and bridging the UML gap is one my main
activities in the remaining time before Indigo; I certainly cannot
promise that it has been thoroughly exercised.
EMF does not support UML instance models; you, or a tool, converts the
UML to Ecore and then you work with an Ecore instance model, which the
OCL tools support. (The Complete OCL editor for UML just does a hidden
UML to Ecore conversion.)
Constraints embedded in UML meta-models are work in progress, firstly to
use an OCL editor within for instance papayrus, and then to avoid losing
the constraints during the various conversions.
The Royal and Loyal example (installable via New->Project
Examples->OCL... on M7; broken on M6) provides a *.ocl with respect to a
*.ecore. This may give you a feel for what you can do with independent
documents. In principle just change the import *.ecore to your *.uml and
it could work.
HTH.
Regards
Ed Willink
On 03/05/2011 09:32, Andreas Graf wrote:
> Dear all,
>
> suppose I have an UML model defining a class with attributes, e.g.
> class thing { weight: int; }
>
> To specify instances for the model, I have a DSL (Xtext, Ecore), that
> references the UML-model (but is not based on the UML-meta model):
> car : thing { weight = 1500;}
> bread : thing { weight = 1;}
>
> Now I if I'd put OCL constraints on the UML model (such as self.weight
> > 0), I would like to evaluate these for my instance model.
>
> After my first research I'd guess this could be possible by writing my
> own Custom Evaluation Environments.
> I would really appreciate some feedback on
> o is this feasible?
> o what pitfalls to avoid?
> o anyone already did something similar?
>
> Best Regards,
>
> Andreas
|
|
|
|
Goto Forum:
Current Time: Wed Apr 24 17:28:09 GMT 2024
Powered by FUDForum. Page generated in 0.03568 seconds
|