Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » GMT (Generative Modeling Technologies) » [MOFScript] Multiple nsURIs in metamodel breaks things?
[MOFScript] Multiple nsURIs in metamodel breaks things? [message #606577] Mon, 13 August 2007 17:41
Eclipse UserFriend
Originally posted by:

Hello all,

I've been looking at MOFScript for only about an hour now, so pardon me
if I'm missing something obvious.

I'm hoping to write a MOFScript spec to generate some code from a UML
1.4 model created in ArgoUML. ArgoUML (as I'm sure you know) serializes
its models to XMI by way of MDR. Happily, I found that the Acceleo
Eclipse plugin has provided an Ecore implementation of UML 1.4 and a
converter to take MDR-based UML 1.4 to EMF-based UML 1.4 models.

Unfortunately, I ran into trouble straight-away when trying to generate
code from a converted model using MOFScript. When I try to compile the
following MOFScript:

texttransformation ExampleTransformation (in
uml:"") {

uml.Class::main () {

I receive the following output from the compiler:
## Compiling 'broken2.m2t' (Using repository path:
plugins/org.sintef.mofscript.editor_1.2.4/repository\metamod els)
## Parsing 'broken2.m2t'
## Finished Compiling.
## No errors
Error: MTTParseError: Undefined type for metamodel ( uml ): Class, line:
0, column: 0

This is despite having Class show up via code completion. Here's a
second transformation that might help shine further light:

texttransformation ExampleTransformation (in
uml:"") {

uml.Model::main() {
self.ownedElement->forEach(c:uml.ModelElement) {
'model element: '
self.ownedElement->forEach(c) {


This compiles without error, and produces the following output when
executed on a trivial input model with one Class and three DataTypes
nested directly under the root Model element (no packages, in other words):


Clearly something is amiss. My best guess is this: in the Ecore version
of the UML 1.4 metamodel supplied by Acceleo, different nsURIs are
supplied for the various subpackages that contain all of the UML
elements. ModelElement, for example, is in the subpackage 'core' with
nsURI "". In fact, the *only* UML
element defined in the Ecore metamodel is Model. For whatever reason,
part of the MOFScript code (the part that handles autocomplete in the
editor, for example) is OK with multiple nsURIs, and part of it (the
important part) is not.

I haven't started code-spelunking yet, but that's the next step. Could
one of the devs/users perhaps provide an explanation and/or simple
work-around, and save me the trouble of digging through the source myself?

-Matt McGill
Previous Topic:[Mofscript] The context is not found ...
Next Topic:[MOFScript] Multiple nsURIs in metamodel breaks things?
Goto Forum:

Current Time: Tue May 23 05:10:29 GMT 2017

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

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