Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Permanent violation of invariants after closing and opening the validated file
Permanent violation of invariants after closing and opening the validated file [message #664987] Tue, 12 April 2011 13:20 Go to next message
Steffen is currently offline Steffen
Messages: 8
Registered: December 2010
Junior Member
Hi,

I do have a problem with validating my model instances with an external constraint file.

I have written a rather large constraint in an external ocl file and am loading this constraint by using the validation adapter examples. The constraint works fine in the generated editor as it is supposed to but only as long as I work with the files that were already opened from the last start of the editor.
But as soon as I close the current file (regardless of saving it or not) and open it again, another validation always throws a warning that it violates the constraints of the ocl file, but without responding to the actual situation of the open file. I am sitting here for hours in order to solve this issue. My constraint is ok, no errors are thrown on validating or when validating the files that are already opened on starting the editor.

I am absolutely clueless what the problem could possibly be and would appreciate any form of help.

Best regards,
Steffen
Re: Permanent violation of invariants after closing and opening the validated file [message #664993 is a reply to message #664987] Tue, 12 April 2011 13:34 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4003
Registered: July 2009
Senior Member
Hi Steffen

Are you using Helios or Indigo and if so which milestone?

Which validation adapter examples?

It seems like you're probably using Indigo, so I'm afraid your bleeding
edge, but there's an excellent chance I can fix this for Indigo.

Regards

Ed Willink


On 12/04/2011 18:20, Steffen wrote:
> Hi,
>
> I do have a problem with validating my model instances with an
> external constraint file.
>
> I have written a rather large constraint in an external ocl file and
> am loading this constraint by using the validation adapter examples.
> The constraint works fine in the generated editor as it is supposed to
> but only as long as I work with the files that were already opened
> from the last start of the editor.
> But as soon as I close the current file (regardless of saving it or
> not) and open it again, another validation always throws a warning
> that it violates the constraints of the ocl file, but without
> responding to the actual situation of the open file. I am sitting here
> for hours in order to solve this issue. My constraint is ok, no errors
> are thrown on validating or when validating the files that are already
> opened on starting the editor.
>
> I am absolutely clueless what the problem could possibly be and would
> appreciate any form of help.
>
> Best regards,
> Steffen
Re: Permanent violation of invariants after closing and opening the validated file [message #664995 is a reply to message #664993] Tue, 12 April 2011 13:58 Go to previous messageGo to next message
Steffen is currently offline Steffen
Messages: 8
Registered: December 2010
Junior Member
Thanks for your reply, Ed.

I am using the latest stable versions of Helios, EMF and OCL for this, I am afraid. The adapters are the OCL example and the validation adapter example from the EMF validation framework. I adapted both slightly to my projects (i.e. customize the constraintproviders with namespaces and change the startup.java from the validation adapter example to find my packages) and then put some static constraints inside the plugin.xml of the validation adapter example and my other constraints inside an ocl file of the other adapter.

I did some heavy development on the constraints the last days until I found out about yesterday that there are some strange errors when I close the current file and open it again or another file in the editor (never did this before as I mostly checked the constraints only using a single file that was always open when I started the editor).

Could this be some sort of bug? i did not change a lot so I wonder if my models might be the problem.

Regards,
Steffen
Re: Permanent violation of invariants after closing and opening the validated file [message #665002 is a reply to message #664995] Tue, 12 April 2011 14:14 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4003
Registered: July 2009
Senior Member
Hi Steffen

The latest stable version of Helios is SR2 so no further bug fixes.

The editor for Helios was something of a rush and has been very
substantially revised for Indigo.

I wouldn't be at all surprised if there is a bug or ten; there is also
an EMF 'feature' whereby you are not allowed to change a loaded
meta-model, so exiting the editor may save and so change the meta-model,
invalidating any other application using it. You have to restart
everything to reload the meta-model.

If you can provide an 'working' project I could investigate on Helios
and more importantly check out Indigo.

Regards

Ed Willink

On 12/04/2011 18:58, Steffen wrote:
> Thanks for your reply, Ed.
>
> I am using the latest stable versions of Helios, EMF and OCL for this,
> I am afraid. The adapters are the OCL example and the validation
> adapter example from the EMF validation framework. I adapted both
> slightly to my projects (i.e. customize the constraintproviders with
> namespaces and change the startup.java from the validation adapter
> example to find my packages) and then put some static constraints
> inside the plugin.xml of the validation adapter example and my other
> constraints inside an ocl file of the other adapter.
>
> I did some heavy development on the constraints the last days until I
> found out about yesterday that there are some strange errors when I
> close the current file and open it again or another file in the editor
> (never did this before as I mostly checked the constraints only using
> a single file that was always open when I started the editor).
>
> Could this be some sort of bug? i did not change a lot so I wonder if
> my models might be the problem.
>
> Regards,
> Steffen
Re: Permanent violation of invariants after closing and opening the validated file [message #665333 is a reply to message #665002] Thu, 14 April 2011 07:19 Go to previous messageGo to next message
Steffen is currently offline Steffen
Messages: 8
Registered: December 2010
Junior Member
Hi Ed,

well, that's not so good news. But I found it working as it is supposed to be when I open the editor and work with the file that is just opened. Not very comfy but it seems enough to develop some constraints. Is there any other possibility to test my constraints against the model?

I would love to provide you with the project but right now it seems like I cannot for company issues. I will see what I can do.
One thing I found is, that the problem seems related to the .allInstances() function. After rewriting a constraint in a way that it it avoids this function it works well. Could also have to do with OclInvalid values as this was a recurring result while using this function on a set that was not fully specified and where I treid to apply other functions on empty sets or null values.

Best regards,
Steffen
Re: Permanent violation of invariants after closing and opening the validated file [message #665449 is a reply to message #665333] Thu, 14 April 2011 12:06 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4003
Registered: July 2009
Senior Member
Hi Steffen

I'm afraid I cannot offer you more advice because your 'that', 'it',
'working' are all without clear context. Before I was guessing at what
doesn't work, now it's no clearer.

Also without eaxmples of what does/doesnm;t work, it's hard. You can
send me a project in confidence if it helps.

Regards

Ed Willink

On 14/04/2011 12:19, Steffen wrote:
> Hi Ed,
>
> well, that's not so good news. But I found it working as it is
> supposed to be when I open the editor and work with the file that is
> just opened. Not very comfy but it seems enough to develop some
> constraints. Is there any other possibility to test my constraints
> against the model?
>
> I would love to provide you with the project but right now it seems
> like I cannot for company issues. I will see what I can do. One thing
> I found is, that the problem seems related to the .allInstances()
> function. After rewriting a constraint in a way that it it avoids this
> function it works well. Could also have to do with OclInvalid values
> as this was a recurring result while using this function on a set that
> was not fully specified and where I treid to apply other functions on
> empty sets or null values.
>
> Best regards,
> Steffen
Previous Topic:Re: model query
Next Topic:[Complete OCL] Change OCL file for validation per editor instance?
Goto Forum:
  


Current Time: Sat Jul 26 01:17:34 EDT 2014

Powered by FUDForum. Page generated in 0.06472 seconds