[HUTN] I can't create an instance from UML.ecore [message #499847] |
Tue, 24 November 2009 11:25 |
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"
}
}
[Updated on: Tue, 24 November 2009 11:27] Report message to a moderator
|
|
|
Re: [HUTN] I can't create an instance from UML.ecore [message #499997 is a reply to message #499847] |
Tue, 24 November 2009 16:40 |
Louis Rose Messages: 440 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.
|
|
|
|
Powered by
FUDForum. Page generated in 0.04261 seconds