Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » CallEvent matching with class operation
CallEvent matching with class operation [message #541709] Tue, 22 June 2010 09:41 Go to next message
pkojo is currently offline pkojoFriend
Messages: 27
Registered: October 2009
Junior Member
Hi,

I am trying to match CallEvent operations from sequence diagram to class diagram using OCL Interpreter, I run following query to do this: but got an error and tries many other possibilities but got the same error

self.ownedOperation->select(e|e->exists(e1|CallEvent.allInstances().operation= e1.name))

Error:
Cannot find operation (=(String)) for the type (Bag(Operation))

Can any one point me what should I do to resolve this query.

Thanks in advance,
Re: CallEvent matching with class operation [message #541768 is a reply to message #541709] Tue, 22 June 2010 13:06 Go to previous message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi, pkojo,

The error message tells you everything that you need to know to fix this
problem.

First, it indicates that it is looking for an '=' operation accepting a
String argument. The only String-type expression that you have is
'e1.name'. So, the type in which the parser is looking for this
operation (the 'Bag(Operation)' type) must be the target of the '='
operation, that is, 'CallEvent.allInstances().operation'.

You cannot compare a Bag of Operations with a String.

So, you could instead do this:

self.ownedOperation->select(e |
e->exists(e1 |
CallEvent.allInstances().operation->includes(e)))

This will give you the owned operations of 'self' that are called by
*some* behaviour model. It won't ensure that this call is in an
Interaction (rather than, say, an Activity), nor that it is in a
particular interaction, nor *which* call event(s) call which
operation(s). It also doesn't account for inherited operations, if
that's potentially important.

HTH,

Christian

On 22/06/10 05:41 AM, pkojo wrote:
> Hi,
>
> I am trying to match CallEvent operations from sequence diagram to class
> diagram using OCL Interpreter, I run following query to do this: but got
> an error and tries many other possibilities but got the same error
>
> self.ownedOperation->select(e|e->exists(e1|CallEvent.allInstances().operation=
> e1.name))
> Error: Cannot find operation (=(String)) for the type (Bag(Operation))
>
> Can any one point me what should I do to resolve this query.
>
> Thanks in advance,
Previous Topic:OCL Invariant to find cycle in inheritance tree interface
Next Topic:OCL in drawing tool!!
Goto Forum:
  


Current Time: Thu Apr 25 05:54:16 GMT 2024

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

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

Back to the top