illegal operation signature [message #898097] |
Wed, 25 July 2012 15:18  |
Eclipse User |
|
|
|
Hi,
when parsing some OCL Constraints I'm faced with the following problems:
1. I have to Classes A and B defined in an UML diagram. Class A has an 0..5 association to Class B. The association at the end of class B is named "data".
The function f has the following declaration: f( x : Bag) : Set where Bag and Set stand for the OCL Collection Types.
I want to parse the following constraint:
f(A.allInstances().data)->notEmpty()
I get the following error:
illegal operation signature: (f(Bag(B))
Can anybody give me a hint what to do?
2. I changed the previous example and declared function f as follows:
f( x : Set) : Set
When parsing the constraint f(A.allInstances())->notEmpty(), the OCL Parser parses the constraint without any errors.
But if I change the constraint and use a function call like f(B.allInstances())->notEmpty() the OCL Parser raises the error:
illegal operation signature (f(Set(B))
If I leave the function call and just write: B.allInstances()->notEmpty() no error is raised.
Consequently it would mean that something is wrong with my function declaration of f. But as I said, using A.allInstances() instead of B.allInstances() works. So why doesn't it work using Class B?
Or isn't it allowed to use another class as function Parameter?
Thanks for your help!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: illegal operation signature [message #912826 is a reply to message #912503] |
Fri, 14 September 2012 04:59  |
Eclipse User |
|
|
|
Hi
Correction: even your sensible OCL is bad:
<language>English</language>
<body>value > 0</body>
is presumably an 'OCL' rather than 'English' language body. Tooling
might therefore reject it outright, or just use the tooling-specific
built-in default.
Regards
Ed Willink
On 13/09/2012 18:12, Ed Willink wrote:
> Hi
>
> You didn't identify your Eclipse versions...
>
> But on Juno it's hopeless.
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=389542 raised to allow
> legacy UML fgiles to be opened again.
>
> On Indigo you use a context entrry that doesn't exist. I've never
> seen "convert PIM to ASM".
>
> Examining the XMI, it is clear that your OCL is a mess.
>
> Some is sensible: e.g.
>
> <language>English</language>
> <body>value > 0</body>
>
> But some is meaningless however you look at it
>
> <language>English</language>
> <body>else</body>
>
> and some is a misguided use of Complete OCL rather than Essential OCL
>
> <body>context Terminal::f(x: Boolean) : Boolean
post: result =
> x</body>
>
> It is not surprising that an Essential OCL expression parser is unhappy.
>
> Regards
>
> Ed Willink
>
>
>
> On 13/09/2012 11:44, fv fv wrote:
>> Hi,
>>
>> I send you an invitation, now. In the main folder you find a pdf
>> called instructions which explains the first steps.
>>
>> Thank's!
>
|
|
|
Powered by
FUDForum. Page generated in 0.28088 seconds