Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Quick fixes for CompleteOCLEObjectValidator?(How to access OCL validation issues from within the quick fix provider?)
Quick fixes for CompleteOCLEObjectValidator? [message #725268] Wed, 14 September 2011 07:47 Go to next message
Eclipse UserFriend
Hello,

I am evaluating OCL for model validation.

Thus far I have enriched the FowlerDSL example with a simple OCL check in Statemachine.ocl

import '../../../../../../src-gen/org/eclipse/xtext/example/fowlerdsl/Statemachine.ecore'

package statemachine 

	context State
	inv UniqueEvents : transitions->isUnique(event)

endpackage 


loaded by the StatemachineJavaValidator during registration

@Override
public void register(EValidatorRegistrar registrar) {
	super.register(registrar);
	StatemachinePackage ePackage = StatemachinePackage.eINSTANCE;
	URI oclURI = URI.createPlatformResourceURI("/org.eclipse.xtext.example.fowlerdsl/src/org/eclipse/xtext/example/fowlerdsl/Statemachine.ocl", true);
	registrar.register(ePackage, new CompleteOCLEObjectValidator(ePackage, oclURI));
}


This successfully leads to a warning when a state has multiple transitions with the same event.

Now I want to implement some quick fixes for that issue but failed, yet.

All the examples for *QuickfixProvider make use of the @Fix annotation. The annotation requires the issue string to match for. For the OCL validation rules I have no issue strings found, yet.

How can I implement quick fixes for OCL validation rules?

Thanks,
Jonatan
Re: Quick fixes for CompleteOCLEObjectValidator? [message #725407 is a reply to message #725268] Wed, 14 September 2011 13:23 Go to previous message
Eclipse UserFriend
Hi,

guess this is not possible since the ocl stuff does not provide somthing that extends AbstractValidationDiagnostic. maybe you can fix the ocl code or provide a own
IDiagnosticConverter that sets a code to the issues for BasicDiagnostics as
Xtext does it for AbstractValidationDiagnostics

~Christian
Previous Topic:Override Xtext editor's doSetInput() method
Next Topic:How can I define constructors in xtend class files?
Goto Forum:
  


Current Time: Thu Jul 10 07:08:04 EDT 2025

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

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

Back to the top