[OCLinEcore] Resolving attributes in OCL Constraints [message #551134] |
Thu, 05 August 2010 07:26  |
Eclipse User |
|
|
|
Hi,
I have a problem with the OCLinEcore-Editor. The editor is not able to resolve attributes in OCL Constraints if the attribute is specified in a different package than the OCL Constraint.
I attached two examples:
-----WORKING EXAMPLE----------------------------------------------------------------------
-- This is the working example.
------------------------------------------------------------------------------------------
import ecore : 'http://www.eclipse.org/emf/2002/Ecore#/';
package tutorial : tut = 'http://www.eclipse.org/mdt/ocl/oclinecore/tutorial'
{
class NamedElement
{
attribute name : String;
}
class Parameter extends NamedElement
{
property _'signature'#parameters : Signature[1];
}
class Signature
{
invariant parameterMustHaveUniqueNames: self.parameters->isUnique(p:Parameter | p.name);
property parameters#_'signature' : Parameter[0..*] { composes };
}
}
-----NOT WORKING----------------------------------------------------------------------
-- This does not work. The reference p.name in the OCL constraint cannot be resolved.
-- For 'name', the OCLinEcore Editor shows the following error:
-- "Couldn't resolve reference to NamedElementCS 'name'".
------------------------------------------------------------------------------------------
import ecore : 'http://www.eclipse.org/emf/2002/Ecore#/';
package tutorial : tut = 'http://www.eclipse.org/mdt/ocl/oclinecore/tutorial'
{
package core : cre = 'http://www.eclipse.org/mdt/ocl/oclinecore/tutorial/core' {
class NamedElement
{
attribute name : String;
}
}
class Parameter extends core::NamedElement
{
property _'signature'#parameters : Signature[1];
}
class Signature
{
invariant parameterMustHaveUniqueNames: self.parameters->isUnique(p:Parameter | p.name);
property parameters#_'signature' : Parameter[0..*] { composes };
}
}
(If these examples are copied to a bugzilla bug report, I would be really glad if my email address is NOT cited....)
Thank you very much!
Kind Regards.
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.10909 seconds