Validation markers on diagram [message #1817244] |
Tue, 19 November 2019 08:22 |
Wilbert Alberts Messages: 209 Registered: June 2010 |
Senior Member |
|
|
Hi,
I have created a java/xtend based ModelConstraint for my language. Whenever I execute 'Validate diagram' from the context menu, I can see that it is executed.
However, I'm having a hard time getting markers on the right spot on a diagram. See the image that I attached. It shows a marker on the dashed line. However, my constraint also checks the 'fields' of the Struct and DTO. Also they are in error. This is detected in my validation as is shown in the Problems view as an error.
However, for some reason the corresponding markers don't show up. What exactly is executed when I execute the 'Validate diagram' action and how can I define the elements that are involved in the error?
I implemented my model constraint by extending org.eclipse.emf.validation.constraintProviders. For this extension, I created a java class that extends AbstractModelConstraint. That class implements "IStatus validate(IValidationContext)" And for the the failing attribute, I created the IStatus result by:
val locus = newArrayList(object, object.eContainer, object.dd, object.as)
val isCompatible = CompatibilityChecker.isCompatible(tuni, ddType, asType)
val result = if (isCompatible)
context.createSuccessStatus
else
ConstraintStatus.createStatus(context, object, locus, "Types of {0} and {1} are not compatible.", object.dd, object.as)
return result
Regards,
Wilbert
|
|
|
Powered by
FUDForum. Page generated in 0.02827 seconds