Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » GMF/OCL Bug?
GMF/OCL Bug? [message #55340] Fri, 09 May 2008 15:49 Go to next message
Eclipse UserFriend
Originally posted by: vineet.architexa.com

Hi,
I am trying to setup an OCL constraint in the GMF Map and am getting an
error when trying to validate or generate code using it. This constraint
does work in the OCL interpreter:
> self.connectorType = metadata::ConnectorType::Input

The Background:
in package metadata
enum ConnectorType {Input, Output}
in package graph
class Connector
property connectorType: ConnectorType
class Processor
property connectors: Connector

The constraint is on a connector, and my feeling is that the error has
to deal with accessing the other package, but the expression does return
a true when clicking on a connector and running it in the ocl interpreter.

Any help will be appreciated.

Thanks!

Regards,
Vineet
Re: GMF/OCL Bug? [message #55367 is a reply to message #55340] Fri, 09 May 2008 16:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: give.a.damus.gmail.com

Hi, Vineet,

What is the error message that you see? That should help to diagnose
the problem.

Cheers,

Christian

Vineet Sinha wrote:
> Hi,
> I am trying to setup an OCL constraint in the GMF Map and am getting an
> error when trying to validate or generate code using it. This constraint
> does work in the OCL interpreter:
>> self.connectorType = metadata::ConnectorType::Input
>
> The Background:
> in package metadata
> enum ConnectorType {Input, Output}
> in package graph
> class Connector
> property connectorType: ConnectorType
> class Processor
> property connectors: Connector
>
> The constraint is on a connector, and my feeling is that the error has
> to deal with accessing the other package, but the expression does return
> a true when clicking on a connector and running it in the ocl interpreter.
>
> Any help will be appreciated.
>
> Thanks!
>
> Regards,
> Vineet
Re: GMF/OCL Bug? [message #55394 is a reply to message #55367] Fri, 09 May 2008 17:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vineet.architexa.com

Sorry I meant to include this earlier. The error message is:
> Invalid expression body 'self.connectorType = metadata::ConnectorType::Input'. Cause: Invalid expression body 'self.connectorType = metadata::ConnectorType::Input'. Cause: ERROR in (enumerationOrClassLiteralExpCS): (Unknown type ([metadata, ConnectorType, Input]))

Thanks for looking into this!

Vineet

Christian W. Damus wrote:
> Hi, Vineet,
>
> What is the error message that you see? That should help to diagnose
> the problem.
>
> Cheers,
>
> Christian
>
> Vineet Sinha wrote:
>> Hi,
>> I am trying to setup an OCL constraint in the GMF Map and am getting
>> an error when trying to validate or generate code using it. This
>> constraint does work in the OCL interpreter:
>>> self.connectorType = metadata::ConnectorType::Input
>>
>> The Background:
>> in package metadata
>> enum ConnectorType {Input, Output}
>> in package graph
>> class Connector
>> property connectorType: ConnectorType
>> class Processor
>> property connectors: Connector
>>
>> The constraint is on a connector, and my feeling is that the error has
>> to deal with accessing the other package, but the expression does
>> return a true when clicking on a connector and running it in the ocl
>> interpreter.
>>
>> Any help will be appreciated.
>>
>> Thanks!
>>
>> Regards,
>> Vineet
Re: GMF/OCL Bug? [message #55473 is a reply to message #55394] Fri, 09 May 2008 21:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: give.a.damus.gmail.com

Hi, Vineet,

Right, this is what you had indicated: the qualified reference to your
enumeration literal cannot be resolved.

Either your metadata EPackage is not registered in the package registry
used by the OCL Environment employed by GMF for audit constraints, or it
is registered in the static package registry but resides there still as
a PackageDescriptor. Until the package is looked up in the registry by
its namespace URI (and thus the descriptor replaced by your package
instance), OCL will not be able to find the EPackage named 'metadata'

You might try debugging the

EcoreEnvironment::findPackage(List<String>, EPackage.Registry)

method to see why this qualified name isn't being resolved as you expect.

HTH,

Christian


Vineet Sinha wrote:
> Sorry I meant to include this earlier. The error message is:
>> Invalid expression body 'self.connectorType =
>> metadata::ConnectorType::Input'. Cause: Invalid expression body
>> 'self.connectorType = metadata::ConnectorType::Input'. Cause: ERROR in
>> (enumerationOrClassLiteralExpCS): (Unknown type ([metadata,
>> ConnectorType, Input]))
>
> Thanks for looking into this!
>
> Vineet
>
> Christian W. Damus wrote:
>> Hi, Vineet,
>>
>> What is the error message that you see? That should help to diagnose
>> the problem.
>>
>> Cheers,
>>
>> Christian
>>
>> Vineet Sinha wrote:
>>> Hi,
>>> I am trying to setup an OCL constraint in the GMF Map and am getting
>>> an error when trying to validate or generate code using it. This
>>> constraint does work in the OCL interpreter:
>>>> self.connectorType = metadata::ConnectorType::Input
>>>
>>> The Background:
>>> in package metadata
>>> enum ConnectorType {Input, Output}
>>> in package graph
>>> class Connector
>>> property connectorType: ConnectorType
>>> class Processor
>>> property connectors: Connector
>>>
>>> The constraint is on a connector, and my feeling is that the error
>>> has to deal with accessing the other package, but the expression does
>>> return a true when clicking on a connector and running it in the ocl
>>> interpreter.
>>>
>>> Any help will be appreciated.
>>>
>>> Thanks!
>>>
>>> Regards,
>>> Vineet
Re: GMF/OCL Bug? [message #55554 is a reply to message #55473] Mon, 12 May 2008 22:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vineet.architexa.com

Christian W. Damus wrote:
> ...
> Right, this is what you had indicated: the qualified reference to your
> enumeration literal cannot be resolved.
>
> Either your metadata EPackage is not registered in the package registry
> used by the OCL Environment employed by GMF for audit constraints, or it
> is registered in the static package registry but resides there still as
> a PackageDescriptor. Until the package is looked up in the registry by
> its namespace URI (and thus the descriptor replaced by your package
> instance), OCL will not be able to find the EPackage named 'metadata'

How would I get GMF to do the appropriate registering? As a side note, I
was able to get the constraints working using the Java option in GMF.
Perhaps GMF's integration of OCL has a bug in it?

> ...
> You might try debugging the
>
> EcoreEnvironment::findPackage(List<String>, EPackage.Registry)
>
> method to see why this qualified name isn't being resolved as you expect.

How?

Are you suggesting somehow setting up the OCL interpreter in the
development workspace (as opposed to the runtime workspace)?

Thanks!

Vineet


> Vineet Sinha wrote:
>> Sorry I meant to include this earlier. The error message is:
>>> Invalid expression body 'self.connectorType =
>>> metadata::ConnectorType::Input'. Cause: Invalid expression body
>>> 'self.connectorType = metadata::ConnectorType::Input'. Cause: ERROR
>>> in (enumerationOrClassLiteralExpCS): (Unknown type ([metadata,
>>> ConnectorType, Input]))
>>
>> Thanks for looking into this!
>>
>> Vineet
>>
>> Christian W. Damus wrote:
>>> Hi, Vineet,
>>>
>>> What is the error message that you see? That should help to diagnose
>>> the problem.
>>>
>>> Cheers,
>>>
>>> Christian
>>>
>>> Vineet Sinha wrote:
>>>> Hi,
>>>> I am trying to setup an OCL constraint in the GMF Map and am getting
>>>> an error when trying to validate or generate code using it. This
>>>> constraint does work in the OCL interpreter:
>>>>> self.connectorType = metadata::ConnectorType::Input
>>>>
>>>> The Background:
>>>> in package metadata
>>>> enum ConnectorType {Input, Output}
>>>> in package graph
>>>> class Connector
>>>> property connectorType: ConnectorType
>>>> class Processor
>>>> property connectors: Connector
>>>>
>>>> The constraint is on a connector, and my feeling is that the error
>>>> has to deal with accessing the other package, but the expression
>>>> does return a true when clicking on a connector and running it in
>>>> the ocl interpreter.
>>>>
>>>> Any help will be appreciated.
>>>>
>>>> Thanks!
>>>>
>>>> Regards,
>>>> Vineet
Re: GMF/OCL Bug? [message #55582 is a reply to message #55554] Tue, 13 May 2008 16:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Vineet Sinha wrote:
> Christian W. Damus wrote:
>> ...
>> Right, this is what you had indicated: the qualified reference to
>> your enumeration literal cannot be resolved.
>>
>> Either your metadata EPackage is not registered in the package
>> registry used by the OCL Environment employed by GMF for audit
>> constraints, or it is registered in the static package registry but
>> resides there still as a PackageDescriptor. Until the package is
>> looked up in the registry by its namespace URI (and thus the
>> descriptor replaced by your package instance), OCL will not be able to
>> find the EPackage named 'metadata'
>
> How would I get GMF to do the appropriate registering? As a side note, I
> was able to get the constraints working using the Java option in GMF.
> Perhaps GMF's integration of OCL has a bug in it?

It isn't up to GMF to register EPackages; your EMF model plug-in does
that. Note that Java code doesn't have to worry about whether the
EPackage descriptor is resolved in the registry, because it doesn't rely
on the registry to look up meta-data.


>> ...
>> You might try debugging the
>>
>> EcoreEnvironment::findPackage(List<String>, EPackage.Registry)
>>
>> method to see why this qualified name isn't being resolved as you expect.
>
> How?

Using a breakpoint in JDT's debugger. Step through the findPackage
algorithm to see what the package registry contains.


> Are you suggesting somehow setting up the OCL interpreter in the
> development workspace (as opposed to the runtime workspace)?

No. The OCL interpreter has nothing to do with it.

>
> Thanks!
>
> Vineet
>
>
>> Vineet Sinha wrote:
>>> Sorry I meant to include this earlier. The error message is:
>>>> Invalid expression body 'self.connectorType =
>>>> metadata::ConnectorType::Input'. Cause: Invalid expression body
>>>> 'self.connectorType = metadata::ConnectorType::Input'. Cause: ERROR
>>>> in (enumerationOrClassLiteralExpCS): (Unknown type ([metadata,
>>>> ConnectorType, Input]))
>>>
>>> Thanks for looking into this!
>>>
>>> Vineet
>>>
>>> Christian W. Damus wrote:
>>>> Hi, Vineet,
>>>>
>>>> What is the error message that you see? That should help to
>>>> diagnose the problem.
>>>>
>>>> Cheers,
>>>>
>>>> Christian
>>>>
>>>> Vineet Sinha wrote:
>>>>> Hi,
>>>>> I am trying to setup an OCL constraint in the GMF Map and am
>>>>> getting an error when trying to validate or generate code using it.
>>>>> This constraint does work in the OCL interpreter:
>>>>>> self.connectorType = metadata::ConnectorType::Input
>>>>>
>>>>> The Background:
>>>>> in package metadata
>>>>> enum ConnectorType {Input, Output}
>>>>> in package graph
>>>>> class Connector
>>>>> property connectorType: ConnectorType
>>>>> class Processor
>>>>> property connectors: Connector
>>>>>
>>>>> The constraint is on a connector, and my feeling is that the error
>>>>> has to deal with accessing the other package, but the expression
>>>>> does return a true when clicking on a connector and running it in
>>>>> the ocl interpreter.
>>>>>
>>>>> Any help will be appreciated.
>>>>>
>>>>> Thanks!
>>>>>
>>>>> Regards,
>>>>> Vineet
Re: GMF/OCL Bug? [message #58113 is a reply to message #55582] Tue, 10 June 2008 15:24 Go to previous message
Guillaume SOLDERA is currently offline Guillaume SOLDERAFriend
Messages: 23
Registered: July 2009
Junior Member
Hi,

I have the same problem.

I have an OCL constraint and I want to access to an enum.

This is my constraint :

self->mode = PetalsDomainMode::STANDALONE implies self->subdomains->size() = 1

and this is the error :

ERROR in (enumerationOrClassLiteralExpCS): (Unknown enumeration literal
(STANDALONE))

The 'mode' attribute is a PetalsDomainMode. This class is an enum type
implementing Enumerator.

What must I do to resolve this problem ?
Where do I add the good package in OCL Environment (if this is the
solution of course :D !) ?

Thanks !

Guillaume
Previous Topic:[Announce] MDT OCL 1.2.0RC4 is available
Next Topic:getStereotypeApplication()
Goto Forum:
  


Current Time: Sat Dec 21 16:21:24 GMT 2024

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

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

Back to the top