Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » problem with programmatically transformation of multiple-file models
problem with programmatically transformation of multiple-file models [message #73193] Wed, 23 January 2008 12:14 Go to next message
Eclipse UserFriend
Originally posted by: guo.mci.sdu.dk

Hi all,

I am running the atl in my Java code using the command line code from
dennis wagelaar. I get succesfully a programmatically transformation on
the Family and Person example.

But it does not work on our models.I got the message from the command
line code that "The EMF4ATL version used does not support referenced
extents (multiple-file models)"

In our case, we have three metamodels in Ecore:
"MooreStatemachine.ecore", "MealyStatemachine.ecore" and "Action.ecore".
The metamodel in "Action.ecore" in referenced by both
"MooreStatemachine.ecore" and "MealyStatemachine.ecore".

In the side of model, we have models "action1.action", "action2.action"
which are used by model "my.moorestatemachine". We want to transform
this "my.moorestatemachine" model (with MooreStatemachine.ecore as
metamodel) to the model with MealyStatemachine.ecore as metamodel. And
both state machine models share the Action models.

We can get this transformation done when use the "Run" in Eclipse, which
means that the ATL can deal with the external referenced objects (both
metamodel and model).

Why cannot we get this done in Java code? Is it possible to transform
mutil-file models by writting Java code?


Regards,

Yu Guo


Here I list the command I use to invoke the command line tool, and the
message I got:

command line:

--trans
" file:E:\\eclipse-SDK-3.3.1.1-win32\\workspace\\StatemachineT ransform2\\MooreToMealy.asm "

--in
IN=" file:E:\\eclipse-SDK-3.3.1.1-win32\\workspace\\StatemachineT ransform2\\test\\My.moorestatemachine "

MooreStatemachine=" file:E:\\eclipse-SDK-3.3.1.1-win32\\workspace\\StatemachineM odels\\model\\MooreStatemachine.ecore "
EMF
--out
OUT=" file:E:\\eclipse-SDK-3.3.1.1-win32\\workspace\\StatemachineT ransform2\\test\\result.txt "

MealyStatemachine=" file:E:\\eclipse-SDK-3.3.1.1-win32\\workspace\\StatemachineM odels\\model\\MealyStatemachine.ecore "
EMF


message:

--trans
file:E:\\eclipse-SDK-3.3.1.1-win32\\workspace\\StatemachineT ransform2\\MooreToMealy.asm
--in
IN=file:E:\\eclipse-SDK-3.3.1.1-win32\\workspace\\Statemachi neTransform2\\test\\My.moorestatemachine

MooreStatemachine=file:E:\\eclipse-SDK-3.3.1.1-win32\\worksp ace\\StatemachineModels\\model\\MooreStatemachine.ecore
EMF Input metamodel MooreStatemachine @
org.eclipse.m2m.atl.engine.AtlEMFModelHandler@1f3aa07 not yet loaded -
loading from

file:E:\\eclipse-SDK-3.3.1.1-win32\\workspace\\StatemachineM odels\\model\\MooreStatemachine.ecore
2008-1-23 4:43:37 org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel
addReferencedExtentsFor
warning: Resource for org.eclipse.emf.ecore.impl.EClassImpl@196c1b0
(eProxyURI: StatemachineAction.ecore#//Action) is null; cannot be
referenced
2008-1-23 4:43:37 org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel
addReferencedExtentsFor
warning: Resource for org.eclipse.emf.ecore.impl.EClassImpl@196c1b0
(eProxyURI: StatemachineAction.ecore#//Action) is null; cannot be
referenced Referenced extents:
[org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl$1@1e13d52
uri='http://www.eclipse.org/emf/2002/Ecore']
Using input metamodel MooreStatemachine : MOF
Loading input model IN from
file:E:\\eclipse-SDK-3.3.1.1-win32\\workspace\\StatemachineT ransform2
\\test\\My.moorestatemachine
2008-1-23 4:43:38 org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel
loadASMEMFModel
严重: null
java.lang.NullPointerException
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFe atureType(XMLHandler.java:2022)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHa ndler.java:1900)
at
org.eclipse.emf.ecore.xmi.impl.XMIHandler.createObject(XMIHa ndler.java:131)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLH andler.java:1705)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:974)
at
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:953)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:684)
at
org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:167)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.emptyElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScanner Impl.scanStartElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown


Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScanner Impl.next(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:179)
at
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1354)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1155)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:256)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:271)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:398)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel.loadASMEMFMo del(ASMEMFModel.java:327)
at
org.eclipse.m2m.atl.engine.AtlEMFModelHandler.loadModel(AtlE MFModelHandler.java:235)
at dk.sdu.mci.seg.atl.commandline.Main.loadModel(Main.java:97)
at dk.sdu.mci.seg.atl.commandline.Main.addInputModel(Main.java: 215)
at dk.sdu.mci.seg.atl.commandline.Main.parseArgs(Main.java:144)
at dk.sdu.mci.seg.atl.commandline.Main.main(Main.java:72)
java.lang.NullPointerExceptionjava.lang.NullPointerException
at dk.sdu.mci.seg.atl.commandline.Main.addInputModel(Main.java: 216)
at dk.sdu.mci.seg.atl.commandline.Main.parseArgs(Main.java:144)
at dk.sdu.mci.seg.atl.commandline.Main.main(Main.java:72)
The EMF4ATL version used does not support referenced extents
(multiple-file models)
Usage: <this program> --trans <transformation url> [--in <id>=<model>
<id>=<metamodel> <MDR|EMF>] [--out <id>=<model>

<id>=<metamodel> <MDR|EMF>] [--lib <id>=<library url>] [--superimpose
<transformation url>] --next --trans ...
[ATL] Re: problem with programmatically transformation of multiple-file models [message #73553 is a reply to message #73193] Mon, 28 January 2008 11:11 Go to previous message
William Piers is currently offline William PiersFriend
Messages: 297
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060301050902020802060903
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

Could you please use the [ATL] prefix in your subjects ? Thanks in advance.

Concerning your problem, the command line tool may not be up to date, so
it doesn't embed the same version EMF4ATL version than you use in Eclipse.
We are currently working on a general solution for programmatic launch /
command line use , in order to avoid that compatibility issues.

But at this time, the best thing you have to do is to rebuild your own
command line tool (especially libraries) using the last ATL code.

Regards,

William

Yu Guo a écrit :
> Hi all,
>
> I am running the atl in my Java code using the command line code from
> dennis wagelaar. I get succesfully a programmatically transformation on
> the Family and Person example.
>
> But it does not work on our models.I got the message from the command
> line code that "The EMF4ATL version used does not support referenced
> extents (multiple-file models)"
>
> In our case, we have three metamodels in Ecore:
> "MooreStatemachine.ecore", "MealyStatemachine.ecore" and "Action.ecore".
> The metamodel in "Action.ecore" in referenced by both
> "MooreStatemachine.ecore" and "MealyStatemachine.ecore".
>
> In the side of model, we have models "action1.action", "action2.action"
> which are used by model "my.moorestatemachine". We want to transform
> this "my.moorestatemachine" model (with MooreStatemachine.ecore as
> metamodel) to the model with MealyStatemachine.ecore as metamodel. And
> both state machine models share the Action models.
>
> We can get this transformation done when use the "Run" in Eclipse, which
> means that the ATL can deal with the external referenced objects (both
> metamodel and model).
>
> Why cannot we get this done in Java code? Is it possible to transform
> mutil-file models by writting Java code?
>
>
> Regards,
>
> Yu Guo
>
>
> Here I list the command I use to invoke the command line tool, and the
> message I got:
>
> command line:
>
> --trans
> " file:E:\\eclipse-SDK-3.3.1.1-win32\\workspace\\StatemachineT ransform2\\MooreToMealy.asm "
>
> --in
> IN=" file:E:\\eclipse-SDK-3.3.1.1-win32\\workspace\\StatemachineT ransform2\\test\\My.moorestatemachine "
>
> MooreStatemachine=" file:E:\\eclipse-SDK-3.3.1.1-win32\\workspace\\StatemachineM odels\\model\\MooreStatemachine.ecore "
> EMF
> --out
> OUT=" file:E:\\eclipse-SDK-3.3.1.1-win32\\workspace\\StatemachineT ransform2\\test\\result.txt "
>
> MealyStatemachine=" file:E:\\eclipse-SDK-3.3.1.1-win32\\workspace\\StatemachineM odels\\model\\MealyStatemachine.ecore "
> EMF
>
>
> message:
>
> --trans
> file:E:\\eclipse-SDK-3.3.1.1-win32\\workspace\\StatemachineT ransform2\\MooreToMealy.asm
>
> --in
> IN=file:E:\\eclipse-SDK-3.3.1.1-win32\\workspace\\Statemachi neTransform2\\test\\My.moorestatemachine
>
> MooreStatemachine=file:E:\\eclipse-SDK-3.3.1.1-win32\\worksp ace\\StatemachineModels\\model\\MooreStatemachine.ecore
> EMF Input metamodel MooreStatemachine @
> org.eclipse.m2m.atl.engine.AtlEMFModelHandler@1f3aa07 not yet loaded -
> loading from
>
> file:E:\\eclipse-SDK-3.3.1.1-win32\\workspace\\StatemachineM odels\\model\\MooreStatemachine.ecore
>
> 2008-1-23 4:43:37 org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel
> addReferencedExtentsFor
> warning: Resource for org.eclipse.emf.ecore.impl.EClassImpl@196c1b0
> (eProxyURI: StatemachineAction.ecore#//Action) is null; cannot be
> referenced
> 2008-1-23 4:43:37 org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel
> addReferencedExtentsFor
> warning: Resource for org.eclipse.emf.ecore.impl.EClassImpl@196c1b0
> (eProxyURI: StatemachineAction.ecore#//Action) is null; cannot be
> referenced Referenced extents:
> [org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl$1@1e13d52
> uri='http://www.eclipse.org/emf/2002/Ecore']
> Using input metamodel MooreStatemachine : MOF
> Loading input model IN from
> file:E:\\eclipse-SDK-3.3.1.1-win32\\workspace\\StatemachineT ransform2
> \\test\\My.moorestatemachine
> 2008-1-23 4:43:38 org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel
> loadASMEMFModel
> 严重: null
> java.lang.NullPointerException
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFe atureType(XMLHandler.java:2022)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHa ndler.java:1900)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.createObject(XMIHa ndler.java:131)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLH andler.java:1705)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:974)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:953)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:684)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:167)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.emptyElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScanner Impl.scanStartElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
>
>
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScanner Impl.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
> Source)
> at javax.xml.parsers.SAXParser.parse(Unknown Source)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:179)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1354)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1155)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:256)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:271)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:398)
>
> at
> org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel.loadASMEMFMo del(ASMEMFModel.java:327)
>
> at
> org.eclipse.m2m.atl.engine.AtlEMFModelHandler.loadModel(AtlE MFModelHandler.java:235)
>
> at dk.sdu.mci.seg.atl.commandline.Main.loadModel(Main.java:97)
> at dk.sdu.mci.seg.atl.commandline.Main.addInputModel(Main.java: 215)
> at dk.sdu.mci.seg.atl.commandline.Main.parseArgs(Main.java:144)
> at dk.sdu.mci.seg.atl.commandline.Main.main(Main.java:72)
> java.lang.NullPointerExceptionjava.lang.NullPointerException
> at dk.sdu.mci.seg.atl.commandline.Main.addInputModel(Main.java: 216)
> at dk.sdu.mci.seg.atl.commandline.Main.parseArgs(Main.java:144)
> at dk.sdu.mci.seg.atl.commandline.Main.main(Main.java:72)
> The EMF4ATL version used does not support referenced extents
> (multiple-file models)
> Usage: <this program> --trans <transformation url> [--in <id>=<model>
> <id>=<metamodel> <MDR|EMF>] [--out <id>=<model>
>
> <id>=<metamodel> <MDR|EMF>] [--lib <id>=<library url>] [--superimpose
> <transformation url>] --next --trans ...

