Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Save resource with validation
Save resource with validation [message #125573] Tue, 10 June 2008 00:55 Go to next message
Yigal Spinner is currently offline Yigal SpinnerFriend
Messages: 109
Registered: July 2009
Senior Member
I have an eCore model that has massive validation implemented with it.
When I create a new object and add it to a resource, when I save the
resource the validation is fired and the object is checked.
However, if I continue to change the same object and set invalid values
in the attributes, the next time I save the same resource, the
validation is not fired.

What do I need to do to make sure the validation is fire every time I
save the resource?

Thanks
Yigal
Re: Save resource with validation [message #125588 is a reply to message #125573] Tue, 10 June 2008 06:56 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Yigal,
When doing resource.save the system should end up in the StoreResource.validateContents methods. Can
you check that this indeed happens? There the list of newOrChangedObjects is created. Your changed
object should be in there.
Maybe you have to do: resource.setTrackingModification(true) beforehand (guessing a bit here)?

gr. Martin

Yigal wrote:
> I have an eCore model that has massive validation implemented with it.
> When I create a new object and add it to a resource, when I save the
> resource the validation is fired and the object is checked.
> However, if I continue to change the same object and set invalid values
> in the attributes, the next time I save the same resource, the
> validation is not fired.
>
> What do I need to do to make sure the validation is fire every time I
> save the resource?
>
> Thanks
> Yigal


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Save resource with validation [message #619226 is a reply to message #125573] Tue, 10 June 2008 06:56 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Yigal,
When doing resource.save the system should end up in the StoreResource.validateContents methods. Can
you check that this indeed happens? There the list of newOrChangedObjects is created. Your changed
object should be in there.
Maybe you have to do: resource.setTrackingModification(true) beforehand (guessing a bit here)?

gr. Martin

Yigal wrote:
> I have an eCore model that has massive validation implemented with it.
> When I create a new object and add it to a resource, when I save the
> resource the validation is fired and the object is checked.
> However, if I continue to change the same object and set invalid values
> in the attributes, the next time I save the same resource, the
> validation is not fired.
>
> What do I need to do to make sure the validation is fire every time I
> save the resource?
>
> Thanks
> Yigal


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:Save resource with validation
Next Topic:[Teneo] JMX MBean and class loading issues
Goto Forum:
  


Current Time: Tue Mar 31 03:06:51 GMT 2020

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

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

Back to the top