Validation not triggered in registered profile [message #1822227] |
Mon, 02 March 2020 07:38 |
jo ber Messages: 94 Registered: August 2018 |
Member |
|
|
Hi
I've created and registered a profile according to the instructions provided in https://help.eclipse.org/2019-12/index.jsp?topic=%2Forg.eclipse.papyrus.uml.diagram.profile.doc%2Ftarget%2Fgenerated-eclipse-help%2Fusers%2FgeneratingStaticProfiles.html&cp%3D73_0_1_8_5. So far so good, I can retrievet he profile in the list of registered profile and apply the stereotypes to my model.
In addition, I've created a constraint in the profile diagram. When I run the the generator, the default corresponding code is generated:
public boolean NonZeroClassIdentifier(DiagnosticChain diagnostics, Map<Object, Object> context) {
// TODO: implement this method
// -> specify the condition that violates the invariant
// -> verify the details of the diagnostic, including severity and message
// Ensure that you remove @generated or mark it @generated NOT
if (false) {
if (diagnostics != null) {
diagnostics.add
(new BasicDiagnostic
(Diagnostic.ERROR,
MylanguageValidator.DIAGNOSTIC_SOURCE,
MylanguageValidator.MY_STEREOTYPE__NON_ZERO_CLASS_IDENTIFIER,
EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "NonZeroClassIdentifier", EObjectValidator.getObjectLabel(this, context) }),
new Object [] { this }));
}
return false;
}
return true;
}
Now, when I start in debug mode the profile plugin and set a breakpoint in the method above, and validate the model (i.e. in papyrus from the contextual on model 'validation->validate model'). The application never enter this method above which is what I would expect to happen when validating the model.
Thank you for your support.
Kind regards,
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03405 seconds