[OCL] Unknown type error during validation [message #207996] |
Wed, 08 October 2008 03:02  |
Eclipse User |
|
|
|
Originally posted by: julien.legrand.bull.net
Hello.
I faced an OCL exception during a gmfmap file validation.
Here is the exception :
Invalid expression body 'JOnASProfile::EJB'. Cause: Invalid expression
body 'JOnASProfile::EJB'. Cause: ERROR in
(enumerationOrClassLiteralExpCS): (Unknown type ([JOnASProfile, EJB]))
This exception occurs in a Sequence Initializer of a type JOnAS defined
in a different package (and a different ecore file) than the datatype
JOnASProfile.
Do you have an idea about what i'm doing wrong ?
Thanks.
Julien
|
|
|
|
Re: [OCL] Unknown type error during validation [message #208103 is a reply to message #208097] |
Wed, 08 October 2008 10:54   |
Eclipse User |
|
|
|
Originally posted by: julien.legrand.bull.net
Hi Christian,
JOnASProfile::EJB is actually an enumeration literal. JOnASProfile is
contained in the EPackage named "jonas".
The Eclass on which I want to apply the OCL constraint is in the
EPackage named "jonas4".
I try to replace JOnASProfile::EJB with jonas::JOnASProfile::EJB,
without success.
I also try to use Java package name instead of the EPackage name but
result was the same.
Any idea about what i'm doing wrong ?
Thanks.
Julien
Christian W. Damus a écrit :
> Hi, Julien,
>
> Is JOnASProfile::EJB an enumeration literal? If so, then in will be in
> some EPackage, which you must include in a qualified-name reference. If
> JOnASProfile isn't in the same EPackage as the context EClass of your
> OCL constraint, then you must fully qualify the reference. e.g.,
> otherpackage::JOnASProfile::EJB
>
> HTH,
>
> Christian
>
> Julien Legrand wrote:
>> Hello.
>>
>> I faced an OCL exception during a gmfmap file validation.
>>
>> Here is the exception :
>> Invalid expression body 'JOnASProfile::EJB'. Cause: Invalid expression
>> body 'JOnASProfile::EJB'. Cause: ERROR in
>> (enumerationOrClassLiteralExpCS): (Unknown type ([JOnASProfile, EJB]))
>>
>> This exception occurs in a Sequence Initializer of a type JOnAS
>> defined in a different package (and a different ecore file) than the
>> datatype JOnASProfile.
>>
>> Do you have an idea about what i'm doing wrong ?
>>
>> Thanks.
>>
>> Julien
|
|
|
Re: [OCL] Unknown type error during validation [message #208112 is a reply to message #208103] |
Wed, 08 October 2008 12:57  |
Eclipse User |
|
|
|
Originally posted by: cdamus.zeligsoft.com
Hi, Julien,
The name jonas::JOnASProfile::EJB is, actually, what you should use.
Is it only in validating the gmfmap model that you have this problem?
Does the constraint work when you run your editor? It should work at
run-time, with the above-named enumeration literal.
One factor that may be an issue is whether the jonas package has been
loaded in the EPackage registry by the time that this constraint is
parsed by gmfmap validation. If not, then the OCL parser will not know
how to find the package to resolve the enumeration name reference. Try
making sure that the EPackage is initialized by, for example, opening an
instance of the jonas model in your workbench.
Other than this, there may be something GMF-specific going on. This
problem has been raised a few times before, on this newsgroup. A search
for those threads may reveal something that will help you.
Cheers,
Christian
Julien Legrand wrote:
> Hi Christian,
>
> JOnASProfile::EJB is actually an enumeration literal. JOnASProfile is
> contained in the EPackage named "jonas".
>
> The Eclass on which I want to apply the OCL constraint is in the
> EPackage named "jonas4".
>
> I try to replace JOnASProfile::EJB with jonas::JOnASProfile::EJB,
> without success.
>
> I also try to use Java package name instead of the EPackage name but
> result was the same.
>
> Any idea about what i'm doing wrong ?
>
> Thanks.
>
> Julien
>
>
>
> Christian W. Damus a écrit :
>> Hi, Julien,
>>
>> Is JOnASProfile::EJB an enumeration literal? If so, then in will be
>> in some EPackage, which you must include in a qualified-name
>> reference. If JOnASProfile isn't in the same EPackage as the context
>> EClass of your OCL constraint, then you must fully qualify the
>> reference. e.g., otherpackage::JOnASProfile::EJB
>>
>> HTH,
>>
>> Christian
>>
>> Julien Legrand wrote:
>>> Hello.
>>>
>>> I faced an OCL exception during a gmfmap file validation.
>>>
>>> Here is the exception :
>>> Invalid expression body 'JOnASProfile::EJB'. Cause: Invalid
>>> expression body 'JOnASProfile::EJB'. Cause: ERROR in
>>> (enumerationOrClassLiteralExpCS): (Unknown type ([JOnASProfile, EJB]))
>>>
>>> This exception occurs in a Sequence Initializer of a type JOnAS
>>> defined in a different package (and a different ecore file) than the
>>> datatype JOnASProfile.
>>>
>>> Do you have an idea about what i'm doing wrong ?
>>>
>>> Thanks.
>>>
>>> Julien
|
|
|
Powered by
FUDForum. Page generated in 0.08280 seconds