Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » AMW » Problems with KM3 extension for HOT.
Problems with KM3 extension for HOT. [message #469578] Thu, 12 February 2009 06:25 Go to previous message
Juan Pedro Silva is currently offline Juan Pedro Silva
Messages: 247
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070702070409090402040004
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Ho everybody, Marcos.
Im trying to extend your AMWtoATL_Match.atl HOT transformation so that
it takes two inputs besides the AMW file, and one output (similar to the
"Merge of geographical information and statistical data" use case). I
will also add some new kind of links. For that I defined one MMW
extension, based on mw_base_extension.km3, and made a very simple
weaving model. So far so good.
However, for trying out the HOT transformation, I need an '.ecore'
metamodel to which the weaving model corresponds (to specify it as the
"AMW metamodel" in the launch configuration, am I right?). That's where
the problems start.

I tried "Inject KM3 into Ecore Metamodel" with my first extension with
no luck: the mw_base_extension.km3 classes weren't found, I could not
register those classes in the repository due to lack of namespace and
URIs, etc. Therefore I decided to include in my extension file the
packages contained in the mw_base_extension.km3 extension. That was
enough to take away the errors reported when generating the ecore. So
now I got an extension file and a metamodel in ecore format representing
it. Next I tried to make a new weaving model based on this new extension
file, so I could run my HOT on it. Regretfully, when I use the wizard to
create a new weaving model, and load this extension, I keep getting
"Class WXXX is not extended", where class WXXX can be WLinkEnd,
WModelRef, etc. (any of the ones defined by the base extension).

The problem is that all the classes have not-abstract extensions defined
in my file. I tried to versions of it: copying the mw_base_extension.km3
elements into my own package, or copying them into my file but keeping
them in their own packages (both versions attached). It didn't work.
Am I doing something wrong?, please help me, as this prevents me from
testing the HOT transformation, and it's holding me up.
Thank you in advance, and best regards,
Juan Pedro



--------------070702070409090402040004
Content-Type: text/plain;
name="mmw_iBuilder_SecureUML_Combination.km3"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="mmw_iBuilder_SecureUML_Combination.km3"

package PrimitiveTypes {

datatype Boolean;

datatype Integer;

datatype String;
}

package mwcore {

abstract class WElement {
attribute name : String;
attribute description : String;
reference model : WModel oppositeOf ownedElement;
}

abstract class WModel extends WElement {
reference ownedElement[*] ordered container : WElement oppositeOf model;
reference wovenModel[1-*] container : WModelRef;
}

abstract class WRef extends WElement {
attribute ref : String;
}

abstract class WModelRef extends WRef {
reference ownedElementRef[*] container : WElementRef oppositeOf modelRef;
}

abstract class WElementRef extends WRef {
reference modelRef : WModelRef oppositeOf ownedElementRef;
}

abstract class WAssociation extends WElement {
reference associationEnd[1-*] container : WAssociationEnd oppositeOf association;
}

abstract class WAssociationEnd extends WElement {
reference association : WAssociation oppositeOf associationEnd;
reference relatedLink : WLink;
}

abstract class WLink extends WElement {
reference child[*] ordered container : WLink oppositeOf parent;
reference parent : WLink oppositeOf child;
reference end[1-*] container : WLinkEnd oppositeOf link;
}

abstract class WLinkEnd extends WElement {
reference link : WLink oppositeOf end;
reference element : WElementRef;
}
}


package mmw_iBuilder_SecureUML_Combination {

-- Model class. Distinguish between left and right references

class CompositionModel extends WModel {

-- @subsets wovenModel
reference baseModel container : ModelRefXMI;

-- @subsets wovenModel
reference concernModel container : ModelRefXMI;

-- @subsets wovenModel
reference targetModel container : ModelRefXMI;

reference methods [*] container : Method;
}

-- Model references. To keep track of woven models

-- @welementRefType ElementRefXMI
class ModelRefXMI extends WModelRef {
attribute type : String;
}

-- references to each woven element

-- @wmodelRefType ModelRefXMI
class ElementRefXMI extends WElementRef {
}

------------------------------------------------------------ --------

class Method {
attribute name : String;
}

class ElementEqual extends Equal {
}

class Equal extends Equivalent {
}

class OutroLink extends WLink {

}

class AttributeEqual extends Equal {
}

class ReferenceEqual extends Equal {
}

class Element extends ReferredElement {
reference child [*] container: WLink;
reference referredClass container : ReferredElement;
}

abstract class ReferredElement extends WLinkEnd {
}

class LeftElement extends Element {
}

class RightElement extends Element {
}

class Equivalent extends WLink {
attribute similarity : Double;

-- @subsets end
reference source container : ReferredElement;

-- @subsets end
reference target container : ReferredElement;
}


class NotEquivalent extends WLink {

-- @subsets end
reference source container : ReferredElement;

-- @subsets end
reference target container : ReferredElement;
}


datatype Double;

------------------------------------------------------------ -----------------
class Asociacion extends WAssociation{
}

class AsociacionEnd extends WAssociationEnd{
}

class ResourceCombination extends WLink {
-- @subsets end
reference baseResource container : Elemento; --Entity y Operation tienen superclase comun Element
-- @subsets end
reference targetResource container : Resource; --Este si es un Resource
-- @subsets end
reference actionsHolderResource [*] container : Resource; --Aca es subclase de Resource
}
class Resource extends WLinkEnd {
}
class Elemento extends WLinkEnd {
}

class EnumerationEqual extends Equal {
}

class LiteralEqual extends Equal {
}

}

--------------070702070409090402040004
Content-Type: text/plain;
name="mmw_composition.km3"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="mmw_composition.km3"

package mmw_composition {
datatype Boolean;

datatype Integer;

datatype String;

abstract class WElement {
attribute name : String;
attribute description : String;
reference model : WModel oppositeOf ownedElement;
}

abstract class WModel extends WElement {
reference ownedElement[*] ordered container : WElement oppositeOf model;
reference wovenModel[1-*] container : WModelRef;
}

abstract class WRef extends WElement {
attribute ref : String;
}

abstract class WModelRef extends WRef {
reference ownedElementRef[*] container : WElementRef oppositeOf modelRef;
}

abstract class WElementRef extends WRef {
reference modelRef : WModelRef oppositeOf ownedElementRef;
}

-- abstract class WAssociation extends WElement {
-- reference associationEnd[1-*] container : WAssociationEnd oppositeOf association;
-- }

-- abstract class WAssociationEnd extends WElement {
-- reference association : WAssociation oppositeOf associationEnd;
-- reference relatedLink : WLink;
-- }

abstract class WLink extends WElement {
reference child[*] ordered container : WLink oppositeOf parent;
reference parent : WLink oppositeOf child;
reference end[1-*] container : WLinkEnd oppositeOf link;
}

abstract class WLinkEnd extends WElement {
reference link : WLink oppositeOf end;
reference element : WElementRef;
}


-- Model class. Distinguish between left and right references

class CompositionModel extends WModel {

-- @subsets wovenModel
reference baseModel container : ModelRefXMI;

-- @subsets wovenModel
reference concernModel container : ModelRefXMI;

-- @subsets wovenModel
reference targetModel container : ModelRefXMI;

reference methods [*] container : Method;
}

-- Model references. To keep track of woven models

-- @welementRefType ElementRefXMI
class ModelRefXMI extends WModelRef {
attribute type : String;
}

-- references to each woven element

-- @wmodelRefType ModelRefXMI
class ElementRefXMI extends WElementRef {
}

------------------------------------------------------------ --------

class Method {
attribute name : String;
}

class ElementEqual extends Equal {
}

class Equal extends Equivalent {
}

class OutroLink extends WLink {

}

class AttributeEqual extends Equal {
}

class ReferenceEqual extends Equal {
}

class Element extends ReferredElement {
reference child [*] container: WLink;
reference referredClass container : ReferredElement;
}

abstract class ReferredElement extends WLinkEnd {
}

class LeftElement extends Element {
}

class RightElement extends Element {
}

class Equivalent extends WLink {
attribute similarity : Double;

-- @subsets end
reference source container : ReferredElement;

-- @subsets end
reference target container : ReferredElement;
}


class NotEquivalent extends WLink {

-- @subsets end
reference source container : ReferredElement;

-- @subsets end
reference target container : ReferredElement;
}


datatype Double;

------------------------------------------------------------ -----------------

class ResourceCombination extends WLink {
-- @subsets end
reference baseResource container : Elemento; --Entity y Operation tienen superclase comun Element
-- @subsets end
reference targetResource container : Resource; --Este si es un Resource
-- @subsets end
reference actionsHolderResource [*] container : Resource; --Aca es subclase de Resource
}
class Resource extends WLinkEnd {
}
class Elemento extends WLinkEnd {
}

class EnumerationEqual extends Equal {
}

class LiteralEqual extends Equal {
}

}

--------------070702070409090402040004--
 
Read Message
Read Message
Read Message
Previous Topic:WAssociation/WAssociationEnd concepts
Next Topic:ERROR: could not find operation getReferredElement
Goto Forum:
  


Current Time: Tue May 21 06:28:55 EDT 2013

Powered by FUDForum. Page generated in 0.01724 seconds