Sirius validation problemes [message #1774145] |
Wed, 11 October 2017 02:51 |
Nicholas Kong Messages: 59 Registered: July 2016 Location: China |
Member |
|
|
Hi,
I'm working on the optimization of Sirius validation to reduce the validation time.
I got confused about some parts of the validation workflow.
Blew is the code copied from org.eclipse.sirius.diagram.ui.part.ValidateAction.validate(DiagramEditPart, View).
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
private static void validate(DiagramEditPart diagramEditPart, View view) {
IFile target = getFileToMark(diagramEditPart, view);
if (target != null) {
SiriusMarkerNavigationProvider.deleteMarkers(target);
}
if (view.isSetElement()) {
final EObject element = view.getElement();
if (element != null) {
IBatchValidator validator = createBatchValidator();
IStatus status = validator.validate(element); // part1: representation validation
createMarkers(target, status, diagramEditPart);
if (element instanceof DSemanticDecorator) {
List<EObject> elementsToValidate = Lists.newArrayList();
final EObject semanticElement = ((DSemanticDecorator) element).getTarget();
elementsToValidate.add(semanticElement);
createMarkers(target, runEMFValidator(semanticElement), diagramEditPart); // part2: EMF validation
for (final EObject representationElement : AllContents.of(view.getElement(), ViewpointPackage.eINSTANCE.getDRepresentationElement())) {
elementsToValidate.addAll(((DRepresentationElement) representationElement).getSemanticElements());
}
validator.setTraversalStrategy(new ITraversalStrategy.Flat());
IStatus status2 = validator.validate(elementsToValidate); // part3: semantic validation
createMarkers(target, status2, diagramEditPart);
}
}
}
}
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
There are totally 3 parts and named as representation validation, EMF validation, semantic validation respectively in my understanding.
My confusion is in part1, it seems to validate the elements of the diagram to be validated in AIRD file.
The constraints for this are predefined in several plugins, mainly in org.eclipse.sirius.diagram.
In my test, it cost lots of time though less than part2 (EMF) and I didn't see any of error is reported.
Besides, similar confusion on part3, is it used to validate user-defined rules?
For example, aql rules defined in VSM or other rules provided by extending extension-point of the EMF validation framework.
My question is:
1) What's the purpose of part1&3 validation? Is my understanding right?
2) Since my concern is OCL constrait, is it okay to bypass this for speedup?
|
|
|
Re: Sirius validation problemes [message #1774281 is a reply to message #1774145] |
Thu, 12 October 2017 13:01 |
|
Hello
part1&3 validation 's aim is to validate the selected element, its target semantic element and all target semantic elements of its contained DDiagramElement according to rules that have been defined in the odesign
There is no particular rule for ocl constraint.
Regards
Laurent
Laurent Fasani - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Powered by
FUDForum. Page generated in 0.03366 seconds