Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » AMW » New user
New user [message #470177] Wed, 10 June 2009 07:24 Go to next message
venkatesh  is currently offline venkatesh Friend
Messages: 41
Registered: July 2009
Member
Hi ,

I'm new AMW.I have 2 Models .

LDM.ecore(metamodel) PDM.ecore(MetaModel)
| |
| |
| |
LDM Model.xmi PDMModel.xmi

i saw so many examples available.(AMW2ATL,Mantis2Bugzilla..)

I have to match all the Epackage 2 Epackage
Eclass 2 Eclass
EAttributes2 EAttributes
Ereference 2 Ereference
Enum 2 Enum
what all are the KM3 files i need to select to create a waeving model.

thanks in Advance,
venkatesh
Re: New user [message #470179 is a reply to message #470177] Wed, 10 June 2009 19:15 Go to previous messageGo to next message
Marcos Didonet Del Fabro is currently offline Marcos Didonet Del FabroFriend
Messages: 84
Registered: July 2009
Member
Hi,

if you want to use the matching transformations available in the
"transformation.extension" plugin, you need the following KM3 extensions:

mw_base_extension.km3, mmw_match.km3, mmw_compare.km3, mmw_propagation.km3
(optional).

There is a "how to" in the metamodel comparison use case.
http://www.eclipse.org/gmt/amw/examples/Scade/Scade_doc.php


Regards,

Marcos.
Re: New user [message #470184 is a reply to message #470179] Mon, 15 June 2009 05:38 Go to previous messageGo to next message
venkatesh  is currently offline venkatesh Friend
Messages: 41
Registered: July 2009
Member
Hi Marcos,

My Metamodel structure will look like this

MM1 MM2
Eclass A Eclass A'
Ereference x Ereference x'
Ereference y Ereference y '

what i have done in amw is

Eclass A MatchModel Eclass A'
| |
|__Eref x <ownedElement>ELementEqual A2A' |__ Eref x'
|___Erefy |____<child>ReferenceEqual |__ Eref y'
| <left>Element x
| <right>Element x'
|____ <child>ReferenceEqual
| <left>Element y
| <right>Element y'
|____<left> Element A
|____<Right>Elemnet A'

after doing this i clicked on Hot transformation.It has genenerated the
LDM2PDM_hot.ecore file but i'm not able to open this file.I registered
Atl.ecore file also.

From LDM2PDM_hot.ecore file i clicked on "Extract ATL 0.2 Model to ATL 0.2
file" .it has created "LDM2PDM_hot.atl" file



LDM2PDM_hot.atl file has the following content.

-- @atlcompiler atl2006
module T_In2Out;
create



Thanks in Advance
venky
Re: New user [message #470185 is a reply to message #470184] Tue, 16 June 2009 07:57 Go to previous messageGo to next message
Marcos Didonet Del Fabro is currently offline Marcos Didonet Del FabroFriend
Messages: 84
Registered: July 2009
Member
Hello,

The transformation failed in its first steps, i.e., in the moment it was
setting up the input and output models (after the "create" keyword).


Which are the settings that you have used for creating the weaving model?
for instance, left and right metamodels, as well as the "WElementRefs" ?


Marcos.
Re: New user [message #470186 is a reply to message #470185] Wed, 17 June 2009 05:05 Go to previous messageGo to next message
venkatesh  is currently offline venkatesh Friend
Messages: 41
Registered: July 2009
Member
Hi Marcos,

My LDM2PDM.amw.prop file look like this




<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<weaver>
<weaving>
<relative-path>/LDM2PDMtransformation/LDM2PDM.amw</relative-path >
<panel>TransformationWeavingPanelExtension</panel>
<wmodel>MatchModel</wmodel>
</weaving>
<metamodels>
<plugin>
<relative-path> org.eclipse.gmt.weaver.matchextensions/metamodels/mmw_match. km3 </relative-path>
<relative-path> org.eclipse.gmt.weaver.matchextensions/metamodels/mmw_propag ation.km3 </relative-path>
<relative-path> org.eclipse.gmt.weaver.matchextensions/metamodels/mmw_compar e.km3 </relative-path>
<relative-path> org.eclipse.weaver.extension.base/metamodels/mw_base_extensi on.km3 </relative-path>
</plugin>
<local/>
<complete/>
</metamodels>
<woven id="0">
<model-relative-path>null</model-relative-path>
<metamodel-relative-path>/LDMMetamodel/model/LdmMetaModel.ecore </metamodel-relative-path>
<reference>leftM</reference>
<title>leftM</title>
<panel>XMIWovenPanelExtension</panel>
<wmodelref>ModelRefXMI</wmodelref>
</woven>
<woven id="1">
<model-relative-path>null</model-relative-path>
<metamodel-relative-path>/PDMMetamodel/model/PdmModel.ecore </metamodel-relative-path>
<reference>rightM</reference>
<title>rightM</title>
<panel>XMIWovenPanelExtension</panel>
<wmodelref>ModelRefXMI</wmodelref>
</woven>
</weaver>

Thanks in Advance,
venkatesh
Re: New user [message #470188 is a reply to message #470186] Wed, 17 June 2009 17:53 Go to previous messageGo to next message
Marcos Didonet Del Fabro is currently offline Marcos Didonet Del FabroFriend
Messages: 84
Registered: July 2009
Member
Your settings are correct.
Do you have any error message, or some entry on the error log? If
everything is alright, a couple of lines with the XMI of your models could
help to discover the issue.


Marcos.
Re: New user [message #470189 is a reply to message #470188] Thu, 18 June 2009 05:24 Go to previous messageGo to next message
venkatesh  is currently offline venkatesh Friend
Messages: 41
Registered: July 2009
Member
Hi Marcos,


when i click on "Generate transformation(Hot)" i am getting the following
error


SEVERE: ****** BEGIN Stack Trace
SEVERE: exception:
SEVERE: The 'no null' constraint is violated
java.lang.IllegalArgumentException: The 'no null' constraint is violated
at org.eclipse.emf.common.util.BasicEList.validate(BasicEList.j ava:175)
at org.eclipse.emf.ecore.util.EcoreEList.validate(EcoreEList.ja va:63)
at org.eclipse.emf.common.util.BasicEList.addUnique(BasicEList. java:645)
at
org.eclipse.emf.common.notify.impl.NotifyingListImpl.doAddUn ique(NotifyingListImpl.java:331)
at
org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUniq ue(NotifyingListImpl.java:315)
at org.eclipse.emf.common.util.BasicEList.add(BasicEList.java:6 26)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.set(A SMEMFModelElement.java:254)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:292)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:133)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:91)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:230)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:325)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:133)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:91)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:230)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
at
org.eclipse.m2m.atl.engine.vm.ASMInterpreter.<init>(ASMInterpreter.java:289)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:155)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:105)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:81)
at
org.eclipse.gmt.weaver.transformation.util.TransformationUti l.executeTransfo(TransformationUtil.java:103)
at
org.eclipse.gmt.weaver.transformation.panel.TransformationWe avingPanel$TAction.run(TransformationWeavingPanel.java:181)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498 )
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:546)
at
org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:490)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:402)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
SEVERE: A.main() : ??#215 null
SEVERE: local variables = {null=right!PdmModel, self=AMWtoATL_Match :
ASMModule}
SEVERE: local stack = []
SEVERE: A.__exec__() : ??#8 null
SEVERE: local variables = {e=TransientLink {rule = 'Module',
sourceElements = {amw = IN!<notnamedyet>}, targetElements = {atl =
OUT!T_In2Out}, variables = {}}, self=AMWtoATL_Match : ASMModule}
SEVERE: local stack = []
SEVERE: A.__applyModule(1 : NTransientLink;) : ??#25 52:25-52:46
SEVERE: local variables = {atl=OUT!T_In2Out, amw=IN!<notnamedyet>,
link=TransientLink {rule = 'Module', sourceElements = {amw =
IN!<notnamedyet>}, targetElements = {atl = OUT!T_In2Out}, variables = {}},
self=AMWtoATL_Match : ASMModule}
SEVERE: local stack = [OUT!T_In2Out]
SEVERE: ****** END Stack Trace
INFO: Execution terminated due to error (see launch configuration to allow
continuation after errors).
SEVERE: null
java.lang.RuntimeException
at
org.eclipse.m2m.atl.engine.vm.SimpleDebugger.error(SimpleDeb ugger.java:185)
at
org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(Sta ckFrame.java:85)
at
org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(Sta ckFrame.java:77)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:163)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:133)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:91)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:230)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:325)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:133)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:91)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:230)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
at
org.eclipse.m2m.atl.engine.vm.ASMInterpreter.<init>(ASMInterpreter.java:289)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:155)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:105)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:81)
at
org.eclipse.gmt.weaver.transformation.util.TransformationUti l.executeTransfo(TransformationUtil.java:103)
at
org.eclipse.gmt.weaver.transformation.panel.TransformationWe avingPanel$TAction.run(TransformationWeavingPanel.java:181)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498 )
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:546)
at
org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:490)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:402)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
Caused by: java.lang.IllegalArgumentException: The 'no null' constraint is
violated
at org.eclipse.emf.common.util.BasicEList.validate(BasicEList.j ava:175)
at org.eclipse.emf.ecore.util.EcoreEList.validate(EcoreEList.ja va:63)
at org.eclipse.emf.common.util.BasicEList.addUnique(BasicEList. java:645)
at
org.eclipse.emf.common.notify.impl.NotifyingListImpl.doAddUn ique(NotifyingListImpl.java:331)
at
org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUniq ue(NotifyingListImpl.java:315)
at org.eclipse.emf.common.util.BasicEList.add(BasicEList.java:6 26)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.set(A SMEMFModelElement.java:254)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:292)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
... 43 more



