Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » The 'Property::CompatibleDefaultExpression' constraint is violated for xxxxx
The 'Property::CompatibleDefaultExpression' constraint is violated for xxxxx [message #1755185] Tue, 28 February 2017 18:05 Go to next message
Fy Za is currently offline Fy ZaFriend
Messages: 245
Registered: March 2010
Senior Member
I have this metamodel (subset)
		abstract class Entity
			property parts : Part[*|1] { ordered composes };
			property elements : Element[*|1] { ordered derived readonly }
               class Part
			property element : Element[1];

When I added

I warning is appeared


The 'Property::CompatibleDefaultExpression' constraint is violated
for 'dsm::Entity::elements'

Why this warning appears? any suggestion?

Re: The 'Property::CompatibleDefaultExpression' constraint is violated for xxxxx [message #1755187 is a reply to message #1755185] Tue, 28 February 2017 18:57 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7665
Registered: July 2009
Senior Member

Difficult to be sure without a repro, but almost certainly

The 'Property::CompatibleDefaultExpression' constraint is violated

i.e. initial: is not compatible with property element : Element[1]

which looks rather likely since I suspect that is an implicit collect:>collect(element) and so a Bag.

Try using the editor hovertext which will tell you what the types are.


Ed Willink
Previous Topic:How to integrating OCL expressions in DSL grammar (Xtext project ) ?
Next Topic:Validation Problems of OCL Constraints contained in a static UML Profile
Goto Forum:

Current Time: Tue Jul 23 13:53:42 GMT 2024

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

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

Back to the top