Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Preferences for validation in UML2
Preferences for validation in UML2 [message #1749587] Thu, 08 December 2016 12:58 Go to next message
Benoit Maggi is currently offline Benoit MaggiFriend
Messages: 126
Registered: March 2013
Location: Bordeaux, France
Senior Member
Hi,

I'm looking for a way to disable some UML's validations using preferences.

My specific need is to disable _UI_Connector_Roles_diagnostic for a SysML implementation.

The rule is defined there (I didn't found any use of preferences)
- check org.eclipse.uml2\plugins\org.eclipse.uml2.uml:
- plugin.properties
L99 : _UI_Connector_Roles_diagnostic = The owner of connector ''{0}'' must also own the connected roles.
- ConnectorOperations
L170 validateRoles

More information in this bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=472164

Thx,
Benoit
Re: Preferences for validation in UML2 [message #1749960 is a reply to message #1749587] Wed, 14 December 2016 13:45 Go to previous messageGo to next message
Christian W. Damus is currently offline Christian W. DamusFriend
Messages: 1172
Registered: July 2009
Location: Canada
Senior Member

Hi, Benoit,

The EValidator implementation (in this case, UMLValidator) that is generated by EMF doesn't look for any preferences to selectively evaluate constraints. You could filter the resulting Diagnostics, but all that you really have to distinguish them is their message, which is translatable and includes substitutions, so it's not necessarily clear how to do that.

Cheers,

Christian
Re: Preferences for validation in UML2 [message #1749971 is a reply to message #1749960] Wed, 14 December 2016 14:55 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5930
Registered: July 2009
Senior Member
Hi

When I added the safe navigation validation to OCL, I had to provide preferences to support legacy/novel behaviour. All constraints auto-generated from OCL therefore start with a severity lookup that determines the eventual severity and in the case of IGNORE suppresses evaluation. UML2 could manually and perhaps one day automatically do the same.

Regards

Ed Willink
Re: Preferences for validation in UML2 [message #1750157 is a reply to message #1749971] Fri, 16 December 2016 14:24 Go to previous messageGo to next message
Benoit Maggi is currently offline Benoit MaggiFriend
Messages: 126
Registered: March 2013
Location: Bordeaux, France
Senior Member
Hi,

Thanks for the answers, that's what I feared: no current easy solution Razz

Filtering using the message seems a no go,
I had a similar in need in Papyrus some time ago and ended by setting a more precise source in BasicDiagnostic created by EValidatorAdapter
then I filtered by the source.

Hope that preferences will come one day.

Regards,
Benoit
Re: Preferences for validation in UML2 [message #1750212 is a reply to message #1750157] Sun, 18 December 2016 14:38 Go to previous messageGo to next message
Johan Van Noten is currently offline Johan Van NotenFriend
Messages: 87
Registered: July 2009
Member
Hi,

I find the topic "preferences for validation" somewhat misleading.
The needs go beyond "preferences".

I think it is important to correctly position the use case backing this post.
Suppose a modeler/toolsmith is using Papyrus for the following use case:
* Create a domain specific language on top of papyrus: something like SysML, Papyrus-RT, or something company specific.
* As any language, it comes with additional domain concepts, some additional validations, etc
* Sometimes, even some constraint "relaxations" are required (e.g. a compliant SysML tool requires such relaxation, see http://www.omg.org/issues/issue19813.txt)

So, the use cases from a tools' perspective are in my opinion:
* Keep most of the underlying validations without change
e.g. SysML keeps most UML validations
e.g. MyOwnDSL built on top of SysML probably keeps most of SysMLs validations
* Make a underlying validation domain specific: keep the constraint without any modification, but change the message in order for it to be understandable by the domain-specific user.
* Avoid duplicate validation issues. Often a DSL complies with the underlying language, making it even stricter.
If a constraint in UML is violated, this will also violate the more specific constraint in the DSL.
With the current implementation, the user receives two validation errors, while only the strictest one would be desired.
In this case, the stricter validation should "overrule" the default one (disable it and define a new stronger one).
* Add constraints (default case, 'easy' to do)

A simple "preference" mechanism doesn't feel like the appropriate solution to these requirements, does it?

Regards,
Johan
Re: Preferences for validation in UML2 [message #1750213 is a reply to message #1750212] Sun, 18 December 2016 15:28 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5930
Registered: July 2009
Senior Member
Hi

Indeed this is a very different use case. If a UML-extending specification such as SysML violates UML constraints, it is very dubious to maintain that SysML is a UML extension.

Eventually, at the specification level the specification author's heads need to be banged together to remove the conflict. Either a too-strong UML constraint is weakened, or SysML refactoring removes the need for violation. If a real compromise is required, the troublesome Constraint can be written in terms of a virtual operation that can be overridden appropriately. cf. NamedElement::isDistinguishableFrom, Namespace::membersAreDistinguishable(), Element::mustBeOwned()

In the meantime at the tooling level, you are dealing with major developments not casual changes, so I think that adequate solutions can be found by introducing a probably hand-written UML4SysML adapter layer that overrides the UMLFactory to ensure that fixed classes are used. It may be sufficient just to override UMLValidator. With more co-operation, you can introduce the virtual operations into the UML constraints.

Regards

Ed Willink
Previous Topic:order of the ends of a binary association
Next Topic:SySML in Java
Goto Forum:
  


Current Time: Mon Jun 25 17:32:51 GMT 2018

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

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

Back to the top