Hi,
i've defined some ocl constraints in my ecore metamodel and validation works but i want to personalize errors message in problems view. there is a way to do this? or it's possible to have name of constraints with space character? For example a constraint named "mustHaveName" can appear in problems view as "must have name"?
Note that the custom message and severity are an Eclipse OCL extension.
I'm not entirely comfortable with the context communication between
primary constraint and secondary message. Something may well change
before it gets proposed for inclusion in OMG OCL.
Regards
Ed Willink
On 06/12/2011 19:24, giovi wrote:
> Hi,
> i've defined some ocl constraints in my ecore metamodel and validation
> works but i want to personalize errors message in problems view. there
> is a way to do this? or it's possible to have name of constraints with
> space character? For example a constraint named "mustHaveName" can
> appear in problems view as "must have name"?
hi Edward,
Sorry for my incompetence but i can't understand where i have tu put helper you have suggested me. If i copy it in my ecore file with OClinEcore editor i receive an error...
For my validation i could only use static messages but if i use the escape character _'my message' i don't receive error but validator not use my ocl constraint and if i open Validator class i see there are a validation rule for all words in my message but without ocl expression, in this example for 'my' and 'message'
The example I gave was a def: which is a Complete OCL syntax that allows
meta-model extension.
If you're using OCLinEcore then you need to define an extra 'ordinary'
operation that is visible by inheritance or by delegation to the
invariant. (Ecore does not support static operations, so you have to
make the helper a non-static operation and provide some object as the
self of the operation.)
Regards
Ed Willink
On 08/12/2011 10:40, giovi wrote:
> hi Edward,
> Sorry for my incompetence but i can't understand where i have tu put
> helper you have suggested me. If i copy it in my ecore file with
> OClinEcore editor i receive an error...
> For my validation i could only use static messages but if i use the
> escape character _'my message' i don't receive error but validator not
> use my ocl constraint and if i open Validator class i see there are a
> validation rule for all words in my message but without ocl
> expression, in this example for 'my' and 'message'