Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » [OCL validation example] Custom messages with *.ocl file
[OCL validation example] Custom messages with *.ocl file [message #662081] Tue, 29 March 2011 08:24
Steffen is currently offline Steffen
Messages: 8
Registered: December 2010
Junior Member
Hi,

currenty I am trying to validate my model with OCL constraints following one of the tutorials that made me create the OCL validation example and then tailor it to my needs. Things are working quite fine but I have some sort of trade-off that I would like to overcome if possible:

As I can see there are 2 way to use the OCL constraints:

1. Put them directly into the plugin.xml of the validation adapter example. This enables me to customize the messages and the warning level which I find really useful. The great disadvantage here is that I can not use own functions (declared with def) as the CDATA section only contains the constraints body.

2. Put them into an external file and invoke the validation from there. Functions and everything work fine from here but now I cannot customize my error messages and get a plain "Constraint xy violated on ab" whenever a constraint is violated. Not very useful for the modeller who creates the model instance.

Is there a way to combine the advantages of both approaches, i.e. custom messages but also the full functionality of OCL? Being able to write functions would make my life much easier (especially due to several recursive possibilities) but I am yet unsure if it is worth the price of getting standardized warnings.

Have I overseen something? Thanks for your help already.
Previous Topic:Re: [mdt-ocl.dev] OCL recursive operation
Next Topic:Helios OCL Console / CompleteOCL Editor against workspace metamodels
Goto Forum:
  


Current Time: Tue Oct 21 21:48:14 GMT 2014

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

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