[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmt.amw] Re: Cannot assign model elements to weaving links

Hello,

I didn't manage to figure out your problem, so I added myself the required annotations.

You can compare with your metamodel extension to verify if everything is the same.

Note that the annotations have the following (fixed) format:
--<space>@<annotationName><space><annotationValue>, e.g.,
-- @susets wovenModel


Regards,

Marcos.


package class_diff_ext {

   class CModel extends WModel {

       -- @susets wovenModel
       reference CleftModel container : WModelRef;

       -- @susets wovenModel
       reference CrightModel container : WModelRef;

   }
	
   -- @welementRefType ElementRef
   class ModelRef extends WModelRef {

   }


-- @wmodelRefType ModelRef class ElementRef extends WElementRef {

   }



   class AttributeAdded  extends WLink {

    -- @subsets end
        reference from container : WLinkEnd ;

    -- @subsets end
      reference to container :  WLinkEnd ;

   }



   class LinkEnd extends WLinkEnd {

   }

   }


medo samh wrote:
Hi,



Thanks for your help. I have added the required annotations to my weaving metamodel and now I can assign elements to my weaving links.

However, I still get an error whenevr I create a weaving model. The error says: 'org.eclipse.core.internal.resources.ResourceException: Resource /amw_test/AMW1.amw is not local'. Stack trace is in the attached text file.


Also, whenever, I assign a model element to a weaving link, I get 2 identical warning messages saying that 'An exception was ignored during command execution'. Stack trace is also in the attached text file.



I am not sure whether these messages have to do with my installation [Eclipse 3.2.1, EMF 2.2.1, AMW (Feb 16, 2007) and ATL/AM3 (Feb 16, 2007) or I am missing something when creating a weaving model or metamodel.




Thanks,



"Marcos Didonet Del Fabro" <mddfabro@xxxxxxx> wrote in message news:g96co6$69m$1@xxxxxxxxxxxxxxxxxxxx
Hi,

when creating a weaving metamodel extension it is necessary to add a
couple of annotations in the "key" elements that extend WModelRef,
WElement, etc.

The tool uses these annotations to choose the correct WModels,
WElementRefs, and the identification mechanism.

The AMW FAQ explains how to create an extension with these annotations:

http://wiki.eclipse.org/index.php/AMW_FAQ#How_to_create_weaving_metamodel_extensions.3F


Regards,

Marcos.


medo samh wrote:
Hi,




I have the following two simple models conforming to km3.



Model A



      class A {

            attribute a1 : String;

            attribute a2 : String;

      }



Model  B



      class B {

            attribute a1 : String;

            attribute a3 : String;

      }



I would like to create a weaving model with a minimum set of elements
(model, modelRef, link, linkEnd and ElementRef).



I have extended amw_core metamodel as follows:



package class_diff_ext {



class CModel extends WModel {

    reference CleftModel container : WModelRef;

    reference CrightModel container : WModelRef;

}



class ModelRef extends WModelRef {

}



class ElementRef extends WElementRef {

}



class AttributeAdded extends WLink {

   reference from container : LinkEnd ;

   reference to container :  LinkEnd ;

}



class LinkEnd extends WLinkEnd {

}

}



I have used the wizard to create the weaving model.  In page 1/3 - I have
loaded the metamodel from the workspace. In page 3/3 - I have selected
"ModelRef" and "DefaultWovenPanelExtension" because I do not want to work
with XMI ids.




The first time the weaving panel is displayed, I get an internal error in the log saying that "Resource /amw_test/amw_test.ecore is not local" in org.eclipse.core.resources plugin.



In spite of the message, I can create a weaving link and can create a link
end. But when I try to assign an element from the left or right model, I
get two errors


"Unhandled event loop exception" and the second is
"java.lang.NullPointerException" with the stack trace below.



I am using Eclipse 3.2.1, EMF 2.2.1, AMW (Feb 16, 2007) and ATL/AM3 (Feb 16,
2007).




Thanks in advance for your help,



java.lang.NullPointerException

at
org.eclipse.emf.edit.provider.ComposedAdapterFactory.adapt(ComposedAdapterFactory.java:313)

at
org.eclipse.weaver.extension.plugin.util.WeaverExtensionUtil.getElementID(WeaverExtensionUtil.java:220)

at
org.eclipse.weaver.extension.plugin.util.WeaverExtensionUtil.createGetWElementRef(WeaverExtensionUtil.java:163)

at
org.eclipse.weaver.extension.plugin.util.WeaverExtensionUtil.setLinkEndValueProperty(WeaverExtensionUtil.java:321)

at
org.eclipse.weaver.extension.panel.dnd.WeavingPanelDndManager.drop(WeavingPanelDndManager.java:152)

at org.eclipse.swt.dnd.DNDListener.handleEvent(DNDListener.java:65)

at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:952)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:937)

at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:709)

at org.eclipse.swt.dnd.DropTarget.Drop(DropTarget.java:423)

at org.eclipse.swt.dnd.DropTarget$3.method6(DropTarget.java:238)

at
org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:117)

at org.eclipse.swt.internal.ole.win32.COM.DoDragDrop(Native Method)

at org.eclipse.swt.dnd.DragSource.drag(DragSource.java:306)

at org.eclipse.swt.dnd.DragSource.access$0(DragSource.java:277)

at org.eclipse.swt.dnd.DragSource$1.handleEvent(DragSource.java:164)

at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)

at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)

at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)

at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)

at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)

at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)

at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)

at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)

at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)

at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)

at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)

at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)

at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)

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.core.launcher.Main.invokeFramework(Main.java:336)

at org.eclipse.core.launcher.Main.basicRun(Main.java:280)

at org.eclipse.core.launcher.Main.run(Main.java:977)

at org.eclipse.core.launcher.Main.main(Main.java:952)