Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » How to get the whole set of containers
How to get the whole set of containers [message #971059] Sun, 04 November 2012 14:54 Go to next message
Andrea Sindico is currently offline Andrea SindicoFriend
Messages: 266
Registered: November 2010
Senior Member

I'd like to get the whole set of containers for an object.
i.e. {self.oclContainer(); self.oclContainer().oclContainer(); self.oclContainer().oclContainer().oclContainer(); etc.}

What is the right way to do that?

Thank you

Regards


Follow me on Twitter @andreasindico

Re: How to get the whole set of containers [message #971068 is a reply to message #971059] Sun, 04 November 2012 15:04 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
HI

Have you looked at the closure() iteration?

Regards

Ed Willink

On 04/11/2012 14:54, Andrea Sindico wrote:
> I'd like to get the whole set of containers for an object. i.e.
> {self.oclContainer(); self.oclContainer().oclContainer();
> self.oclContainer().oclContainer().oclContainer(); etc.}
>
> What is the right way to do that?
>
> Thank you
> Regards
Re: How to get the whole set of containers [message #971073 is a reply to message #971068] Sun, 04 November 2012 15:10 Go to previous messageGo to next message
Andrea Sindico is currently offline Andrea SindicoFriend
Messages: 266
Registered: November 2010
Senior Member

I actually tried this self->closure(oclContainer()) but it says Closure body type 'OclElement' does not conform to iterator type

Follow me on Twitter @andreasindico

Re: How to get the whole set of containers [message #971102 is a reply to message #971073] Sun, 04 November 2012 15:44 Go to previous messageGo to next message
Andrea Sindico is currently offline Andrea SindicoFriend
Messages: 266
Registered: November 2010
Senior Member

Ok for those who may have the same question the answer is

self.oclAsType(OclElement)->closure(oclContainer())


Follow me on Twitter @andreasindico

Re: How to get the whole set of containers [message #971119 is a reply to message #971102] Sun, 04 November 2012 16:01 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Good workaround. I don't think you should need it though.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=393509 raised.

Regards

Ed Willink


On 04/11/2012 15:44, Andrea Sindico wrote:
> Ok for those who may have the same question the answer is
>
> self.oclAsType(OclElement)->closure(oclContainer())
>
Re: How to get the whole set of containers [message #971150 is a reply to message #971119] Sun, 04 November 2012 16:43 Go to previous messageGo to next message
Andrea Sindico is currently offline Andrea SindicoFriend
Messages: 266
Registered: November 2010
Senior Member

Thanks Ed,
just to provide a complete answer, in case you need to use that in a complete ocl file the ocl namespace is needed

self.oclAsType(ocl::OclElement)->closure(oclContainer())

Regards


Follow me on Twitter @andreasindico

Re: How to get the whole set of containers [message #971431 is a reply to message #971059] Sun, 04 November 2012 22:18 Go to previous messageGo to next message
Andrea Sindico is currently offline Andrea SindicoFriend
Messages: 266
Registered: November 2010
Senior Member

Ed it seems that when using Complete OCL to validate an XText language as you explained in http://www.slideshare.net/EdWillink/, if I create a <<definition>> Constraint (i.e. def:) initialized with an attribute retrieved after a closure (eventually filtered to just get one object) I get strange errors in the XText editor.

Follow me on Twitter @andreasindico

Re: How to get the whole set of containers [message #972771 is a reply to message #971431] Mon, 05 November 2012 22:09 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Not nearly enough detail to be able to comment.

Regards

Ed Willink

On 04/11/2012 22:18, Andrea Sindico wrote:
> Ed it seems that when using Complete OCL to validate an XText language
> as you explained in http://www.slideshare.net/EdWillink/, if I create
> a <<definition>> Constraint (i.e. def:) initialized with an attribute
> retrieved after a closure (eventually filtered to just get one object)
> I get strange errors in the XText editor.
Previous Topic:OCL editor
Next Topic:enriching code with ocl
Goto Forum:
  


Current Time: Thu Apr 25 18:50:39 GMT 2024

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

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

Back to the top