Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Validation test for my GMF editor
Validation test for my GMF editor [message #639946] Thu, 18 November 2010 13:55 Go to next message
lalakis  is currently offline lalakis Friend
Messages: 48
Registered: October 2009
Member
I've sucessfully installed Epsilon under my Helios Elcipse version.I have already implemented a GMF editor without epsilon - eugenia and i want to add at my GMF editor some live validation constraints.So i follow the steps from here http://www.eclipse.org/gmt/epsilon/doc/articles/evl-gmf-inte gration/ and i made a simple constraint which asserts a hasvalue constraint at an attribute of my an Eclass.I made a new plugin and i follow the instructions.I ialso add it at my new Eclipse configuration.Once i run the Eclipse Configuration from my .diagram plugin and i draw a model,t i can't find any "Validation" choice under any menu.
Should i do something else?
Re: Validation test for my GMF editor [message #639949 is a reply to message #639946] Thu, 18 November 2010 13:59 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi,

Have you turned validation on in your .gmfgen model (and regenerated) as
discussed in
http://www.eclipse.org/gmt/epsilon/doc/articles/evl-gmf-inte gration/? If
so, in Helios the Validation item should appear under the Edit menu
(used to be in the Diagram menu before Helios).

Cheers,
Dimitris

lalakis wrote:
> I've sucessfully installed Epsilon under my Helios Elcipse version.I
> have already implemented a GMF editor without epsilon - eugenia and i
> want to add at my GMF editor some live validation constraints.So i
> follow the steps from here
> http://www.eclipse.org/gmt/epsilon/doc/articles/evl-gmf-inte gration/ and
> i made a simple constraint which asserts a hasvalue constraint at an
> attribute of my an Eclass.I made a new plugin and i follow the
> instructions.I ialso add it at my new Eclipse configuration.Once i run
> the Eclipse Configuration from my .diagram plugin and i draw a model,t i
> can't find any "Validation" choice under any menu.
> Should i do something else?
Re: Validation test for my GMF editor [message #639957 is a reply to message #639949] Thu, 18 November 2010 14:31 Go to previous messageGo to next message
lalakis  is currently offline lalakis Friend
Messages: 48
Registered: October 2009
Member
Hi Dimitris,
Thanks for your quick response.
I just did it and i regenerated my code.
So now i am able to see the "Validate" choice under the "Edit" menu.But when i clicked it on nothing seem to happened.How could i ensure that the plugin that i made to hold the evl file is running?(I just marked the plugin at my new eclipse configuration)I am thinking that i am doing sth wrong at the 4th step of the tutorial.
I f i understood in a right manner this step should be applied at the new "valdiation" plugin.So,i created 2 extenstions of org.eclipse.ui.ide.markerResolution and then i created 2 instances of them.The class property is the same and fixed for both and the markerType for the 2nd is org.eclipse.emf.ecore.diagnostic.For the first 1 it should have sth like xyz.diagram.diagnostic.right?(if my diagram plugin has a name xyz.diagram.)
Thank you in advance
Re: Validation test for my GMF editor [message #639965 is a reply to message #639957] Thu, 18 November 2010 14:48 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi,

Have you added the org.eclipse.epsilon.evl.emf.validation extension as
well and specified the correct URI for your metamodel? If you've already
done this and it still doesn't work, could you please zip the related
projects and send them at epsilon.devs gmail com so that I can have a look?

Cheers,
Dimitris

lalakis wrote:
> Hi Dimitris,
> Thanks for your quick response.
> I just did it and i regenerated my code.
> So now i am able to see the "Validate" choice under the "Edit" menu.But
> when i clicked it on nothing seem to happened.How could i ensure that
> the plugin that i made to hold the evl file is running?(I just marked
> the plugin at my new eclipse configuration)I am thinking that i am doing
> sth wrong at the 4th step of the tutorial.
> I f i understood in a right manner this step should be applied at the
> new "valdiation" plugin.So,i created 2 extenstions of
> org.eclipse.ui.ide.markerResolution and then i created 2 instances of
> them.The class property is the same and fixed for both and the
> markerType for the 2nd is org.eclipse.emf.ecore.diagnostic.For the first
> 1 it should have sth like xyz.diagram.diagnostic.right?(if my diagram
> plugin has a name xyz.diagram.)
> Thank you in advance
Re: Validation test for my GMF editor [message #639983 is a reply to message #639965] Thu, 18 November 2010 15:37 Go to previous messageGo to next message
lalakis  is currently offline lalakis Friend
Messages: 48
Registered: October 2009
Member
Hi,
Yes,I did that.I have just sent you an email with the related projects.
Thank you
Re: Validation test for my GMF editor [message #640142 is a reply to message #639946] Fri, 19 November 2010 10:24 Go to previous messageGo to next message
lalakis  is currently offline lalakis Friend
Messages: 48
Registered: October 2009
Member
finally the code worked properly after Dimitris mentions.
I added another simple constraint for my "OutputChannel" Eclass which has an attribute called Interest

context ModelObject {

  constraint HasName {

      check : self.Name.isDefined()

      message : 'Unnamed ' + self.eClass().name + ' not allowed'

  }

}

context OutputChannel {

		constraint HasInterest{
			check : self.Interest.isDefined()
		
			message : 'Unnamed ' + self.eClass().Interest + ' not allowed'
		}
}

.But when i validate it i am getting an error :

A runtime error was raised during the evaluation of bundleresource://1290.fwk17320380:1/validation.evl : Property 'Interest' not found in object org.eclipse.emf.ecore.impl.EClassImpl@ba3bff5 [name: OutputChannel] [instanceClassName: null] [abstract: false, interface: false] (18:49)

But i see "Interest" property both in Properties view and it also defined at my ecore file.

This is also happening with a lot of other properties that i tried.
Could i get all the properties of an Eclass by evl code?To see what is happening
Re: Validation test for my GMF editor [message #640151 is a reply to message #640142] Fri, 19 November 2010 10:31 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi,

The problem appears to be coming from the "message" part of the constraint:

message : 'Unnamed ' + self.eClass().Interest + ' not allowed'

should be

message : 'Unnamed ' + self.eClass().name + ' not allowed'

Cheers,
Dimitris

lalakis wrote:
> finally the code worked properly after Dimitris mentions.
> I added another simple constraint for my "OutputChannel" Eclass which
> has an attribute called Interest
>
>
> context ModelObject {
>
> constraint HasName {
>
> check : self.Name.isDefined()
>
> message : 'Unnamed ' + self.eClass().name + ' not allowed'
>
> }
>
> }
>
> context OutputChannel {
>
> constraint HasInterest{
> check : self.Interest.isDefined()
>
> message : 'Unnamed ' + self.eClass().Interest + ' not allowed'
> }
> }
> But when i validate it i am getting an error :
>
> A runtime error was raised during the evaluation of
> bundleresource://1290.fwk17320380:1/validation.evl : Property 'Interest'
> not found in object mailto:org.eclipse.emf.ecore.impl.EClassImpl@ba3bff5
> [name: OutputChannel] [instanceClassName: null] [abstract: false,
> interface: false] (18:49)
>
> But i see "Interest" property both in Properties view and it also
> defined at my ecore file.
>
> This is also happening with a lot of other properties that i tried.
> Could i get all the properties of an Eclass by evl code?To see what is
> happening
>
Previous Topic:A Problem Deploying a Plug-in with ETL
Next Topic:How to do a tree inside a node ?
Goto Forum:
  


Current Time: Thu Apr 25 00:35:41 GMT 2024

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

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

Back to the top