Skip to main content



      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 09:54 Go to next message
Eclipse UserFriend
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 #971068 is a reply to message #971059] Sun, 04 November 2012 10:04 Go to previous messageGo to next message
Eclipse UserFriend
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 10:10 Go to previous messageGo to next message
Eclipse UserFriend
I actually tried this self->closure(oclContainer()) but it says Closure body type 'OclElement' does not conform to iterator type
Re: How to get the whole set of containers [message #971102 is a reply to message #971073] Sun, 04 November 2012 10:44 Go to previous messageGo to next message
Eclipse UserFriend
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 #971119 is a reply to message #971102] Sun, 04 November 2012 11:01 Go to previous messageGo to next message
Eclipse UserFriend
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 11:43 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: How to get the whole set of containers [message #971431 is a reply to message #971059] Sun, 04 November 2012 17:18 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: How to get the whole set of containers [message #972771 is a reply to message #971431] Mon, 05 November 2012 17:09 Go to previous message
Eclipse UserFriend
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: Tue May 13 15:22:58 EDT 2025

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

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

Back to the top