Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » EVL GMF Integration
EVL GMF Integration [message #1740320] Thu, 11 August 2016 15:06 Go to next message
Wendy Wendy is currently offline Wendy WendyFriend
Messages: 21
Registered: July 2016
Junior Member
Hi,

I have followed tutorial on http://www.eclipse.org/epsilon/doc/articles/evl-gmf-integration/ there something I don't know how to do.

The step 4 A:
To do this, we switch to the Extensions tab of MANIFEST.MF and add the org.eclipse.epsilon.evl.emf.validation extension. Then we right-click it and add a new constraintBinding. In the namespaceURI field of the extension we set the value to filesystem and in the constraints field we select the validation/filesystem.evl EVL file we created in Step 3. 


I am not sure what is the namespaceURI of my GMF diagram. Where can I find it? or is it the same as the project name? which is org.eclipse.ontology.diagram?

And the constraints field is the path from the src folder of my GMF diagram?

The step 4B:
Next, we add the org.eclipse.ui.ide.markerResolution extension and below it we create two markerResolutionGenerator with the following details 
class : org.eclipse.epsilon.evl.emf.validation.EvlMarkerResolutionGenerator
markerType : org.eclipse.epsilon.eugenia.examples.filesystem.diagram.diagnostic
and 
class : org.eclipse.epsilon.evl.emf.validation.EvlMarkerResolutionGenerator
markerType : org.eclipse.emf.ecore.diagnostic


for the markerResolutionGenerator should I add it manually by code in plugin.xml? coz i didnt find it in the extension tab.

And for the markerType : org.eclipse.epsilon.eugenia.examples.filesystem.diagram.diagnostic
and should i change it to org.eclipse.ontology.diagram.diagnostic ? but i can not find it in my gmf diagram.

thx.
Re: EVL GMF Integration [message #1740324 is a reply to message #1740320] Thu, 11 August 2016 15:30 Go to previous messageGo to next message
Wendy Wendy is currently offline Wendy WendyFriend
Messages: 21
Registered: July 2016
Junior Member
My project :
org.eclipse.ontology
org.eclipse.ontology.diagram
org.eclipse.ontology.edit
org.eclipse.ontology.editor

src/custom/Validation.evl
context RDFSClass {
	constraint HasLabel {
		check : self.classLabel.isDefined()
		message : 'Unlabeled ' +self.eClass().classLabel + ' not allowed'
	}
	critique LabelStartWithCapital {
		guard : self.satisfies('HasLabel')
		check : self.classLabel.firstToUpperCase() = self.classLabel
		message : 'Class' + self.classLabel + ' should start with an upper-case letter'
		fix {
			title : 'Rename to '+ self.classLabel.firstToUpperCase()
			do {
				self.classLabel := self.classLabel.firstToUpperCase();
			}
		}
	}
}


plugin.xml
   <extension point="org.eclipse.gmf.runtime.common.ui.services.markerNavigationProviders" id="markers-navigation">
      <?gmfgen generated="true"?>
      <MarkerNavigationProvider class="ont.diagram.providers.OntMarkerNavigationProvider">
         <MarkerType name="org.eclipse.ontology.diagram.diagnostic"/>
         <Priority name="Lowest"/>
      </MarkerNavigationProvider>
   </extension>

   <extension id="diagnostic" name="Ont Plugin problems" point="org.eclipse.core.resources.markers">
      <?gmfgen generated="true"?>
      <super type="org.eclipse.core.resources.problemmarker"/>
      <super type="org.eclipse.gmf.runtime.common.ui.services.marker"/>
      <persistent value="true"/>
   </extension><extension id="validationDecoratorProvider" name="ValidationDecorations" point="org.eclipse.gmf.runtime.diagram.ui.decoratorProviders">
      <?gmfgen generated="true"?>
      <decoratorProvider class="ont.diagram.providers.OntValidationDecoratorProvider">
         <Priority name="Medium"/>
         <object class="org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart(org.eclipse.gmf.runtime.diagram.ui)" id="PRIMARY_VIEW"/>
         <context decoratorTargets="PRIMARY_VIEW"/>
      </decoratorProvider>
   </extension>
   
   <extension point="org.eclipse.epsilon.evl.emf.validation">
      <constraintsBinding
         compose="true"
         constraints="custom/Validation.evl"
         namespaceURI="org.eclipse.ontology">
      </constraintsBinding>
   </extension>
   
   <extension point="org.eclipse.ui.ide.markerResolution">
   	  <markerResolutionGenerator 
   	     class="org.eclipse.epsilon.evl.emf.validation.EvlMarkerResolutionGenerator"
   	     markertype="org.eclipse.ontology.diagram.diagnostic"/>
      <markerResolutionGenerator 
   	     class="org.eclipse.epsilon.evl.emf.validation.EvlMarkerResolutionGenerator"
   	     markertype="org.eclipse.emf.ecore.diagnostic"/>
   </extension>


I tried to create Class with lower case but the validation process does not seem to be running. And have no idea what might be wrong.
Re: EVL GMF Integration [message #1740423 is a reply to message #1740324] Fri, 12 August 2016 17:42 Go to previous messageGo to next message
Wendy Wendy is currently offline Wendy WendyFriend
Messages: 21
Registered: July 2016
Junior Member
After awhile i figured that the namespaceURI are the namespace of my ecore file. Now it all running okay.

I have this another problem now.
The Validation from EVL seem to be overlapping with EMF validation. For example, RDFSClass element that did not have any name will trigger validation from EMF constraint and the EVL constraint. while I need the EVL constraint to guard against another kind of validation.

Any idea how can i turn off the EMF validation or turn off specific EVL constraint?
Re: EVL GMF Integration [message #1740569 is a reply to message #1740423] Mon, 15 August 2016 18:24 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi,

One way around this would be to split your constraints across two files and use an "import" statement to link them.

Cheers,
Dimitris
Re: EVL GMF Integration [message #1740654 is a reply to message #1740569] Tue, 16 August 2016 16:44 Go to previous message
Wendy Wendy is currently offline Wendy WendyFriend
Messages: 21
Registered: July 2016
Junior Member
thx for the reply it works.
Previous Topic:EObject type in Epsilon
Next Topic:How to Copy a Model File?
Goto Forum:
  


Current Time: Thu Apr 25 16:39:39 GMT 2024

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

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

Back to the top