Thanks,
venkatesh
Re: New user [message #470191 is a reply to message #470189] Thu, 18 June 2009 19:26 Go to previous messageGo to next message
Marcos Didonet Del Fabro is currently offline Marcos Didonet Del FabroFriend
Messages: 84
Registered: July 2009
Member
hi,

There is a reference with 1+ cardinality that is set up to "null".
Do you create links between EEnum and EPackages? These elements are not
supported by the transformation, only EClass, EReference and EAttributes.

Can you paste a part of your weaving model (in XMI)?


Marcos.
Re: New user [message #470192 is a reply to message #470191] Fri, 19 June 2009 05:40 Go to previous messageGo to next message
venkatesh  is currently offline venkatesh Friend
Messages: 41
Registered: July 2009
Member
Hi Marcos,

This is my amw file in XMI format.I have nearly 50 Eclassess in LDM.ecore
and PDM.ecore but in weaving model i have compared only few & generated
hot transformation to test it .




<?xml version="1.0" encoding="ASCII"?>
<MatchModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="mmw_match"
xmlns:_1="mw_base_ext" xmi:id="MatchModel1">
<ownedElement xsi:type="ElementEqual" xmi:id="ElementEqual1"
name="LDMModel2PDMModel">
<child xsi:type="ReferenceEqual" xmi:id="ReferenceEqual1">
<left xsi:type="Element" xmi:id="Element1" name="applicationModels"
element="ElementRefXMI1"/>
<right xsi:type="Element" xmi:id="Element2" name="applicationModels"
element="ElementRefXMI2"/>
</child>
<child xsi:type="ReferenceEqual" xmi:id="ReferenceEqual2">
<left xsi:type="Element" xmi:id="Element3" name="coreModel"
element="ElementRefXMI3"/>
<right xsi:type="Element" xmi:id="Element4" name="coreModel"
element="ElementRefXMI4"/>
</child>
<child xsi:type="ElementEqual" xmi:id="ElementEqual8"/>
<left xsi:type="Element" xmi:id="Element5" name="LDMModel"
element="ElementRefXMI5"/>
<right xsi:type="Element" xmi:id="Element6" name="PDMModel"
element="ElementRefXMI6"/>
</ownedElement>
<ownedElement xsi:type="ElementEqual" xmi:id="ElementEqual2"
name="LDMApplicationModel_PDMApplicationModel">
<child xsi:type="ReferenceEqual" xmi:id="ReferenceEqual3">
<left xsi:type="Element" xmi:id="Element7" name="application"
element="ElementRefXMI7"/>
<right xsi:type="Element" xmi:id="Element8" name="application"
element="ElementRefXMI8"/>
</child>
<child xsi:type="ReferenceEqual" xmi:id="ReferenceEqual4">
<left xsi:type="Element" xmi:id="Element9" name="serviceArea"
element="ElementRefXMI9"/>
<right xsi:type="Element" xmi:id="Element10" name="serviceArea"
element="ElementRefXMI10"/>
</child>
<child xsi:type="ReferenceEqual" xmi:id="ReferenceEqual5">
<left xsi:type="Element" xmi:id="Element11"
name="serviceAreaCounter" element="ElementRefXMI11"/>
<right xsi:type="Element" xmi:id="Element12"
name="serviceAreaCounters" element="ElementRefXMI12"/>
</child>
<child xsi:type="ReferenceEqual" xmi:id="ReferenceEqual6">
<left xsi:type="Element" xmi:id="Element13"
name="applicationSpecificNsr" element="ElementRefXMI13"/>
<right xsi:type="Element" xmi:id="Element14"
name="applicationSpecificNsr" element="ElementRefXMI14"/>
</child>
<child xsi:type="ReferenceEqual" xmi:id="ReferenceEqual7">
<left xsi:type="Element" xmi:id="Element15" name="accessArea"
element="ElementRefXMI15"/>
<right xsi:type="Element" xmi:id="Element16" name="accessArea"
element="ElementRefXMI16"/>
</child>
<child xsi:type="ReferenceEqual" xmi:id="ReferenceEqual8">
<left xsi:type="Element" xmi:id="Element17" name="deviceArea"
element="ElementRefXMI17"/>
<right xsi:type="Element" xmi:id="Element18" name="deviceArea"
element="ElementRefXMI18"/>
</child>
<left xsi:type="Element" xmi:id="Element19" name="LDMApplicationModel"
element="ElementRefXMI19"/>
<right xsi:type="Element" xmi:id="Element20"
name="PDMApplicationModel" element="ElementRefXMI20"/>
</ownedElement>
<leftM xsi:type="_1:ModelRefXMI" xmi:id="ModelRefXMI1" name="leftM"
ref="/LDMMetamodel/model/LdmMetaModel.ecore">
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI1"
name="ref_applicationModels" ref="EReference3"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI3"
name="ref_coreModel" ref="EReference5"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI5"
name="ref_LDMModel" ref="EClass2"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI7"
name="ref_application" ref="EReference8"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI9"
name="ref_serviceArea" ref="EReference10"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI11"
name="ref_serviceAreaCounter" ref="EReference12"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI13"
name="ref_applicationSpecificNsr" ref="EReference14"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI15"
name="ref_accessArea" ref="EReference16"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI17"
name="ref_deviceArea" ref="EReference18"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI19"
name="ref_LDMApplicationModel" ref="EClass7"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI21"
name="ref_name" ref="EAttribute22"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI23"
name="ref_LDMNamedElement" ref="EClass21"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI25"
name="ref_entities" ref="EReference27"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI27"
name="ref_aliases" ref="EReference29"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI29"
name="ref_views" ref="EReference31"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI31"
name="ref_groups" ref="EReference33"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI33"
name="ref_LDMApplication" ref="EClass26"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI35"
name="ref_base" ref="EReference37"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI37"
name="ref_superEntity" ref="EAttribute39"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI39"
name="ref_LDMApplicationEntity" ref="EClass36"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI41"
name="ref_plainAttributes" ref="EReference44"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI43"
name="ref_LDMEntity" ref="EClass51"/>
</leftM>
<rightM xsi:type="_1:ModelRefXMI" xmi:id="ModelRefXMI2" name="rightM"
ref="/PDMMetamodel/model/PdmModel.ecore">
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI2"
name="ref_applicationModels" ref="EReference8"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI4"
name="ref_coreModel" ref="EReference10"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI6"
name="ref_PDMModel" ref="EClass7"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI8"
name="ref_application" ref="EReference15"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI10"
name="ref_serviceArea" ref="EReference17"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI12"
name="ref_serviceAreaCounters" ref="EReference19"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI14"
name="ref_applicationSpecificNsr" ref="EReference21"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI16"
name="ref_accessArea" ref="EReference25"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI18"
name="ref_deviceArea" ref="EReference27"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI20"
name="ref_PDMApplicationModel" ref="EClass14"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI22"
name="ref_documentation" ref="EAttribute5"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI24"
name="ref_PDMNamedElement" ref="EClass2"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI26"
name="ref_entities" ref="EReference31"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI28"
name="ref_aliases" ref="EReference33"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI30"
name="ref_views" ref="EReference35"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI32"
name="ref_groups" ref="EReference37"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI34"
name="ref_PDMApplication" ref="EClass30"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI36"
name="ref_superEntity" ref="EAttribute43"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI38"
name="ref_base" ref="EReference41"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI40"
name="ref_LdapApplicationObjectClass" ref="EClass40"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI42"
name="ref_plainAttributes" ref="EReference288"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI44"
name="ref_LdapObjectClassWithAliases" ref="EClass61"/>
</rightM>
</MatchModel>



thanks ,

venkatesh
Re: New user [message #470194 is a reply to message #470192] Mon, 22 June 2009 07:14 Go to previous messageGo to next message
venkatesh  is currently offline venkatesh Friend
Messages: 41
Registered: July 2009
Member
Hi Marcos,

I have created the weaving model to the Port example(which i have
downloaded the source code from the below site).

http://www.eclipse.org/m2m/atl/basicExamples_Patterns/

This port example has TypeA.ecore & TypeB.ecore.

I created a weaving model to get the TypeA2TypeB.atl

typeA2typeB.amw.prop file look like this

------------------------------------------------------------ ------------------------------
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<weaver>
<weaving>
<relative-path>/Port/typeA2typeB.amw</relative-path>
<panel>TransformationWeavingPanelExtension</panel>
<wmodel>MatchModel</wmodel>
</weaving>
<metamodels>
<plugin>
<relative-path> org.eclipse.gmt.weaver.matchextensions/metamodels/mmw_match. km3 </relative-path>
<relative-path> org.eclipse.gmt.weaver.matchextensions/metamodels/mmw_propag ation.km3 </relative-path>
<relative-path> org.eclipse.gmt.weaver.matchextensions/metamodels/mmw_compar e.km3 </relative-path>
<relative-path> org.eclipse.weaver.extension.base/metamodels/mw_base_extensi on.km3 </relative-path>
</plugin>
<local/>
<complete/>
</metamodels>
<woven id="0">
<model-relative-path>null</model-relative-path>
<metamodel-relative-path>/Port/Metamodel/TypeA.ecore</metamodel-relative-path >
<reference>leftM</reference>
<title>leftM</title>
<panel>XMIWovenPanelExtension</panel>
<wmodelref>ModelRefXMI</wmodelref>
</woven>
<woven id="1">
<model-relative-path>null</model-relative-path>
<metamodel-relative-path>/Port/Metamodel/TypeB.ecore</metamodel-relative-path >
<reference>rightM</reference>
<title>rightM</title>
<panel>XMIWovenPanelExtension</panel>
<wmodelref>ModelRefXMI</wmodelref>
</woven>
</weaver>
------------------------------------------------------------ -----------------------


TypeA2TypeB.amw file look like this

<?xml version="1.0" encoding="ASCII"?>
<MatchModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="mmw_match"
xmlns:_1="mw_base_ext" xmi:id="MatchModel1">
<ownedElement xsi:type="ElementEqual" xmi:id="ElementEqual1">
<child xsi:type="ReferenceEqual" xmi:id="ReferenceEqual1"
name="inputports2outputports">
<left xsi:type="Element" xmi:id="Element1" name="inputPorts"
element="ElementRefXMI1"/>
<right xsi:type="Element" xmi:id="Element2" name="inputPorts"
element="ElementRefXMI2"/>
</child>
<child xsi:type="ReferenceEqual" xmi:id="ReferenceEqual2">
<left xsi:type="Element" xmi:id="Element3" name="outputPorts"
element="ElementRefXMI3"/>
<right xsi:type="Element" xmi:id="Element4" name="outputPorts"
element="ElementRefXMI4"/>
</child>
<left xsi:type="Element" xmi:id="Element5" name="BlockA"
element="ElementRefXMI5"/>
<right xsi:type="Element" xmi:id="Element6" name="BlockB"
element="ElementRefXMI6"/>
</ownedElement>
<ownedElement xsi:type="ElementEqual" xmi:id="ElementEqual2">
<child xsi:type="AttributeEqual" xmi:id="AttributeEqual1">
<left xsi:type="Element" xmi:id="Element7" name="name"
element="ElementRefXMI7"/>
<right xsi:type="Element" xmi:id="Element8" name="name"
element="ElementRefXMI8"/>
</child>
</ownedElement>
<leftM xsi:type="_1:ModelRefXMI" xmi:id="ModelRefXMI1" name="leftM"
ref="/Port/Metamodel/TypeA.ecore">
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI1"
name="ref_inputPorts" ref="EReference3"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI3"
name="ref_outputPorts" ref="EReference5"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI5"
name="ref_BlockA" ref="EClass2"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI7"
name="ref_name" ref="EAttribute8"/>
</leftM>
<rightM xsi:type="_1:ModelRefXMI" xmi:id="ModelRefXMI2" name="rightM"
ref="/Port/Metamodel/TypeB.ecore">
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI2"
name="ref_inputPorts" ref="EReference3"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI4"
name="ref_outputPorts" ref="EReference5"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI6"
name="ref_BlockB" ref="EClass2"/>
<ownedElementRef xsi:type="_1:ElementRefXMI" xmi:id="ElementRefXMI8"
name="ref_name" ref="EAttribute8"/>
</rightM>
</MatchModel>
------------------------------------------------------------ --------------------


and in this also i'm getting the same error

SEVERE: ****** BEGIN Stack Trace
SEVERE: exception:
SEVERE: The 'no null' constraint is violated
java.lang.IllegalArgumentException: The 'no null' constraint is violated
at org.eclipse.emf.common.util.BasicEList.validate(BasicEList.j ava:175)
at org.eclipse.emf.ecore.util.EcoreEList.validate(EcoreEList.ja va:63)
at org.eclipse.emf.common.util.BasicEList.addUnique(BasicEList. java:645)
at
org.eclipse.emf.common.notify.impl.NotifyingListImpl.doAddUn ique(NotifyingListImpl.java:331)
at
org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUniq ue(NotifyingListImpl.java:315)
at org.eclipse.emf.common.util.BasicEList.add(BasicEList.java:6 26)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.set(A SMEMFModelElement.java:254)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:292)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:133)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:91)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:230)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:325)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:133)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:91)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:230)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
at
org.eclipse.m2m.atl.engine.vm.ASMInterpreter.<init>(ASMInterpreter.java:289)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:155)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:105)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:81)
at
org.eclipse.gmt.weaver.transformation.util.TransformationUti l.executeTransfo(TransformationUtil.java:103)
at
org.eclipse.gmt.weaver.transformation.panel.TransformationWe avingPanel$TAction.run(TransformationWeavingPanel.java:181)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498 )
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:546)
at
org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:490)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:402)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
SEVERE: A.main() : ??#215 null
SEVERE: local variables = {null=right!ecore, self=AMWtoATL_Match :
ASMModule}
SEVERE: local stack = []
SEVERE: A.__exec__() : ??#8 null
SEVERE: local variables = {e=TransientLink {rule = 'Module',
sourceElements = {amw = IN!<notnamedyet>}, targetElements = {atl =
OUT!T_In2Out}, variables = {}}, self=AMWtoATL_Match : ASMModule}
SEVERE: local stack = []
SEVERE: A.__applyModule(1 : NTransientLink;) : ??#25 52:25-52:46
SEVERE: local variables = {atl=OUT!T_In2Out, amw=IN!<notnamedyet>,
link=TransientLink {rule = 'Module', sourceElements = {amw =
IN!<notnamedyet>}, targetElements = {atl = OUT!T_In2Out}, variables = {}},
self=AMWtoATL_Match : ASMModule}
SEVERE: local stack = [OUT!T_In2Out]
SEVERE: ****** END Stack Trace
INFO: Execution terminated due to error (see launch configuration to allow
continuation after errors).
SEVERE: null
java.lang.RuntimeException
at
org.eclipse.m2m.atl.engine.vm.SimpleDebugger.error(SimpleDeb ugger.java:185)
at
org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(Sta ckFrame.java:85)
at
org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(Sta ckFrame.java:77)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:163)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:133)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:91)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:230)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:325)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:133)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:91)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:230)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
at
org.eclipse.m2m.atl.engine.vm.ASMInterpreter.<init>(ASMInterpreter.java:289)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:155)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:105)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:81)
at
org.eclipse.gmt.weaver.transformation.util.TransformationUti l.executeTransfo(TransformationUtil.java:103)
at
org.eclipse.gmt.weaver.transformation.panel.TransformationWe avingPanel$TAction.run(TransformationWeavingPanel.java:181)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498 )
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:546)
at
org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:490)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:402)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
Caused by: java.lang.IllegalArgumentException: The 'no null' constraint is
violated
at org.eclipse.emf.common.util.BasicEList.validate(BasicEList.j ava:175)
at org.eclipse.emf.ecore.util.EcoreEList.validate(EcoreEList.ja va:63)
at org.eclipse.emf.common.util.BasicEList.addUnique(BasicEList. java:645)
at
org.eclipse.emf.common.notify.impl.NotifyingListImpl.doAddUn ique(NotifyingListImpl.java:331)
at
org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUniq ue(NotifyingListImpl.java:315)
at org.eclipse.emf.common.util.BasicEList.add(BasicEList.java:6 26)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.set(A SMEMFModelElement.java:254)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:292)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
... 43 more
------------------------------------------------------------ ------------------

