Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [HUTN] I can't create an instance from UML.ecore
[HUTN] I can't create an instance from UML.ecore [message #499847] Tue, 24 November 2009 11: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"
}
}


[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 Go to previous messageGo to next message
Louis Rose is currently offline 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.
Re: [HUTN] I can't create an instance from UML.ecore [message #500155 is a reply to message #499997] Wed, 25 November 2009 08: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:Question about using enumerated types!
Next Topic:[HUTN] I can't instance from UML.ecore
Goto Forum:
  


Current Time: Sun Oct 26 04:40:28 GMT 2014

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

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