Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Validation markers on diagram
Validation markers on diagram [message #1817244] Tue, 19 November 2019 08:22
Wilbert Alberts is currently offline Wilbert AlbertsFriend
Messages: 193
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





Previous Topic:Using Label Figure as decorator
Next Topic:How to replace SubDiagramDecorationDescriptorProvider class ?
Goto Forum:
  


Current Time: Mon Feb 17 00:27:21 GMT 2020

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

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

Back to the top