Skip to main content



      Home
Home » Archived » MOFScript » Recursive import?
Recursive import? [message #566108] Thu, 04 December 2008 20:46
Eclipse UserFriend
Hi,

I have a big transformation and I want to split it into different files.
For example assume the following two transformation files:

// Start of contents of file test1.m2t
import "test2.m2t"

texttransformation test1 (in uml:"http://www.eclipse.org/uml2/2.1.0/UML") {
uml.Class::main () {
self.ownedAttribute->forEach(p:uml.Property) {
p.privateProperty()
}
}
uml.Type::mapType(){
stdout.println ("Mapping types");
}
}
// End of contents of file test1.m2t


// Start of contents of file test2.m2t
import "test1.m2t"
texttransformation test2 (in uml:"http://www.eclipse.org/uml2/2.1.0/UML") {
uml.Property::privateProperty () {
self.type.mapType()
}
}
// End of contents of file test2.m2t


This compiles fine, but if I execute the transformation on a model with
class attributes I get the following runtime exception:

## Starting transformation: "test1"
#Runtime Error in FunctionCallEvaluator:# Unknown function mapType for
type org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl(line: 10)
( - Context:
test2::privateProperty::org.eclipse.mofscript.MOFScriptModel.impl.FunctionCallImpl@167e563
(line: 10, column: 4) (specification: ) (name: self.type.mapType,
isSuperCall: false)


It seems that the mapType operation cannot be found even though test1.m2t
has been imported in test2.m2t. Does the problem happen because there are
recursive imports in this example (i.e. test1.m2t imports test2.m2t and
test2.m2t imports test1.mt2)? If I put the contents of test2.m2t inside
test1.m2t the transformation works fine.

I was wondering if I am doing something wrong, or if there is any other
way to achieve what I am trying to do.

Many thanks,
Kyriakos
Previous Topic:[MOFScript] Integration
Next Topic:Recursive import?
Goto Forum:
  


Current Time: Fri Jul 04 15:00:08 EDT 2025

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

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

Back to the top