Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Re: ocl query
Re: ocl query [message #475862] Thu, 13 September 2007 14:51 Go to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Nick,

Thanks for the additional diagnostic information. I'm including the UML2
newsgroup in my reply because it looks like a problem either in the
structure of your model or in the computation of required interfaces.

Your OCL expression evidently is successfully invoking getRequireds() on
each owned port of your component, then aggregating the results into some
collection that depends on the combination of the collection kinds of
ownedPort and getRequireds() (which are both multi-valued features).

So, you can expect the same result from computing the requireds in Java
code.

Your original post indicates that each of your components' ports has a
required interface. How did you express that in your model? AFAIK, this
requires that the port's type have some kind of usage or like dependency on
the interface. But I only know as recently as UML 2.0; it's possible that
this is refined/changed in UML 2.1 (the newsgroup can help, there, I'm
sure). Possibly the diagramming tool that you are using isn't configuring
your model correctly?

I think the UML2 API is OK because, when I use Rational Software Modeler to
create a component with a port having a required interface, executing

self.ownedPort.getRequireds()

in the OCL Console example gives me the expected required interface.

Cheers,

Christian


Nick Kirtley wrote:

> Hi Christian,
>
> I hadn't read your reply in my second post.
> Sorry about not being very clear regarding problem1.
>
> Query1:
> Evaluating:
> self.ownedPort.getProvideds()
>
> Results:
> Interface update
>
> Query2:
> Evaluating:
> self.ownedPort.getRequireds()
>
> Results:
>
> I should get an Interface just as I did in query1.
> One other thing I noticed was that in the component diagram, when you
> create a provided interface from a port, that it has a line between the
> two.
> When I do the same for required there's no line.
>
> Could this have something to do with uml2 rather than ocl?
>
> Are you able to retrieve a required interface?
>
> thx again,
> nick
Re: ocl query [message #475906 is a reply to message #475862] Mon, 17 September 2007 08:47 Go to previous message
Eclipse UserFriend
Originally posted by: nickkirtley.gmail.com

Hi,

Anyone know why this isn't working?

Basically self.getProvideds() works and self.getRequireds() doesn't.
getProvideds() returns the provided interface of a port and getRequireds()
should return the required port, but I don't get a return in OCL when I
should because I do have a required interface defined.

-Nick
Re: ocl query [message #624798 is a reply to message #475862] Mon, 17 September 2007 08:47 Go to previous message
Eclipse UserFriend
Originally posted by: nickkirtley.gmail.com

Hi,

Anyone know why this isn't working?

Basically self.getProvideds() works and self.getRequireds() doesn't.
getProvideds() returns the provided interface of a port and getRequireds()
should return the required port, but I don't get a return in OCL when I
should because I do have a required interface defined.

-Nick
Previous Topic:stereotype a stereotype
Next Topic:Handle stereotypes as inheritance?
Goto Forum:
  


Current Time: Fri Mar 29 09:28:17 GMT 2024

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

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

Back to the top