--------------060301050902020802060903
Content-Type: text/x-vcard; charset=utf-8;
name="william_piers.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="william_piers.vcf"

YmVnaW46dmNhcmQNCmZuOldpbGxpYW0gUGllcnMNCm46UGllcnM7V2lsbGlh bQ0Kb3JnOk9i
ZW8NCmFkcjoyIHJ1ZSBSb2JlcnQgU2NodW1hbm47O2xvdCAyNDtOQU5URVM7 OzQ0NDA4O0Zy
YW5jZQ0KZW1haWw7aW50ZXJuZXQ6d2lsbGlhbS5waWVyc0BvYmVvLmZyDQp0 aXRsZTpNREEg
Q29uc3VsdGFudA0KdGVsO3dvcms6KzMzICgwKTIgNTEgMTMgNTEgODINCnRl bDtjZWxsOisz
MyAoMCk2IDIwIDMxIDc1IDk4DQp1cmw6aHR0cDovL3d3dy5vYmVvLmZyDQp2 ZXJzaW9uOjIu
MQ0KZW5kOnZjYXJkDQoNCg==
--------------060301050902020802060903--
Previous Topic:[ATL] Unique Called Rules
Next Topic:[QVTOM] Deferred resolves
Goto Forum:
  


Current Time: Wed Apr 14 17:09:24 GMT 2021

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

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

Back to the top