Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Validation not triggered in registered profile
Validation not triggered in registered profile [message #1822227] Mon, 02 March 2020 07:38 Go to next message
jo ber is currently offline jo berFriend
Messages: 35
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,
Re: Validation not triggered in registered profile [message #1822239 is a reply to message #1822227] Mon, 02 March 2020 10:07 Go to previous messageGo to next message
jo ber is currently offline jo berFriend
Messages: 35
Registered: August 2018
Member
update:

When I run the validation on the uml model, as shown below, the validation rule I've defined is run:
index.php/fa/37484/0/

However, when I run the validation from the contextual from papyrus, then the rule is not run:
index.php/fa/37485/0/

What should I do to have the validation applied in the second case?
  • Attachment: OK-CASE.PNG
    (Size: 30.05KB, Downloaded 98 times)
  • Attachment: KO-CASE.PNG
    (Size: 43.41KB, Downloaded 95 times)
Re: Validation not triggered in registered profile [message #1822242 is a reply to message #1822239] Mon, 02 March 2020 11:35 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6985
Registered: July 2009
Senior Member
Hi

Raise a Bugzilla. It has certainly been raised and fixed at least once in conjunction with OCL embedded in UML in Papyrus. The problem is that the neither the EValidator framework not UML is not properly extensible requiring lowrr applications to carefully re-implement a multi-evel validation. It looks as if Papyrus has insufficient test coverage to avoid backsliding on the fixes. Within Papyrus you might try the OCL->Validate option.

Regards

Ed Willink
Re: Validation not triggered in registered profile [message #1822262 is a reply to message #1822242] Mon, 02 March 2020 17:19 Go to previous message
jo ber is currently offline jo berFriend
Messages: 35
Registered: August 2018
Member
I've raised the following bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=560697
Kind regards,
Previous Topic:Get started questions about Java reverse engineering
Next Topic:Paper on meta-modeling with Papyrus
Goto Forum:
  


Current Time: Mon Jan 18 17:48:06 GMT 2021

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

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

Back to the top