CallEvent matching with class operation [message #541709] |
Tue, 22 June 2010 09:41 |
|
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 |
|
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,
|
|
|
Powered by
FUDForum. Page generated in 0.03082 seconds