|Validation menu option and OCL on UML [message #63369]
||Mon, 27 October 2008 18:17
| Alexandre Torres
Registered: July 2009
There is a plugin example on wiki:
that checks an uml model againts stereotype rules. It's pretty basic, and
to tell you the truth, full of errors (it didn't check all stereotypes,
just the first, for instance).
My question is, do I need to write this plugin ? is it not supposed to
exist already as a core component of uml2 or ocl ?
the "validate" menu of my distro (and, it appears 2 times for some odd
reason) does not check ocl constraints within a profile, am I correct?
it's becouse it's an EMF check I think, to be used with EMF-OCL plugin
constraints. Or maybe I'm doing something wrong. Any tutorial about how to
create stereotype with ocl?
I found some support with the papyrus tool, but i'm affraid it will only
work under papyrus.
Thanks for any help.
|Re: Validation menu option and OCL on UML [message #63393 is a reply to message #63369]
||Tue, 28 October 2008 13:55
Originally posted by: cdamus.zeligsoft.com|
See some replies in-line, below.
Alexandre Torres wrote:
> There is a plugin example on wiki:
> that checks an uml model againts stereotype rules. It's pretty basic,
> and to tell you the truth, full of errors (it didn't check all
> stereotypes, just the first, for instance).
Well, I don't know how well it works because I haven't tried it, but if
there are problews, then feel free to fix them! That's the Wiki way,
after all --- it's a collaborative effort. :-)
> My question is, do I need to write this plugin ? is it not supposed to
> exist already as a core component of uml2 or ocl ? the "validate" menu
The UML metamodel as implemented by the UML2 project provides a means to
place Constraint elements in a model. It also has support for
generating validation operations in your model API that evaluate OCL
constraint expressions using the Ecore environment. I don't know
whether that has been adapted to statically generated profiles; you
should ask about that on the MDT UML2 newsgroup. If it would help in
working with profiles, the UML2 folks may want to consider using the UML
environment instead of Ecore, as it has better supports some of the
constructs used with stereotypes, in particular the navigation of
association-owned ends (such as ExtensionEnds).
The OCL project simply provides the parser and interpreter technology
for applications to use. Validation is an application, and as I
mentioned, the UML2 project has a particular implementation of
validation. The EMF Validation Framework component has another
implementation of OCL-based validation. Have a look at the SDK
documentation for that component, and also the
org.eclipse.emf.validation.examples.ocl example plug-in. GMF uses this
framework in implementing OCL-defined link constraints and audit rules.
> of my distro (and, it appears 2 times for some odd reason) does not
Are both occurrences the same menu action, or do they invoke different
commands? What is your selection? The Resource object? Perhaps one of
these actions is the Validate action from WTP ...
> check ocl constraints within a profile, am I correct? it's becouse it's
> an EMF check I think, to be used with EMF-OCL plugin constraints. Or
> maybe I'm doing something wrong. Any tutorial about how to create
> stereotype with ocl?
Besides the example I mentioned above, you may want to have a look at
how MDT OCL works with stereotypes in the
org.eclipse.ocl.uml.tests.ProfilesTest JUnit class.
> I found some support with the papyrus tool, but i'm affraid it will only
> work under papyrus.
Well, I guess that depends on which OCL implementation Papyrus uses, and
whether it uses the EMF Validation Framework or some other Eclipse
validation solution. I imagine that if Papyrus doesn't already use
these APIs, they may have plans either to port to them or to provide an
extensibility solution that allows clients easily to integrate them.
Best to ask about it on the Papyrus newsgroup.
> Thanks for any help.
Powered by FUDForum
. Page generated in 0.01607 seconds