Weaving Metamodel default extension

The base metamodel is abstract, so you must have a concrete extension of it.
We have created two extensions : one default base extension and other with an example with derived features.
Those extensions are in KM3 format (depends of ATL plugin).

Default base extension

This metamodel extension is designed to weave a left and a right model/metamodel (if you want to add other models, remove comments for the reference others).

This metamodel extension allows the creation of a link with two extrimities (left and right).

Its name is "mw_base_extension.km3".
All abstract classes are extended.

KM3 (Kernel Metametamodel)

In the syntax of km3, we have this :

package mw_base_ext {   

	class Model extends WModel {
	
		-- @subsets wovenModel
		reference leftModel container : WModelRef;
		
		-- @subsets wovenModel
		reference rightModel container : WModelRef;
		--reference others[*] container subsets wovenModel : WModelRef;
	}
	
-------------------------------------------------------------------

	-- @wmodelRefType ModelRef
	class ElementRef extends WElementRef {
	}		
	
	-- @welementRefType ElementRef
	class ModelRef extends WModelRef {
	}

	-- @welementRefType ElementRefXMI
	class ModelRefXMI extends WModelRef {
	}	

	-- @wmodelRefType ModelRef
	class ElementRefXMI extends WElementRef{
	}
	
-------------------------------------------------------------------

	class Association extends WAssociation {
	}

	class AssociationEnd extends WAssociationEnd {
	}						
	
--------------------------------------------------------------------	

	class Link extends WLink {
		
		-- @subsets end
		reference left container : WLinkEnd oppositeOf link;
		
		-- @subsets end
		reference right container : WLinkEnd oppositeOf link;
	}
	
	class LinkEnd extends WLinkEnd {
	}				
	
}

Supplier/consumer extension

Its name is "derived_features.km3". You can use it with default base extension. You cant' use alone (all abstract classes are not extended)

KM3 (Kernel Metametamodel)

Using the KM3 syntax :

package derived_features {   
	
	class Supplier extends WLink {
		reference orders[*] container: PurchaseOrder oppositeOf linkOrder;
		
		-- @subsets orders
		reference supplier[*] container : PurchaseOrder oppositeOf linkSupplier;
		
		-- @subsets orders
		reference consumer[*] container : PurchaseOrder oppositeOf linkConsumer;
	}	
	class PurchaseOrder extends WLinkEnd {		
	   reference linkOrder: Supplier oppositeOf orders;
	   reference linkSupplier: Supplier oppositeOf supplier;
	   reference linkConsumer: Supplier oppositeOf consumer;
	}				
}