| Problems parsing ocl query [message #879127] |
Wed, 30 May 2012 11:08  |
Andreas Burger Messages: 14 Registered: June 2011 |
Junior Member |
|
|
Hi,
i get strange problem with the ocl parser.
I want to parse a query which uses the method getAppliedStereotypes in it. When i parse it with the OCL class i get the following error:
org.eclipse.ocl.SemanticException: Cannot find operation (getAppliedStereotype(String)) for the type ...
The context for this query is a Class so it should have this function.
The other strange thing is, if the query is executed in the interactive ocl console it works fine.
Does anybody know this error and why it raises?
Regards,
Andreas
|
|
|
|
| Re: Problems parsing ocl query [message #879414 is a reply to message #879161] |
Thu, 31 May 2012 03:26   |
Andreas Burger Messages: 14 Registered: June 2011 |
Junior Member |
|
|
Hi,
thank you for your fast respond. I added a zipped eclipse project which demonstrating the error.
It contains an uml model with MARTE and SysML stereotypes in it, a model loader class, a ocl parser class and a test class.
Running the test class the uml model will be loaded and the constraint in the uml model will be parsed.
Thank you for your support.
Regards,
Andreas
Attachment: example.zip
(Size: 891.24KB, Downloaded 64 times)
[Updated on: Thu, 31 May 2012 03:31] Report message to a moderator
|
|
|
| Re: Problems parsing ocl query [message #879634 is a reply to message #879161] |
Thu, 31 May 2012 10:59   |
Carsten Reckord Messages: 139 Registered: July 2009 |
Senior Member |
|
|
Hi,
I happened to stumble over the exact same problem just now. The issue is the
UML metamodel used by the UML OCL engine, which is loaded from
UMLResource.UML_METAMODEL_URI (pathmap://UML_METAMODELS/UML.metamodel.uml) [1].
Since UML2 4.0.0, this model no longer seems to contain the non-normative
operations like getAppliedStereotypes, hasKeyword, etc.
I was only able to find these in
platform:/plugin/org.eclipse.uml2.uml/model/UML.uml
So my questions would be:
1) Which of these models should be used by the OCL UML plugin or other
consumers of the UML metamodel?
2) If the one currently used (i.e. without those operations) is the right
one, how else can these features be accessed in OCL?
[3) What's the rationale behind removing those operations in the first place?]
Best regards,
Carsten
[1] cf. org.eclipse.ocl.uml.UMLEnvironmentFactory.getUMLMetamodel()
On 30.05.2012 18:21, Ed Willink wrote:
> Hi
>
> These obscure problems are very difficult to helop with without some detail.
>
> There are at least three relevant "Class" classes that I am aware of.
>
> There are at least three relevant "OCL" classes that I am aware of.
>
> Not knowing what you're doing, I cannot help further.
>
> I suggest a zipped project demonstrating the failure, if you want any
> chance of a prompt response.
>
> Regards
>
> Ed Willink
>
> On 30/05/2012 16:08, Andreas Burger wrote:
>> Hi,
>>
>> i get strange problem with the ocl parser.
>> I want to parse a query which uses the method getAppliedStereotypes in
>> it. When i parse it with the OCL class i get the following error:
>> org.eclipse.ocl.SemanticException: Cannot find operation
>> (getAppliedStereotype(String)) for the type ...
>> The context for this query is a Class so it should have this function.
>> The other strange thing is, if the query is executed in the
>> interactive ocl console it works fine.
>>
>> Does anybody know this error and why it raises?
>>
>> Regards,
>>
>> Andreas
>
|
|
|
|
| Re: Problems parsing ocl query [message #879697 is a reply to message #879634] |
Thu, 31 May 2012 12:57   |
Ed Willink Messages: 3159 Registered: July 2009 |
Senior Member |
|
|
Hi
Oh *****! Thanks for diagnosing this.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=381237 raised.
Regards
Ed Willink
On 31/05/2012 15:59, Carsten Reckord wrote:
> Hi,
>
> I happened to stumble over the exact same problem just now. The issue is the
> UML metamodel used by the UML OCL engine, which is loaded from
> UMLResource.UML_METAMODEL_URI (pathmap://UML_METAMODELS/UML.metamodel.uml) [1].
>
> Since UML2 4.0.0, this model no longer seems to contain the non-normative
> operations like getAppliedStereotypes, hasKeyword, etc.
>
> I was only able to find these in
> platform:/plugin/org.eclipse.uml2.uml/model/UML.uml
>
> So my questions would be:
> 1) Which of these models should be used by the OCL UML plugin or other
> consumers of the UML metamodel?
> 2) If the one currently used (i.e. without those operations) is the right
> one, how else can these features be accessed in OCL?
> [3) What's the rationale behind removing those operations in the first place?]
>
>
> Best regards,
> Carsten
>
> [1] cf. org.eclipse.ocl.uml.UMLEnvironmentFactory.getUMLMetamodel()
>
> On 30.05.2012 18:21, Ed Willink wrote:
>> Hi
>>
>> These obscure problems are very difficult to helop with without some detail.
>>
>> There are at least three relevant "Class" classes that I am aware of.
>>
>> There are at least three relevant "OCL" classes that I am aware of.
>>
>> Not knowing what you're doing, I cannot help further.
>>
>> I suggest a zipped project demonstrating the failure, if you want any
>> chance of a prompt response.
>>
>> Regards
>>
>> Ed Willink
>>
>> On 30/05/2012 16:08, Andreas Burger wrote:
>>> Hi,
>>>
>>> i get strange problem with the ocl parser.
>>> I want to parse a query which uses the method getAppliedStereotypes in
>>> it. When i parse it with the OCL class i get the following error:
>>> org.eclipse.ocl.SemanticException: Cannot find operation
>>> (getAppliedStereotype(String)) for the type ...
>>> The context for this query is a Class so it should have this function.
>>> The other strange thing is, if the query is executed in the
>>> interactive ocl console it works fine.
>>>
>>> Does anybody know this error and why it raises?
>>>
>>> Regards,
>>>
>>> Andreas
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01806 seconds