Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Bug or correct behavior(Types of derived associations)
Bug or correct behavior [message #1385687] Tue, 10 June 2014 13:45 Go to next message
Wilbert Alberts is currently offline Wilbert AlbertsFriend
Messages: 209
Registered: June 2010
Senior Member
Hi,

My meta model (expressed in oclinecore) contains the following:
class CompInstance
{
	attribute name : String;
	property dependencies: Dependency[*] { ordered composes };
}

class Dependency
{
	attribute name : String;
	property provider : CompInstance[?];
}

class System
{
	property instances : CompInstance[*] { ordered composes };
	attribute name : String;
	property extdeps : Dependency[*] { derived readonly transient volatile }
	{
		derivation: 
			instances.dependencies->select(provider.oclIsUndefined())->asSet();
	}
}


Dealing with this in a graphical, sirius based, editor, I ran into problems. Exceptions were thrown indicating that the type of the extdeps property does not match the derivation body.

After some debugging I found out that the body was a Sequence type and that the type of the extdeps property expected a Set.

How did the body become a Sequence, or shouldn't extdeps not be of Sequence type? I'm a little bit lost... Or did I trigger a bug?

Greetings,
Wilbert.
Re: Bug or correct behavior [message #1385695 is a reply to message #1385687] Tue, 10 June 2014 14:26 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
HI

Works fine for me in the Luna RC4 release. But I have to guess because

you provide an incomplete repro; no package

you provide no tool versions

you provide no error text or indeed observation mechanism.

Regards

Ed Willink

On 10/06/2014 14:45, Wilbert Alberts wrote:
> class CompInstance
> {
> attribute name : String;
> property dependencies: Dependency[*] { ordered composes };
> }
>
> class Dependency
> {
> attribute name : String;
> property provider : CompInstance[?];
> }
>
> class System
> {
> property instances : CompInstance[*] { ordered composes };
> attribute name : String;
> property extdeps : Dependency[*] { derived readonly transient
> volatile }
> {
> derivation:
> instances.dependencies->select(provider.oclIsUndefined())->asSet();
> }
> }
Previous Topic:Refactor OCL statement, PrettyPrinter ignores code formatting
Next Topic:[Complete OCL] Import a core metamodel
Goto Forum:
  


Current Time: Tue Mar 19 05:51:10 GMT 2024

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

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

Back to the top