Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » Problem with Interactive OCL Console used with Sample Ecore Editor
Problem with Interactive OCL Console used with Sample Ecore Editor [message #68509] |
Mon, 22 January 2007 16:27 |
Eclipse User |
|
|
|
Originally posted by: markus.herrmannsdoerfer.bmw-carit.de
Hi,
I am using the Interactive OCL Console to check whether constraints on
an Ecore model are valid or not.
When I select an element of type EClass as context object and execute
the constraint
self.name
then I get the following result:
ERROR in (variableExpCS): (Unrecognized variable: (name))
However, when executing the same constraint on an element of type
EPackage as context, the result is the name of the package.
This problem exists for all structural features of element of type EClass.
Am I doing something wrong or is this a bug?
By the way, I am using Eclipse 3.2.1, EMF 2.2.0 and EMFT OCL 1.0.1.
Thanks in advance.
Markus Herrmannsdörfer
|
|
|
Re: Problem with Interactive OCL Console used with Sample Ecore Editor [message #68753 is a reply to message #68509] |
Mon, 22 January 2007 22:15 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Markus,
Yes, this is a bug in the example. It is accidentally crossing meta-levels,
interpreting the selected EClass as the EClass of a selected element, not
as a selected element in its own right.
If you tweak the OCLConsolePage::evaluate() method to do
helper.setContext(context.eClass())
instead of
helper.setContext(context)
then you should be OK.
HTH,
Christian
Markus Herrmannsdoerfer wrote:
> Hi,
>
> I am using the Interactive OCL Console to check whether constraints on
> an Ecore model are valid or not.
>
> When I select an element of type EClass as context object and execute
> the constraint
>
> self.name
>
> then I get the following result:
>
> ERROR in (variableExpCS): (Unrecognized variable: (name))
>
> However, when executing the same constraint on an element of type
> EPackage as context, the result is the name of the package.
> This problem exists for all structural features of element of type EClass.
>
> Am I doing something wrong or is this a bug?
> By the way, I am using Eclipse 3.2.1, EMF 2.2.0 and EMFT OCL 1.0.1.
> Thanks in advance.
>
> Markus Herrmannsdörfer
|
|
|
Re: Problem with Interactive OCL Console used with Sample Ecore Editor [message #68774 is a reply to message #68753] |
Mon, 22 January 2007 22:17 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Oh, and I should mention also that this is a question for the OCL newsgroup,
in its new home in the Eclipse Modeling Project:
eclipse.modeling.mdt.ocl
Christian
Christian W. Damus wrote:
>
> Hi, Markus,
>
> Yes, this is a bug in the example. It is accidentally crossing
> meta-levels, interpreting the selected EClass as the EClass of a selected
> element, not as a selected element in its own right.
>
> If you tweak the OCLConsolePage::evaluate() method to do
>
> helper.setContext(context.eClass())
>
> instead of
>
> helper.setContext(context)
>
> then you should be OK.
>
> HTH,
>
> Christian
>
>
> Markus Herrmannsdoerfer wrote:
>
>> Hi,
>>
>> I am using the Interactive OCL Console to check whether constraints on
>> an Ecore model are valid or not.
>>
>> When I select an element of type EClass as context object and execute
>> the constraint
>>
>> self.name
>>
>> then I get the following result:
>>
>> ERROR in (variableExpCS): (Unrecognized variable: (name))
>>
>> However, when executing the same constraint on an element of type
>> EPackage as context, the result is the name of the package.
>> This problem exists for all structural features of element of type
>> EClass.
>>
>> Am I doing something wrong or is this a bug?
>> By the way, I am using Eclipse 3.2.1, EMF 2.2.0 and EMFT OCL 1.0.1.
>> Thanks in advance.
>>
>> Markus Herrmannsdörfer
|
|
|
Re: Problem with Interactive OCL Console used with Sample Ecore Editor [message #601543 is a reply to message #68509] |
Mon, 22 January 2007 22:15 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Markus,
Yes, this is a bug in the example. It is accidentally crossing meta-levels,
interpreting the selected EClass as the EClass of a selected element, not
as a selected element in its own right.
If you tweak the OCLConsolePage::evaluate() method to do
helper.setContext(context.eClass())
instead of
helper.setContext(context)
then you should be OK.
HTH,
Christian
Markus Herrmannsdoerfer wrote:
> Hi,
>
> I am using the Interactive OCL Console to check whether constraints on
> an Ecore model are valid or not.
>
> When I select an element of type EClass as context object and execute
> the constraint
>
> self.name
>
> then I get the following result:
>
> ERROR in (variableExpCS): (Unrecognized variable: (name))
>
> However, when executing the same constraint on an element of type
> EPackage as context, the result is the name of the package.
> This problem exists for all structural features of element of type EClass.
>
> Am I doing something wrong or is this a bug?
> By the way, I am using Eclipse 3.2.1, EMF 2.2.0 and EMFT OCL 1.0.1.
> Thanks in advance.
>
> Markus Herrmannsdörfer
|
|
|
Re: Problem with Interactive OCL Console used with Sample Ecore Editor [message #601553 is a reply to message #68753] |
Mon, 22 January 2007 22:17 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Oh, and I should mention also that this is a question for the OCL newsgroup,
in its new home in the Eclipse Modeling Project:
eclipse.modeling.mdt.ocl
Christian
Christian W. Damus wrote:
>
> Hi, Markus,
>
> Yes, this is a bug in the example. It is accidentally crossing
> meta-levels, interpreting the selected EClass as the EClass of a selected
> element, not as a selected element in its own right.
>
> If you tweak the OCLConsolePage::evaluate() method to do
>
> helper.setContext(context.eClass())
>
> instead of
>
> helper.setContext(context)
>
> then you should be OK.
>
> HTH,
>
> Christian
>
>
> Markus Herrmannsdoerfer wrote:
>
>> Hi,
>>
>> I am using the Interactive OCL Console to check whether constraints on
>> an Ecore model are valid or not.
>>
>> When I select an element of type EClass as context object and execute
>> the constraint
>>
>> self.name
>>
>> then I get the following result:
>>
>> ERROR in (variableExpCS): (Unrecognized variable: (name))
>>
>> However, when executing the same constraint on an element of type
>> EPackage as context, the result is the name of the package.
>> This problem exists for all structural features of element of type
>> EClass.
>>
>> Am I doing something wrong or is this a bug?
>> By the way, I am using Eclipse 3.2.1, EMF 2.2.0 and EMFT OCL 1.0.1.
>> Thanks in advance.
>>
>> Markus Herrmannsdörfer
|
|
|
Goto Forum:
Current Time: Sat May 04 16:07:41 GMT 2024
Powered by FUDForum. Page generated in 0.03018 seconds
|