Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » AMW » Problems with KM3 extension for HOT.
Problems with KM3 extension for HOT. [message #469578] Thu, 12 February 2009 11:25 Go to next message
Juan Pedro Silva is currently offline Juan Pedro SilvaFriend
Messages: 258
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--
Re: Problems with KM3 extension for HOT. [message #469579 is a reply to message #469578] Thu, 12 February 2009 12: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,

You cannot directly use the "Inject KM3 into Ecore Metamodel" to produce
a weaving metamodel used by the AMW plug-in, because this transformation
does not handle the annotations "subsets" and "welementRefType" that are
defined in the AMW extensions.

You can create an Ecore metamodel manually, and add these annotations,
but this is not the most straightforward way. I recommend first to
create a .km3, and to load this extension from the workspace when
creating the weaving metamodel (first page of the wizard).

After the weaving model is created with the root element, there is a
menu "Create a Ecore metamodel" (I don't remember the exact text...).
This menu creates a weaving metamodel with all the annotations.

Than, you can use the generated Ecore metamodel in your HOTs.


Regards,

Marcos.

Juan Pedro Silva wrote:
> 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
>
>
Re: Problems with KM3 extension for HOT. [message #469580 is a reply to message #469579] Thu, 12 February 2009 13:27 Go to previous message
Juan Pedro Silva is currently offline Juan Pedro SilvaFriend
Messages: 258
Registered: July 2009
Senior Member
"Save Weaving Metamodel in Ecore Format", that must be it.
Thank you very much Marcos for all your help!!

Marcos Didonet Del Fabro escribió:
> Hello,
>
> You cannot directly use the "Inject KM3 into Ecore Metamodel" to
> produce a weaving metamodel used by the AMW plug-in, because this
> transformation does not handle the annotations "subsets" and
> "welementRefType" that are defined in the AMW extensions.
>
> You can create an Ecore metamodel manually, and add these annotations,
> but this is not the most straightforward way. I recommend first to
> create a .km3, and to load this extension from the workspace when
> creating the weaving metamodel (first page of the wizard).
>
> After the weaving model is created with the root element, there is a
> menu "Create a Ecore metamodel" (I don't remember the exact text...).
> This menu creates a weaving metamodel with all the annotations.
>
> Than, you can use the generated Ecore metamodel in your HOTs.
>
>
> Regards,
>
> Marcos.
>
> Juan Pedro Silva wrote:
>> 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
>>
>>
Previous Topic:WAssociation/WAssociationEnd concepts
Next Topic:ERROR: could not find operation getReferredElement
Goto Forum:
  


Current Time: Fri Apr 26 01:13:13 GMT 2024

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

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

Back to the top