|[OCL validation example] Custom messages with *.ocl file [message #662081]
||Tue, 29 March 2011 08:24
Registered: December 2010
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.
Powered by FUDForum
. Page generated in 0.05040 seconds