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