Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Enabling Ecore OCL Constraints in GMF gmfgen
Enabling Ecore OCL Constraints in GMF gmfgen [message #43798] Tue, 08 August 2006 06:01 Go to next message
Madanagopal is currently offline MadanagopalFriend
Messages: 39
Registered: July 2009
Member
Hello,

How can i point my GMF's gmfgen to invoke the OCL annotations that are
implemented as per in the paper
http://www.eclipse.org/articles/Article-EMF-Codegen-with-OCL /article.html.

I have gathered news from the groups that Constraints generated in Ecore
level can be invoked by the GMF's gmfgen. But OCL constraints doesnt seem
to work for me.

Can you please shed some more light on this topic.

I do like to validate my model at Ecore level by having some OCL
constraints for few classes whose functionality can also be achieved with
Audit Rules.

An Example would be most welcome. :)

Regards,
Madanagopal.

Thank you Radek for your long mail. Before you can point me further; allow
me to tell you wat i probable wish to do with Ecore Constraints.

Generally, GMF Audits and Link Mapping are the way to enforce OCL
Constraints. I am interested to have OCL Constraints in Ecore level itself
so that my model can be validated at this level and further i can
implement the Constraints with Link Mapping.

What made me think this is possible:?
1. Since EMF has the inbuilt support for GMF and EMF Ecore editor can
take OCL constraint as annotations with reference to

2. And with the generated <package>Validator.java that contains the OCL
Annotations, Can this be referenced to the gmfgen for model validation.
3. The above referenced link has got templates which help in generating
the validation code for our model.

An example with the Constraints at Ecore level for GMF would be really
helpful. Please post in your suggestions.

Please find my ecore file attached with this mail.

Regards,
Madanagopal
Re: Enabling Ecore OCL Constraints in GMF gmfgen [message #43861 is a reply to message #43798] Tue, 08 August 2006 13:41 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Madanagopal,

As Radek indicated in the GMF newsgroup, following the approach outlined in
this article will make your OCL constraints available in the generated
EValidator. AFAIK, this is entirely unrelated to GMF's mapping models and
code generation because GMF does not customize the generation of the domain
model. The article provides a fully functional example.

Radek also mentioned that the EMFT Validation component could be used to
evaluate OCL-defined constraints. In fact, in some ways, this is a simpler
approach than the code generation approach of the article. It would be
very straight-forward to implement an IConstraintProvider that, when asked
for the constraints applicable to an EObject, introspects that EObject's
EClass for annotations defining OCL invariant constraints. The constraint
provider could parse those constraints and cache them in IModelConstraint
objects, much as the OCLConstraintParser does (in the
org.eclipse.emf.validation.ocl plug-in), creating OCLModelConstraints from
expressions in the XML extension point.

HTH,

Christian


Madanagopal wrote:

> Hello,
>
> How can i point my GMF's gmfgen to invoke the OCL annotations that are
> implemented as per in the paper
> http://www.eclipse.org/articles/Article-EMF-Codegen-with-OCL /article.html.
>
> I have gathered news from the groups that Constraints generated in Ecore
> level can be invoked by the GMF's gmfgen. But OCL constraints doesnt seem
> to work for me.
>
> Can you please shed some more light on this topic.
>
> I do like to validate my model at Ecore level by having some OCL
> constraints for few classes whose functionality can also be achieved with
> Audit Rules.
>
> An Example would be most welcome. :)
>
> Regards,
> Madanagopal.
Re: Enabling Ecore OCL Constraints in GMF gmfgen [message #584703 is a reply to message #43798] Tue, 08 August 2006 13:41 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Madanagopal,

As Radek indicated in the GMF newsgroup, following the approach outlined in
this article will make your OCL constraints available in the generated
EValidator. AFAIK, this is entirely unrelated to GMF's mapping models and
code generation because GMF does not customize the generation of the domain
model. The article provides a fully functional example.

Radek also mentioned that the EMFT Validation component could be used to
evaluate OCL-defined constraints. In fact, in some ways, this is a simpler
approach than the code generation approach of the article. It would be
very straight-forward to implement an IConstraintProvider that, when asked
for the constraints applicable to an EObject, introspects that EObject's
EClass for annotations defining OCL invariant constraints. The constraint
provider could parse those constraints and cache them in IModelConstraint
objects, much as the OCLConstraintParser does (in the
org.eclipse.emf.validation.ocl plug-in), creating OCLModelConstraints from
expressions in the XML extension point.

HTH,

Christian


Madanagopal wrote:

> Hello,
>
> How can i point my GMF's gmfgen to invoke the OCL annotations that are
> implemented as per in the paper
> http://www.eclipse.org/articles/Article-EMF-Codegen-with-OCL /article.html
>
> I have gathered news from the groups that Constraints generated in Ecore
> level can be invoked by the GMF's gmfgen. But OCL constraints doesnt seem
> to work for me.
>
> Can you please shed some more light on this topic.
>
> I do like to validate my model at Ecore level by having some OCL
> constraints for few classes whose functionality can also be achieved with
> Audit Rules.
>
> An Example would be most welcome. :)
>
> Regards,
> Madanagopal.
Previous Topic:regarding Conclusion to "... Model Integrity in EMF with EMFT OCL"
Next Topic:Article: Implementing Model Integrity in EMF with EMFT OCL
Goto Forum:
  


Current Time: Thu Apr 18 10:54:40 GMT 2024

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

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

Back to the top