Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [HUTN] I can't instance from UML.ecore
[HUTN] I can't instance from UML.ecore [message #583146] Tue, 24 November 2009 06:25 Go to next message
Raul  is currently offline Raul
Messages: 14
Registered: November 2009
Junior Member
Hi, I want to create an instance from model "UML.ecore" of org.eclipse.uml2.uml but it show this error:

Error: [Line: 16, Column: 8, Reason: A reference value was specified for the containment feature Package#packagedElement.]

If I change "UML.core", especifically the property "containment" = false of the Element "PackagedElement" works well.

I am working with epsilon_0.8.8 but if I work with epsilon_0.8.0 everything works well.

Anybody help me? Thanks.



This my file ".hutn"
--------------------------

@Spec {
metamodel "UML" {
nsUri: "http://www.eclipse.org/uml2/2.1.0/UML"
}
}

uml {
Model "Model1"{
name: "Model1"
viewpoint: "Model1"
nestedPackage: Package "Package1"
}

Package "Package1"{
name: "Package1"
packagedElement: Class "Class1" /* Fails Here!!!! */
}

Class "Class1"{
name: "Class1"
}
}
Re: [HUTN] I can't create an instance from UML.ecore [message #583204 is a reply to message #583146] Tue, 24 November 2009 11:40 Go to previous messageGo to next message
Louis Rose is currently offline Louis Rose
Messages: 439
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hi Raul,

It looks to me like the HUTN is slightly wrong. Try this instead:

@Spec {
metamodel "UML" {
nsUri: "http://www.eclipse.org/uml2/2.1.0/UML"
}
}

uml {
Model "Model1"{
name: "Model1"
viewpoint: "Model1"
nestedPackage: Package "Package1"
}

Package "Package1"{
name: "Package1"
packagedElement: Class "Class1"{
name: "Class1"
}
}
}

We added extra HUTN validation after Epsilon 0.8.0, which included a check to ensure that reference values aren't used in containment slots. As you mentioned, Package#packagedElement is a container, and so it must contain Class1. Notice that the HUTN above reflects the containment structure: The Class object, Class1, is now contained inside the Package object, Package1.

For reference, multiple classes can be included in a package by separating their definitions with a comma. For example:

@Spec {
metamodel "UML" {
nsUri: "http://www.eclipse.org/uml2/2.1.0/UML"
}
}

uml {
Package "Package1"{
name: "Package1"
packagedElement: Class "Class1"{
name: "Class1"
}, Class "Class2"{
name: "Class2"
}
}
}

Best,
Louis.
Re: [HUTN] I can't create an instance from UML.ecore [message #583257 is a reply to message #583204] Wed, 25 November 2009 03:40 Go to previous message
Raul  is currently offline Raul
Messages: 14
Registered: November 2009
Junior Member
Perfect!, that is it now it works correctly.

Thank you for your help.
Previous Topic:[HUTN] I can't create an instance from UML.ecore
Next Topic:How to use Native with my own Java classes?
Goto Forum:
  


Current Time: Wed Jul 23 12:15:19 EDT 2014

Powered by FUDForum. Page generated in 0.01572 seconds