Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » MOFScript » Recursive import?
Recursive import? [message #566108] Fri, 05 December 2008 01:46
No real name is currently offline No real nameFriend
Messages: 4
Registered: July 2009
Junior Member

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:"") {
uml.Class::main () {
self.ownedAttribute->forEach(p:uml.Property) {
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:"") {
uml.Property::privateProperty () {
// 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:
(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,
Previous Topic:[MOFScript] Integration
Next Topic:Recursive import?
Goto Forum:

Current Time: Fri Mar 01 18:18:30 GMT 2024

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

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

Back to the top