can u tell me for this example how to create the weaving model.



Thanks ,

venkatesh
Re: New user [message #470196 is a reply to message #470194] Mon, 22 June 2009 11:56 Go to previous messageGo to next message
Marcos Didonet Del Fabro is currently offline Marcos Didonet Del FabroFriend
Messages: 84
Registered: July 2009
Member
Hello,

The metamodels typeA and typeB refer directly to elements of Ecore
(EString). These elements do not have an XMI ID associated, thus the
editor cannot handle them correctly.

Try to replace "XMIModelRef" and "XMIWovenPanel" by "ModelRef" and
"DefaultWovenPanel".

You should avoid referencing to Ecore elements in your metamodels, in
order to keep a clear separation between metamodeling levels.

This may be the same problem in your previous example.


Regards,

Marcos.
Re: New user [message #470197 is a reply to message #470196] Tue, 23 June 2009 12:15 Go to previous messageGo to next message
venkatesh  is currently offline venkatesh Friend
Messages: 41
Registered: July 2009
Member
Hi Marcos ,

It's working fine.Now i want to convert port A to Port B.I have created
weaving model and i generated Hot transformation from that i generated the
atl file but .asm file is not created


TypeA2TypeB.atl file look like this


-- @atlcompiler atl2006
module T_In2Out;
create typeBModel : typeB from typeAModel : typeA;

rule BlockA_2_BlockB2 {
from
v_left : typeA!BlockA
to
v_right : typeA!BlockB (
inputPorts <- Set {v_left.inputPorts},
outputPorts <- Set {v_left.outputPorts}
)
}

rule PortA_2_PortB3 {
from
v_left : typeA!PortA
to
v_right : typeA!PortB (
name <- v_left.name
)
}

when i try to transform it's give the following error.

SEVERE: null
java.lang.NullPointerException
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel.addReference dExtentsFor(ASMEMFModel.java:490)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel.addAllRefere ncedExtents(ASMEMFModel.java:467)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel.loadASMEMFMo del(ASMEMFModel.java:315)
at
org.eclipse.m2m.atl.engine.AtlEMFModelHandler.loadModel(AtlE MFModelHandler.java:219)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.loadModel(Atl RegularVM.java:220)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.getTargetMode ls(AtlRegularVM.java:183)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:327)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:453)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.launch(AtlReg ularVM.java:425)
at
org.eclipse.m2m.atl.adt.launching.AtlLaunchConfigurationDele gate.launch(AtlLaunchConfigurationDelegate.java:35)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:759)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:608)
at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:899)
at
org.eclipse.debug.internal.ui.DebugUIPlugin$7.run(DebugUIPlu gin.java:1102)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
SEVERE: C:\Documents and
Settings\Administrator\NewFoldereclipse\Port\Test\test_hot.a sm (The system
cannot find the file specified)
java.io.FileNotFoundException: C:\Documents and
Settings\Administrator\NewFoldereclipse\Port\Test\test_hot.a sm (The system
cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(U nknown
Source)
at java.net.URL.openStream(Unknown Source)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:104)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:81)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:351)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:453)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.launch(AtlReg ularVM.java:425)
at
org.eclipse.m2m.atl.adt.launching.AtlLaunchConfigurationDele gate.launch(AtlLaunchConfigurationDelegate.java:35)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:759)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:608)
at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:899)
at
org.eclipse.debug.internal.ui.DebugUIPlugin$7.run(DebugUIPlu gin.java:1102)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
SEVERE: Resource '/Port/Test/test_hot.atl' does not exist.
org.eclipse.core.internal.resources.ResourceException: Resource
'/Port/Test/test_hot.atl' does not exist.
at
org.eclipse.core.internal.resources.Resource.checkExists(Res ource.java:310)
at
org.eclipse.core.internal.resources.Resource.checkAccessible (Resource.java:193)
at
org.eclipse.core.internal.resources.Resource.findMarkers(Res ource.java:858)
at
org.eclipse.m2m.atl.adt.ui.viewsupport.AtlEditorTickErrorUpd ater.computeHighestServityFlag(AtlEditorTickErrorUpdater.jav a:69)
at
org.eclipse.m2m.atl.adt.ui.viewsupport.AtlEditorTickErrorUpd ater.getImage(AtlEditorTickErrorUpdater.java:101)
at
org.eclipse.m2m.atl.adt.ui.viewsupport.AtlEditorTickErrorUpd ater.updateEditorImage(AtlEditorTickErrorUpdater.java:94)
at
org.eclipse.m2m.atl.adt.ui.viewsupport.AtlEditorTickErrorUpd ater.problemsChanged(AtlEditorTickErrorUpdater.java:55)
at
org.eclipse.m2m.atl.adt.ui.viewsupport.ProblemMarkerManager$ 1.run(ProblemMarkerManager.java:142)


