Quick fixes for CompleteOCLEObjectValidator? [message #725268] |
Wed, 14 September 2011 07:47  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.05456 seconds