Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF Live Validation (Batch mode works but Live validation doesnt)
EMF Live Validation [message #1771689] Tue, 29 August 2017 14:16 Go to next message
Kunal Chandmare is currently offline Kunal ChandmareFriend
Messages: 3
Registered: August 2017
Junior Member
Hello,

I am using Library Validation General example for the reference to develope validation plug-in to my model.

I have already added one constraint (as per the example) . It works for the batch validation (as it gives an message to wrong attribute values as per the constraint).

For live validation, it does notify the changes and also determines the client context but does not finds the constraints binding to the clientContext.

I only have one client context.

What could be the problem ?
Re: EMF Live Validation [message #1772089 is a reply to message #1771689] Tue, 05 September 2017 12:15 Go to previous messageGo to next message
Christian W. Damus is currently offline Christian W. DamusFriend
Messages: 1162
Registered: July 2009
Location: Canada
Senior Member

Hi,

Did you specify mode="Live" in your <constraintProvider> in the extension XML? Note that live constraints are also included in batch validation.

With this, you can further refine the triggering of your constraint with <event> and <customEvent> elements in the <target> specifications of your constraint provider.

HTH,

Christian
Re: EMF Live Validation [message #1773735 is a reply to message #1772089] Tue, 03 October 2017 20:03 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 246
Registered: December 2015
Senior Member
Christian, what's the point of evaluating live constraints in the batch validator? Is it to avoid having to create two separate validation rules, so that one implementation can handle both modes? I asked because I didn't previously check for the null event type in my live constraint implementations, since I assumed that specifying 'live' in the plugin.xml would make sure they're never executed in batch mode..
Re: EMF Live Validation [message #1773736 is a reply to message #1773735] Tue, 03 October 2017 20:09 Go to previous message
Christian W. Damus is currently offline Christian W. DamusFriend
Messages: 1162
Registered: July 2009
Location: Canada
Senior Member

Hi, Felix,

Yes, the idea was that batch validation shouldn't miss out any rules and the developer shouldn't have to repeat herself. The triggering event business for live validation was meant primarily to let the system find and evaluate only rules relevant to a particular edit. There are probably many better ways to do this that we've learned in the intervening fifteen years or however long it's been. In any case, the constraint is expected to understand that when there's no event, then it's running in the batch context. Of course, if it's specified in OCL or some other more abstract language, then it's a moot point.

HTH,
Christian
Previous Topic:Displaying EMF model programmatically
Next Topic:Ecore model to json using Xtext/Xtend
Goto Forum:
  


Current Time: Mon Jan 22 16:32:41 GMT 2018

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

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