can u tell me how to create the weaving model for this example to
transform PortA to PortB.


my amw file look like this



<?xml version="1.0" encoding="ASCII"?>
<MatchModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="mmw_match"
xmlns:_1="mw_base_ext" xmi:id="MatchModel1">
<ownedElement xsi:type="ElementEqual" xmi:id="ElementEqual1">
<child xsi:type="ReferenceEqual" xmi:id="ReferenceEqual1">
<left xsi:type="Element" xmi:id="Element1" name="inputPorts"
element="ElementRef1"/>
<right xsi:type="Element" xmi:id="Element2" name="inputPorts"
element="ElementRef2"/>
</child>
<child xsi:type="ReferenceEqual" xmi:id="ReferenceEqual2">
<left xsi:type="Element" xmi:id="Element3" name="outputPorts"
element="ElementRef3"/>
<right xsi:type="Element" xmi:id="Element4" name="outputPorts"
element="ElementRef4"/>
</child>
<left xsi:type="Element" xmi:id="Element5" name="BlockA"
element="ElementRef5"/>
<right xsi:type="Element" xmi:id="Element6" name="BlockB"
element="ElementRef6"/>
</ownedElement>
<ownedElement xsi:type="ElementEqual" xmi:id="ElementEqual2">
<child xsi:type="AttributeEqual" xmi:id="AttributeEqual1">
<left xsi:type="Element" xmi:id="Element7" name="name"
element="ElementRef7"/>
<right xsi:type="Element" xmi:id="Element8" name="name"
element="ElementRef8"/>
</child>
<left xsi:type="Element" xmi:id="Element9" name="PortA"
element="ElementRef9"/>
<right xsi:type="Element" xmi:id="Element10" name="PortB"
element="ElementRef10"/>
</ownedElement>
<leftM xsi:type="_1:ModelRef" xmi:id="ModelRef1" name="leftM"
ref="/Port/Metamodel/TypeA.ecore">
<ownedElementRef xsi:type="_1:ElementRef" xmi:id="ElementRef1"
name="ref_inputPorts" ref="EReference3"/>
<ownedElementRef xsi:type="_1:ElementRef" xmi:id="ElementRef3"
name="ref_outputPorts" ref="EReference5"/>
<ownedElementRef xsi:type="_1:ElementRef" xmi:id="ElementRef5"
name="ref_BlockA" ref="EClass2"/>
<ownedElementRef xsi:type="_1:ElementRef" xmi:id="ElementRef7"
name="ref_name" ref="EAttribute8"/>
<ownedElementRef xsi:type="_1:ElementRef" xmi:id="ElementRef9"
name="ref_PortA" ref="EClass7"/>
</leftM>
<rightM xsi:type="_1:ModelRef" xmi:id="ModelRef2" name="rightM"
ref="/Port/Metamodel/TypeC.ecore">
<ownedElementRef xsi:type="_1:ElementRef" xmi:id="ElementRef2"
name="ref_inputPorts" ref="EReference3"/>
<ownedElementRef xsi:type="_1:ElementRef" xmi:id="ElementRef4"
name="ref_outputPorts" ref="EReference5"/>
<ownedElementRef xsi:type="_1:ElementRef" xmi:id="ElementRef6"
name="ref_BlockB" ref="EClass2"/>
<ownedElementRef xsi:type="_1:ElementRef" xmi:id="ElementRef8"
name="ref_name" ref="EAttribute8"/>
<ownedElementRef xsi:type="_1:ElementRef" xmi:id="ElementRef10"
name="ref_PortB" ref="EClass7"/>
</rightM>
</MatchModel>



Thanks in advance
venkatesh
Re: New user [message #470199 is a reply to message #470197] Tue, 23 June 2009 12:31 Go to previous messageGo to next message
Marcos Didonet Del Fabro is currently offline Marcos Didonet Del FabroFriend
Messages: 84
Registered: July 2009
Member
Hello,

to generate the ".asm" file, the project must have an ATL nature (to call
the ATL compiler). The compiler takes all the ".atl" files in a project,
and produces the corresponding ".asm".

You need to create your project through the New->ATL project menu.

Regards,

Marcos.
Re: New user [message #470294 is a reply to message #470197] Thu, 25 June 2009 05:19 Go to previous messageGo to next message
venkatesh  is currently offline venkatesh Friend
Messages: 41
Registered: July 2009
Member
Hello Marcos,

Now i got the asm file.In this port example the atl file look like this

module TypeA2TypeB;
create inB : TypeB from inA : TypeA;

rule BlkA2BlkB {
from
blkA : TypeA!BlockA
to
blkB : TypeB!BlockB (
inputPorts <- blkA.inputPorts,
outputPorts <- blkA.outputPorts
)
}

rule PortA2InPortB {
from
s : TypeA!PortA (s.refImmediateComposite().inputPorts->includes(s))
to
t : TypeB!InPortB (
name <- s.name
)
}

rule PortA2OutPortB {
from
s : TypeA!PortA (s.refImmediateComposite().outputPorts->includes(s))
to
t : TypeB!OutPortB (
name <- s.name
)
}
------------------------------------------------------------ -------------------------


but whatever i'm creating using weaving model is looking like this



module T_In2Out;
create typeBModel : typeB from typeAModel : typeA;

rule BlockA_2_BlockB2 {
from
v_left : typeA!BlockA
to
v_right : typeA!BlockB (
inputPorts <- Set {v_left.inputPorts},
outputPorts <- Set {v_left.outputPorts}
)
}

rule PortA_2_PortB3 {
from
v_left : typeA!PortA
to
v_right : typeA!PortB (
name <- v_left.name
)
}
---------------------------------------------------------

so i'm not able to transform .I know somewhere in amw file i am doing
mistake.

can u please provide me an amw file for this port example to transform
TypeA2TypeB so that i'll get a clear picture of it.


Thanks in Advance
venkatesh
Re: New user [message #470295 is a reply to message #470294] Thu, 25 June 2009 08:39 Go to previous messageGo to next message
Marcos Didonet Del Fabro is currently offline Marcos Didonet Del FabroFriend
Messages: 84
Registered: July 2009
Member
Hello,

You need to create links between the elements that you want to transform.
For instance, to transform "PortA" into "OutPortB", it is necessary to
create an "ElementLink" between these elements.

Once the links are created, the HOT that is executed always produce an ATL
model that follows the same format:

from
v_left : inelement
to
v_right : outelement


Then, you have two options:

1) manually complete the transformation that has been generated with the
desired code, for instance, the conditions.

2) create an extension to AMW that handles these more complex cases. In
this case, the extension is worthwhile only if it is going to be reused
systematically.


Regards,

Marcos.
Re: New user [message #470296 is a reply to message #470295] Thu, 25 June 2009 09:46 Go to previous messageGo to next message
venkatesh  is currently offline venkatesh Friend
Messages: 41
Registered: July 2009
Member
Hello Marcos,

Still i'm not clear since i'm new to ATL & AMW.i don't have any idea
about ATL syntax so what i thought is this tool will help me to do it
automatically through GUI.


u mean to say (s.refImmediateComposite().inputPorts->includes(s)) this
condition i have to write manually


can u just tell me in this following amw file what i have to add

<?xml version="1.0" encoding="ASCII"?>
<MatchModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="mmw_match"
xmlns:_1="mw_base_ext" xmi:id="MatchModel1">
<ownedElement xsi:type="ElementEqual" xmi:id="ElementEqual1">
<child xsi:type="ReferenceEqual" xmi:id="ReferenceEqual1">
<left xsi:type="Element" xmi:id="Element1" name="inputPorts"
element="ElementRef1"/>
<right xsi:type="Element" xmi:id="Element2" name="inputPorts"
element="ElementRef2"/>
</child>
<child xsi:type="ReferenceEqual" xmi:id="ReferenceEqual2">
<left xsi:type="Element" xmi:id="Element4" name="outputPorts"
element="ElementRef3"/>
<right xsi:type="Element" xmi:id="Element5" name="outputPorts"
element="ElementRef4"/>
</child>
<left xsi:type="Element" xmi:id="Element3" name="BlockA"
element="ElementRef5"/>
<right xsi:type="Element" xmi:id="Element6" name="BlockB"
element="ElementRef6"/>
</ownedElement>
<ownedElement xsi:type="ElementEqual" xmi:id="ElementEqual2">
<child xsi:type="AttributeEqual" xmi:id="AttributeEqual1">
<left xsi:type="Element" xmi:id="Element7" name="name"
element="ElementRef7"/>
<right xsi:type="Element" xmi:id="Element8" name="name"
element="ElementRef8"/>
</child>
<left xsi:type="Element" xmi:id="Element9" name="PortA"
element="ElementRef9"/>
<right xsi:type="Element" xmi:id="Element10" name="PortB"
element="ElementRef10"/>
</ownedElement>
<leftM xsi:type="_1:ModelRef" xmi:id="ModelRef1" name="leftM"
ref="/PortTest/Metamodel/TypeA.ecore">
<ownedElementRef xsi:type="_1:ElementRef" xmi:id="ElementRef1"
name="ref_inputPorts" ref="EReference3"/>
<ownedElementRef xsi:type="_1:ElementRef" xmi:id="ElementRef3"
name="ref_outputPorts" ref="EReference5"/>
<ownedElementRef xsi:type="_1:ElementRef" xmi:id="ElementRef5"
name="ref_BlockA" ref="EClass2"/>
<ownedElementRef xsi:type="_1:ElementRef" xmi:id="ElementRef7"
name="ref_name" ref="EAttribute8"/>
<ownedElementRef xsi:type="_1:ElementRef" xmi:id="ElementRef9"
name="ref_PortA" ref="EClass7"/>
</leftM>
<rightM xsi:type="_1:ModelRef" xmi:id="ModelRef2" name="rightM"
ref="/PortTest/Metamodel/TypeB.ecore">
<ownedElementRef xsi:type="_1:ElementRef" xmi:id="ElementRef2"
name="ref_inputPorts" ref="EReference3"/>
<ownedElementRef xsi:type="_1:ElementRef" xmi:id="ElementRef4"
name="ref_outputPorts" ref="EReference5"/>
<ownedElementRef xsi:type="_1:ElementRef" xmi:id="ElementRef6"
name="ref_BlockB" ref="EClass2"/>
<ownedElementRef xsi:type="_1:ElementRef" xmi:id="ElementRef8"
name="ref_name" ref="EAttribute8"/>
<ownedElementRef xsi:type="_1:ElementRef" xmi:id="ElementRef10"
name="ref_PortB" ref="EClass7"/>
<ownedElementRef xsi:type="_1:ElementRef" xmi:id="ElementRef11"
name="ref_InPortB" ref="EClass10"/>
<ownedElementRef xsi:type="_1:ElementRef" xmi:id="ElementRef12"
name="ref_OutPortB" ref="EClass12"/>
</rightM>
</MatchModel>


Thanks in Advance
venaktesh
Re: New user [message #470298 is a reply to message #470296] Thu, 25 June 2009 16:36 Go to previous message
Marcos Didonet Del Fabro is currently offline Marcos Didonet Del FabroFriend
Messages: 84
Registered: July 2009
Member
Hello,

ATL is a model transformation language that is very rich, with the
possibility to write from simple to very complex transformations
expressions. These expressions are used for evaluating/querying the model
elements that are going to be transformed.

AMW has a different goal with respect to model transformations. One of its
objectives is to help on the development of transformations, but not to
develop a whole transformation from scratch.

The typical setting for users of AMW and ATL is to initially define simple
links between models elements using the AMW GUI, than to generate the ATL
"skeleton", and than to complete it manually.

Thus, you should add the "refImmediateComposite()" expressions on the
generated model.

Regards,

Marcos
Previous Topic:Problem in Mantis2Bug.ecore
Next Topic:Any Build for Galileo?
Goto Forum:
  


Current Time: Wed Apr 24 19:25:35 GMT 2024

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

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

Back to the top