Home » Archived » AMW » Model combination.
|
Re: Model combination. [message #468673 is a reply to message #468661] |
Wed, 19 November 2008 17:19 |
Marcos Didonet Del Fabro Messages: 84 Registered: July 2009 |
Member |
|
|
Hello,
In aspect oriented modeling, the metamodels are combined. It would be
the creation of MMA + SecureUML metamodel based on links between MMA and
SecureUML.
Your case seems more similar to the "Merge of geographical data" use
case. http://www.eclipse.org/gmt/amw/usecases/mergeSVG/.
This is a complex case, where the generated transformation must take two
models as input and produce one model as output. You need a special
extension of AMW to support this kind of scenario. Take a look on this
use case to see if you can get some inspiration. :) Let me know if you
have any other questions.
Regards,
Marcos.
Juan Pedro Silva wrote:
> Hi Marcos and everybody.
> I'm trying to use AMW for the first time, and I believe I could use some
> help from people with more knowledge of it than me.
>
> I would like to use AMW to combine models (in a sort of Aspect-Oriented
> Modeling). I have a Model 'IN1' corresponding to Meta-Model "A"
> (something like a simpler version of UML), and a second model "IN2",
> that is a security model that corresponds to SecureUML metamodel. I
> wanted to combine this two models into a target model that corresponds
> to a metamodel that is the result of the merging of the first two (see
> the attached picture). This "combination" of the models is more than a
> mere merging.
>
> How could I do this?. In the use cases I saw from the website there is
> always one input model and some matching rules to generate one output
> model (sort of as in a simple ATL transformation).
> I tried using the wizard declaring two input models (IN1 and IN2) and
> the output metamodel, but when it comes to choosing the input, I can
> only choose one element from either one of the input models.
>
> I believe I'm missing the big picture here, and I surely need some
> advice to get going.
> Any help will be greatly appreciated.
> Regards,
> Juan Pedro
>
>
> ------------------------------------------------------------ ------------
>
|
|
|
Re: Model combination. [message #469155 is a reply to message #468673] |
Fri, 23 January 2009 15:14 |
Juan Pedro Silva Messages: 258 Registered: July 2009 |
Senior Member |
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Marcos, I'm back to this after some time doing some other stuff.<br>
I have a doubt regarding how to link the semantics of the
transformation with the definition of the weaving metamodel extensions.<br>
<br>
For example, I define the following extension (I based it on the AOM
use case):<br>
<font color="#3366ff"><small><br>
<font face="Courier New, Courier, monospace">class ResourceCombination
extends WLink {</font><br>
<font face="Courier New, Courier, monospace"> -- @subsets end</font><br>
<font face="Courier New, Courier, monospace"> reference
targetResource [*] container : </font></small><small><font
face="Courier New, Courier, monospace">Resource</font></small><small><font
face="Courier New, Courier, monospace">;</font><br>
<font face="Courier New, Courier, monospace"> </font><br>
<font face="Courier New, Courier, monospace"> -- @subsets end</font><br>
<font face="Courier New, Courier, monospace"> reference
createActions [*] container : </font></small><small><font
face="Courier New, Courier, monospace">Resource</font></small></font><small><font
color="#3366ff" face="Courier New, Courier, monospace">;</font><font
color="#3366ff"><br>
</font><font color="#3366ff" face="Courier New, Courier, monospace">
</font><font color="#3366ff"><br>
</font><font color="#3366ff" face="Courier New, Courier, monospace">} </font><font
color="#3366ff"><br>
</font><font color="#3366ff" face="Courier New, Courier, monospace">class
Resource extends WLinkEnd {</font><font color="#3366ff"><br>
</font><font color="#3366ff" face="Courier New, Courier, monospace">}</font><br>
</small><br>
and now I want to express that, when I draw a "ResourceCombination"
link, every action that exists on the "<small><font
face="Courier New, Courier, monospace">createActions</font></small>"
Resource should be created in the "targetResource" Resource (I want to
do more complicated things with it, but lets start with this). <br>
In atl, such rule would be:<br>
<small><font face="Courier New, Courier, monospace"><br>
<font color="#3366ff">rule ActionsToResource
--My guess is that the rule name doesn't affect<br>
{<br>
from <br>
cO : MMA!Resource<br>
to <br>
out : MMB!</font></font></small><small><font
face="Courier New, Courier, monospace"><font color="#3366ff">Resource</font></font></small><small><font
face="Courier New, Courier, monospace"><font color="#3366ff"> <br>
(<br>
action <- cO.action --where
"action" is a set of "Action" elements <br>
)<br>
}<br>
<br>
</font></font></small>What I don't know how to do is to associate the
weaving model (.amw) with the transformation rules (.atl), in order to
apply the weavings.<br>
How does the linking of the amw extensions with the rules takes place?.<br>
Thank you very much.<br>
Regards,<br>
Juan Pedro<br>
<br>
<br>
<br>
Marcos Didonet Del Fabro escribió:
<blockquote cite="mid:gg1hrd$qjn$1@build.eclipse.org" type="cite">Hello,
<br>
<br>
<br>
In aspect oriented modeling, the metamodels are combined. It would be
the creation of MMA + SecureUML metamodel based on links between MMA
and SecureUML.
<br>
<br>
Your case seems more similar to the "Merge of geographical data" use
case. <a class="moz-txt-link-freetext" href="http://www.eclipse.org/gmt/amw/usecases/mergeSVG/">http://www.eclipse.org/gmt/amw/usecases/mergeSVG/</a>.
<br>
<br>
This is a complex case, where the generated transformation must take
two models as input and produce one model as output. You need a special
extension of AMW to support this kind of scenario. Take a look on this
use case to see if you can get some inspiration. :) Let me know if you
have any other questions.
<br>
<br>
Regards,
<br>
<br>
Marcos.
<br>
<br>
Juan Pedro Silva wrote:
<br>
<blockquote type="cite">Hi Marcos and everybody.
<br>
I'm trying to use AMW for the first time, and I believe I could use
some help from people with more knowledge of it than me.
<br>
<br>
I would like to use AMW to combine models (in a sort of Aspect-Oriented
Modeling). I have a Model 'IN1' corresponding to Meta-Model "A"
(something like a simpler version of UML), and a second model "IN2",
that is a security model that corresponds to SecureUML metamodel. I
wanted to combine this two models into a target model that corresponds
to a metamodel that is the result of the merging of the first two (see
the attached picture). This "combination" of the models is more than a
mere merging.
<br>
<br>
How could I do this?. In the use cases I saw from the website there is
always one input model and some matching rules to generate one output
model (sort of as in a simple ATL transformation).
<br>
I tried using the wizard declaring two input models (IN1 and IN2) and
the output metamodel, but when it comes to choosing the input, I can
only choose one element from either one of the input models.
<br>
<br>
I believe I'm missing the big picture here, and I surely need some
advice to get going.
<br>
Any help will be greatly appreciated.
<br>
Regards,
<br>
Juan Pedro
<br>
<br>
<br>
------------------------------------------------------------ ------------
<br>
<br>
</blockquote>
</blockquote>
</body>
</html>
|
|
|
Re: Model combination. [message #469160 is a reply to message #469155] |
Tue, 27 January 2009 16:13 |
Marcos Didonet Del Fabro Messages: 84 Registered: July 2009 |
Member |
|
|
Hello,
I didn't understand what you mean by "linking the rules with ATL".
You can set the weaving model as input (or output) in the ATL
transformation, and than use it in different ways. I depict some below:
The signature of the transformation would be the following:
module MyModule create OUT : MMB from IN : MMA, IN2 : AMW;
1) Matching the weaving link + the target actions:
rule MatchLink {
from
link : AMW!ResourceCombination, resource : MMA!Resource (some
condition to verify the correct input resource )
to
out : MMB!Resource (
action <- -- check for the target resource actions
-- see the AMW model handler Wiki
(http://wiki.eclipse.org/index.php/AMW_Model_Handler) to check how the
getReffered() method works)
)
}
2) you can create the rule similar as the one you have, and search for
the linked elements.
rule ActionsToResource {
from
cO : MMA!Resource
to
out : MMB!Resource
(
action <- cO.getOutputActions() -- The helper is created
for better readability.
)
}
helper context MMA!Resource getOutputActions() : Sequence (MMA!Action) =
-- the helper should search for the ResourceCombination links and
that returns the model elements based on the values of the references
targetResource and createAction.
Regards,
Marcos.
Juan Pedro Silva wrote:
> Marcos, I'm back to this after some time doing some other stuff.
> I have a doubt regarding how to link the semantics of the transformation
> with the definition of the weaving metamodel extensions.
>
> For example, I define the following extension (I based it on the AOM use
> case):
>
> class ResourceCombination extends WLink {
> -- @subsets end
> reference targetResource [*] container : Resource;
>
> -- @subsets end
> reference createActions [*] container : Resource;
>
> }
> class Resource extends WLinkEnd {
> }
>
> and now I want to express that, when I draw a "ResourceCombination"
> link, every action that exists on the "createActions" Resource should be
> created in the "targetResource" Resource (I want to do more complicated
> things with it, but lets start with this).
> In atl, such rule would be:
>
> rule ActionsToResource --My guess
> is that the rule name doesn't affect
> {
> from
> cO : MMA!Resource
> to
> out : MMB!Resource
> (
> action <- cO.action --where
> "action" is a set of "Action" elements
> )
> }
>
> What I don't know how to do is to associate the weaving model (.amw)
> with the transformation rules (.atl), in order to apply the weavings.
> How does the linking of the amw extensions with the rules takes place?.
> Thank you very much.
> Regards,
> Juan Pedro
>
>
>
> Marcos Didonet Del Fabro escribió:
>> Hello,
>>
>>
>> In aspect oriented modeling, the metamodels are combined. It would be
>> the creation of MMA + SecureUML metamodel based on links between MMA
>> and SecureUML.
>>
>> Your case seems more similar to the "Merge of geographical data" use
>> case. http://www.eclipse.org/gmt/amw/usecases/mergeSVG/.
>>
>> This is a complex case, where the generated transformation must take
>> two models as input and produce one model as output. You need a
>> special extension of AMW to support this kind of scenario. Take a look
>> on this use case to see if you can get some inspiration. :) Let me
>> know if you have any other questions.
>>
>> Regards,
>>
>> Marcos.
>>
>> Juan Pedro Silva wrote:
>>> Hi Marcos and everybody.
>>> I'm trying to use AMW for the first time, and I believe I could use
>>> some help from people with more knowledge of it than me.
>>>
>>> I would like to use AMW to combine models (in a sort of
>>> Aspect-Oriented Modeling). I have a Model 'IN1' corresponding to
>>> Meta-Model "A" (something like a simpler version of UML), and a
>>> second model "IN2", that is a security model that corresponds to
>>> SecureUML metamodel. I wanted to combine this two models into a
>>> target model that corresponds to a metamodel that is the result of
>>> the merging of the first two (see the attached picture). This
>>> "combination" of the models is more than a mere merging.
>>>
>>> How could I do this?. In the use cases I saw from the website there
>>> is always one input model and some matching rules to generate one
>>> output model (sort of as in a simple ATL transformation).
>>> I tried using the wizard declaring two input models (IN1 and IN2) and
>>> the output metamodel, but when it comes to choosing the input, I can
>>> only choose one element from either one of the input models.
>>>
>>> I believe I'm missing the big picture here, and I surely need some
>>> advice to get going.
>>> Any help will be greatly appreciated.
>>> Regards,
>>> Juan Pedro
>>>
>>>
>>> ------------------------------------------------------------ ------------
>>>
|
|
|
Re: Model combination. [message #469162 is a reply to message #469160] |
Thu, 29 January 2009 14:38 |
Juan Pedro Silva Messages: 258 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------010809020301050802000102
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Marcos, sorry for not being clear.<br>
Your answer is of great help to manually generate the transformations.
I'm currently generating the weaving model manually, but it will take
some time to finish due to the size (moderate, but not small) of the
metamodels. After that I'll give this a try.<br>
<br>
I was referring to the HOT (or "transfGen", as you call it in your phd
Thesis).<br>
I'm having problems with the automatic generation of the
transformation, in various steps.<br>
What I'm trying to do at this point (I postponed the combination of
models until I get this right) is:<br>
<ol>
<li>An automatic Matching model (as in the "Metamodel comparison use
case") for my own metamodels.<br>
</li>
<li>Manually tune this model with some other wlink extensions
(previously loading my km3 extension).</li>
<li>Generate the ATL transformation (HOT) by means of the AMW context
menu option.</li>
</ol>
However, I'm getting errors in step 1. I can execute the "Metamodel
Match -> Cartesian Product" (takes long but works), but I get errors
when running the "Name Equality" on the cp result (I'm attaching the
console output). I also get an error while trying step 3 on a partial
weaving model, but as the weaving model was partial and manual, I'll
wait until it is complete and try again.<br>
<br>
The question would be, are there any conditions on the metamodels in
order for the matching to work?, and is the available HOT general
enough for using it with our own weaving-metamodel extensions, or I am
supposed to make my own HOTs for them?.<br>
<br>
Thanks again, Marcos.<br>
Regards,<br>
Juan Pedro<br>
<br>
<br>
<br>
Marcos Didonet Del Fabro escribió:
<blockquote cite="mid:glnbrk$76u$1@build.eclipse.org" type="cite"><br>
Hello,
<br>
<br>
I didn't understand what you mean by "linking the rules with ATL".
<br>
<br>
You can set the weaving model as input (or output) in the ATL
transformation, and than use it in different ways. I depict some below:
<br>
<br>
The signature of the transformation would be the following:
<br>
<br>
module MyModule create OUT : MMB from IN : MMA, IN2 : AMW;
<br>
<br>
1) Matching the weaving link + the target actions:
<br>
<br>
rule MatchLink {
<br>
<br>
from
<br>
link : AMW!ResourceCombination, resource : MMA!Resource (some
condition to verify the correct input resource )
<br>
<br>
to
<br>
out : MMB!Resource (
<br>
action <- -- check for the target resource actions
<br>
-- see the AMW model handler Wiki
(<a class="moz-txt-link-freetext" href="http://wiki.eclipse.org/index.php/AMW_Model_Handler">http://wiki.eclipse.org/index.php/AMW_Model_Handler</a>) to check how the
getReffered() method works)
<br>
)
<br>
<br>
}
<br>
<br>
2) you can create the rule similar as the one you have, and search for
the linked elements.
<br>
<br>
rule ActionsToResource {
<br>
from
<br>
cO : MMA!Resource
<br>
to
<br>
out : MMB!Resource
<br>
(
<br>
action <- cO.getOutputActions() -- The helper is
created for better readability.
<br>
)
<br>
}
<br>
<br>
<br>
helper context MMA!Resource getOutputActions() : Sequence (MMA!Action)
=
<br>
-- the helper should search for the ResourceCombination links and
that returns the model elements based on the values of the references
targetResource and createAction.
<br>
<br>
<br>
Regards,
<br>
<br>
Marcos.
<br>
<br>
<br>
<br>
Juan Pedro Silva wrote:
<br>
<blockquote type="cite">Marcos, I'm back to this after some time
doing some other stuff.
<br>
I have a doubt regarding how to link the semantics of the
transformation with the definition of the weaving metamodel extensions.
<br>
<br>
For example, I define the following extension (I based it on the AOM
use case):
<br>
<br>
class ResourceCombination extends WLink {
<br>
-- @subsets end
<br>
reference targetResource [*] container : Resource;
<br>
-- @subsets end
<br>
reference createActions [*] container : Resource;
<br>
}
<br>
class Resource extends WLinkEnd {
<br>
}
<br>
<br>
and now I want to express that, when I draw a "ResourceCombination"
link, every action that exists on the "createActions" Resource should
be created in the "targetResource" Resource (I want to do more
complicated things with it, but lets start with this).
<br>
In atl, such rule would be:
<br>
<br>
rule ActionsToResource &am p;nbsp; &am p;nbsp; &am p;nbsp; &am p;nbsp; &am p;nbsp; &am p;nbsp; --My guess
is that the rule name doesn't affect
<br>
{
<br>
from
<br>
cO : MMA!Resource
<br>
to
<br>
out : MMB!Resource
<br>
(
<br>
action & ;nbsp; <- cO.action & amp;nbsp; & amp;nbsp; --where
"action" is a set of "Action" elements &a mp;nbsp; &a mp;nbsp; &a mp;nbsp; )
<br>
}
<br>
<br>
What I don't know how to do is to associate the weaving model (.amw)
with the transformation rules (.atl), in order to apply the weavings.
<br>
How does the linking of the amw extensions with the rules takes place?.
<br>
Thank you very much.
<br>
Regards,
<br>
Juan Pedro
<br>
<br>
<br>
<br>
Marcos Didonet Del Fabro escribió:
<br>
<blockquote type="cite">Hello,
<br>
<br>
<br>
In aspect oriented modeling, the metamodels are combined. It would be
the creation of MMA + SecureUML metamodel based on links between MMA
and SecureUML.
<br>
<br>
Your case seems more similar to the "Merge of geographical data" use
case. <a class="moz-txt-link-freetext" href="http://www.eclipse.org/gmt/amw/usecases/mergeSVG/">http://www.eclipse.org/gmt/amw/usecases/mergeSVG/</a>.
<br>
<br>
This is a complex case, where the generated transformation must take
two models as input and produce one model as output. You need a special
extension of AMW to support this kind of scenario. Take a look on this
use case to see if you can get some inspiration. :) Let me know if you
have any other questions.
<br>
<br>
Regards,
<br>
<br>
Marcos.
<br>
<br>
Juan Pedro Silva wrote:
<br>
<blockquote type="cite">Hi Marcos and everybody.
<br>
I'm trying to use AMW for the first time, and I believe I could use
some help from people with more knowledge of it than me.
<br>
<br>
I would like to use AMW to combine models (in a sort of Aspect-Oriented
Modeling). I have a Model 'IN1' corresponding to Meta-Model "A"
(something like a simpler version of UML), and a second model "IN2",
that is a security model that corresponds to SecureUML metamodel. I
wanted to combine this two models into a target model that corresponds
to a metamodel that is the result of the merging of the first two (see
the attached picture). This "combination" of the models is more than a
mere merging.
<br>
<br>
How could I do this?. In the use cases I saw from the website there is
always one input model and some matching rules to generate one output
model (sort of as in a simple ATL transformation).
<br>
I tried using the wizard declaring two input models (IN1 and IN2) and
the output metamodel, but when it comes to choosing the input, I can
only choose one element from either one of the input models.
<br>
<br>
I believe I'm missing the big picture here, and I surely need some
advice to get going.
<br>
Any help will be greatly appreciated.
<br>
Regards,
<br>
Juan Pedro
<br>
<br>
<br>
------------------------------------------------------------ ------------
<br>
<br>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</body>
</html>
--------------010809020301050802000102
Content-Type: text/plain;
name="Error_Console.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="Error_Console.txt"
GRAVE: ****** BEGIN Stack Trace
GRAVE: exception:
GRAVE: null
java.lang.reflect.InvocationTargetException
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.m2m.atl.engine.vm.ClassNativeOperation.exec(Clas sNativeOperation.java:69)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
at org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.invok e(ASMEMFModelElement.java:683)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:335)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:101)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:101)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
at org.eclipse.m2m.atl.engine.vm.ASMInterpreter.<init>(ASMInterpreter.java:299)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:167)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:111)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:87)
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:583)
at org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:500)
at org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:386)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
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: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
Caused by: java.lang.NullPointerException
at org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.getMe taobject(ASMEMFModelElement.java:422)
at org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.<init >(ASMEMFModelElement.java:557)
at org.eclipse.gmt.weaver.amw4atl.ASMAMWModelElement.<init>(ASMAMWModelElement.java:43)
at org.eclipse.gmt.weaver.amw4atl.ASMAMWModel.getASMModelElemen t(ASMAMWModel.java:361)
at org.eclipse.gmt.weaver.amw4atl.ASMAMWModelElement.getModelEl ement(ASMAMWModelElement.java:159)
at org.eclipse.gmt.weaver.amw4atl.ASMAMWModelElement.getReferre dElement(ASMAMWModelElement.java:194)
... 52 more
GRAVE: A.main() : ??#22 null
GRAVE: local variables = {self=NameEqualitybyType : ASMModule}
GRAVE: local stack = []
GRAVE: A.__matcher__() : ??#1 null
GRAVE: local variables = {self=NameEqualitybyType : ASMModule}
GRAVE: local stack = []
GRAVE: A.__matchprClass() : ??#31 37:53-37:83
GRAVE: local variables = {left=left!UIComboBox, mmw=IN!UIComboBox_EAnnotation, self=NameEqualitybyType : ASMModule}
GRAVE: local stack = [TransientLinkSet {}, TransientLink {rule = 'prClass', sourceElements = {mmw = IN!UIComboBox_EAnnotation}, targetElements = {}, variables = {left = left!UIComboBox}}, TransientLink {rule = 'prClass', sourceElements = {mmw = IN!UIComboBox_EAnnotation}, targetElements = {}, variables = {left = left!UIComboBox}}, 'right']
GRAVE: NativeOperation public static org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny org.eclipse.gmt.weaver.amw4atl.ASMAMWModelElement.getReferre dElement(org.eclipse.m2m.atl.engine.vm.StackFrame,org.eclips e.m2m.atl.drivers.emf4atl.ASMEMFModelElement)
GRAVE: args = [IN!EAnnotation]
GRAVE: ****** END Stack Trace
INFO: Execution terminated due to error (see launch configuration to allow continuation after errors).
GRAVE: null
java.lang.RuntimeException
at org.eclipse.m2m.atl.engine.vm.SimpleDebugger.error(SimpleDeb ugger.java:195)
at org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(Sta ckFrame.java:95)
at org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(Sta ckFrame.java:87)
at org.eclipse.m2m.atl.engine.vm.ClassNativeOperation.exec(Clas sNativeOperation.java:77)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
at org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.invok e(ASMEMFModelElement.java:683)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:335)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:101)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:101)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
at org.eclipse.m2m.atl.engine.vm.ASMInterpreter.<init>(ASMInterpreter.java:299)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:167)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:111)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:87)
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:583)
at org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:500)
at org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:386)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
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: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
Caused by: java.lang.reflect.InvocationTargetException
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.m2m.atl.engine.vm.ClassNativeOperation.exec(Clas sNativeOperation.java:69)
... 47 more
Caused by: java.lang.NullPointerException
at org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.getMe taobject(ASMEMFModelElement.java:422)
at org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.<init >(ASMEMFModelElement.java:557)
at org.eclipse.gmt.weaver.amw4atl.ASMAMWModelElement.<init>(ASMAMWModelElement.java:43)
at org.eclipse.gmt.weaver.amw4atl.ASMAMWModel.getASMModelElemen t(ASMAMWModel.java:361)
at org.eclipse.gmt.weaver.amw4atl.ASMAMWModelElement.getModelEl ement(ASMAMWModelElement.java:159)
at org.eclipse.gmt.weaver.amw4atl.ASMAMWModelElement.getReferre dElement(ASMAMWModelElement.java:194)
... 52 more
--------------010809020301050802000102--
|
|
|
Re: Model combination. [message #469545 is a reply to message #469162] |
Fri, 30 January 2009 08:54 |
Marcos Didonet Del Fabro Messages: 84 Registered: July 2009 |
Member |
|
|
Hello,
The matching transformations, as well as the corresponding HOTs, are
implemented based on specific extensions to the AMW core metamodel. If
you want to use new extensions, the HOT must be extended to be able to
support them.
To execute the matching transformations of the plug-in, the following
extensions are needed:
- mw_base_ext
- mmw_match (equality, cardinality, type and conformance, Cartesian
product, link rewriting, threshold)
- mm_propagation (SF, propagation graph)
- mmw_compare (not equivalence)
If you add new extensions, the transformations won't produce any
additional result, since they are not aware of the existence of new
types of links.
Now, looking at your error log, it seems that you don't have any element
associated to the "right" reference:
variables = {left = left!UIComboBox}}, 'right']
The transformations need to have the "left" and "right" references set
up in the weaving model.
Regards,
Marcos.
Juan Pedro Silva wrote:
> Hi Marcos, sorry for not being clear.
> Your answer is of great help to manually generate the transformations.
> I'm currently generating the weaving model manually, but it will take
> some time to finish due to the size (moderate, but not small) of the
> metamodels. After that I'll give this a try.
>
> I was referring to the HOT (or "transfGen", as you call it in your phd
> Thesis).
> I'm having problems with the automatic generation of the transformation,
> in various steps.
> What I'm trying to do at this point (I postponed the combination of
> models until I get this right) is:
>
> 1. An automatic Matching model (as in the "Metamodel comparison use
> case") for my own metamodels.
> 2. Manually tune this model with some other wlink extensions
> (previously loading my km3 extension).
> 3. Generate the ATL transformation (HOT) by means of the AMW context
> menu option.
>
> However, I'm getting errors in step 1. I can execute the "Metamodel
> Match -> Cartesian Product" (takes long but works), but I get errors
> when running the "Name Equality" on the cp result (I'm attaching the
> console output). I also get an error while trying step 3 on a partial
> weaving model, but as the weaving model was partial and manual, I'll
> wait until it is complete and try again.
>
> The question would be, are there any conditions on the metamodels in
> order for the matching to work?, and is the available HOT general enough
> for using it with our own weaving-metamodel extensions, or I am supposed
> to make my own HOTs for them?.
>
> Thanks again, Marcos.
> Regards,
> Juan Pedro
>
>
>
> Marcos Didonet Del Fabro escribió:
>>
>> Hello,
>>
>> I didn't understand what you mean by "linking the rules with ATL".
>>
>> You can set the weaving model as input (or output) in the ATL
>> transformation, and than use it in different ways. I depict some below:
>>
>> The signature of the transformation would be the following:
>>
>> module MyModule create OUT : MMB from IN : MMA, IN2 : AMW;
>>
>> 1) Matching the weaving link + the target actions:
>>
>> rule MatchLink {
>>
>> from
>> link : AMW!ResourceCombination, resource : MMA!Resource (some
>> condition to verify the correct input resource )
>>
>> to
>> out : MMB!Resource (
>> action <- -- check for the target resource actions
>> -- see the AMW model handler Wiki
>> (http://wiki.eclipse.org/index.php/AMW_Model_Handler) to check how the
>> getReffered() method works)
>> )
>>
>> }
>>
>> 2) you can create the rule similar as the one you have, and search for
>> the linked elements.
>>
>> rule ActionsToResource {
>> from
>> cO : MMA!Resource
>> to
>> out : MMB!Resource
>> (
>> action <- cO.getOutputActions() -- The helper is created
>> for better readability.
>> )
>> }
>>
>>
>> helper context MMA!Resource getOutputActions() : Sequence (MMA!Action) =
>> -- the helper should search for the ResourceCombination links and
>> that returns the model elements based on the values of the references
>> targetResource and createAction.
>>
>>
>> Regards,
>>
>> Marcos.
>>
>>
>>
>> Juan Pedro Silva wrote:
>>> Marcos, I'm back to this after some time doing some other stuff.
>>> I have a doubt regarding how to link the semantics of the
>>> transformation with the definition of the weaving metamodel extensions.
>>>
>>> For example, I define the following extension (I based it on the AOM
>>> use case):
>>>
>>> class ResourceCombination extends WLink {
>>> -- @subsets end
>>> reference targetResource [*] container : Resource;
>>> -- @subsets end
>>> reference createActions [*] container : Resource;
>>> }
>>> class Resource extends WLinkEnd {
>>> }
>>>
>>> and now I want to express that, when I draw a "ResourceCombination"
>>> link, every action that exists on the "createActions" Resource should
>>> be created in the "targetResource" Resource (I want to do more
>>> complicated things with it, but lets start with this).
>>> In atl, such rule would be:
>>>
>>> rule ActionsToResource --My
>>> guess is that the rule name doesn't affect
>>> {
>>> from
>>> cO : MMA!Resource
>>> to
>>> out : MMB!Resource
>>> (
>>> action <- cO.action --where
>>> "action" is a set of "Action" elements )
>>> }
>>>
>>> What I don't know how to do is to associate the weaving model (.amw)
>>> with the transformation rules (.atl), in order to apply the weavings.
>>> How does the linking of the amw extensions with the rules takes place?.
>>> Thank you very much.
>>> Regards,
>>> Juan Pedro
>>>
>>>
>>>
>>> Marcos Didonet Del Fabro escribió:
>>>> Hello,
>>>>
>>>>
>>>> In aspect oriented modeling, the metamodels are combined. It would
>>>> be the creation of MMA + SecureUML metamodel based on links between
>>>> MMA and SecureUML.
>>>>
>>>> Your case seems more similar to the "Merge of geographical data" use
>>>> case. http://www.eclipse.org/gmt/amw/usecases/mergeSVG/.
>>>>
>>>> This is a complex case, where the generated transformation must take
>>>> two models as input and produce one model as output. You need a
>>>> special extension of AMW to support this kind of scenario. Take a
>>>> look on this use case to see if you can get some inspiration. :) Let
>>>> me know if you have any other questions.
>>>>
>>>> Regards,
>>>>
>>>> Marcos.
>>>>
>>>> Juan Pedro Silva wrote:
>>>>> Hi Marcos and everybody.
>>>>> I'm trying to use AMW for the first time, and I believe I could use
>>>>> some help from people with more knowledge of it than me.
>>>>>
>>>>> I would like to use AMW to combine models (in a sort of
>>>>> Aspect-Oriented Modeling). I have a Model 'IN1' corresponding to
>>>>> Meta-Model "A" (something like a simpler version of UML), and a
>>>>> second model "IN2", that is a security model that corresponds to
>>>>> SecureUML metamodel. I wanted to combine this two models into a
>>>>> target model that corresponds to a metamodel that is the result of
>>>>> the merging of the first two (see the attached picture). This
>>>>> "combination" of the models is more than a mere merging.
>>>>>
>>>>> How could I do this?. In the use cases I saw from the website there
>>>>> is always one input model and some matching rules to generate one
>>>>> output model (sort of as in a simple ATL transformation).
>>>>> I tried using the wizard declaring two input models (IN1 and IN2)
>>>>> and the output metamodel, but when it comes to choosing the input,
>>>>> I can only choose one element from either one of the input models.
>>>>>
>>>>> I believe I'm missing the big picture here, and I surely need some
>>>>> advice to get going.
>>>>> Any help will be greatly appreciated.
>>>>> Regards,
>>>>> Juan Pedro
>>>>>
>>>>>
>>>>> ------------------------------------------------------------ ------------
>>>>>
>>>>>
|
|
|
Re: Model combination. [message #469548 is a reply to message #469545] |
Fri, 30 January 2009 12:36 |
Juan Pedro Silva Messages: 258 Registered: July 2009 |
Senior Member |
|
|
Hi Marcos, thanks for your quick answer.
Ok on the HOT, I'll work on it.
Regarding the matching operations, I was using the extensions you
enumerated, and no others. I was following the "Metamodel comparison"
use case verbatim with my own metamodels.
The input model for the "Name Equality" matching operation was the
output of the "cartesian product" operation. Validating this model
returns no error or warnings.
I looked for the matching rule (in the "_cp.amw") model that shows up in
the error stack ("UIComboBox_EAnnotation"), and it has a right element:
<ownedElement xsi:type="ElementEqual" name="UIComboBox_EAnnotation"
similarity="0.0">
<left xsi:type="LeftElement" name="UIComboBox"
element="//@leftM/@ownedElementRef.18"/>
<right xsi:type="RightElement" name="EAnnotation"
element="//@rightM/@ownedElementRef.108"/>
</ownedElement>
I even navigated throw the "_cp.amw" file (opening it with the text
editor) and found no rule that hadn't a right element (this was not
exhaustive, though, as there are 223214 lines in that file).
Re-running the "Name Equality" operation throws the same error but in a
different rule each time.
Any ideas?, would size be an issue?. I ask this because it takes quite
some time (a couple of minutes) to open this file with the AMW editor,
for instance.
Regards,
Juan Pedro
Marcos Didonet Del Fabro escribió:
> Hello,
>
> The matching transformations, as well as the corresponding HOTs, are
> implemented based on specific extensions to the AMW core metamodel. If
> you want to use new extensions, the HOT must be extended to be able to
> support them.
>
> To execute the matching transformations of the plug-in, the following
> extensions are needed:
> - mw_base_ext
> - mmw_match (equality, cardinality, type and conformance, Cartesian
> product, link rewriting, threshold)
> - mm_propagation (SF, propagation graph)
> - mmw_compare (not equivalence)
>
> If you add new extensions, the transformations won't produce any
> additional result, since they are not aware of the existence of new
> types of links.
>
> Now, looking at your error log, it seems that you don't have any
> element associated to the "right" reference:
>
> variables = {left = left!UIComboBox}}, 'right']
>
> The transformations need to have the "left" and "right" references set
> up in the weaving model.
>
> Regards,
>
> Marcos.
>
>
> Juan Pedro Silva wrote:
>> Hi Marcos, sorry for not being clear.
>> Your answer is of great help to manually generate the
>> transformations. I'm currently generating the weaving model manually,
>> but it will take some time to finish due to the size (moderate, but
>> not small) of the metamodels. After that I'll give this a try.
>>
>> I was referring to the HOT (or "transfGen", as you call it in your
>> phd Thesis).
>> I'm having problems with the automatic generation of the
>> transformation, in various steps.
>> What I'm trying to do at this point (I postponed the combination of
>> models until I get this right) is:
>>
>> 1. An automatic Matching model (as in the "Metamodel comparison use
>> case") for my own metamodels.
>> 2. Manually tune this model with some other wlink extensions
>> (previously loading my km3 extension).
>> 3. Generate the ATL transformation (HOT) by means of the AMW context
>> menu option.
>>
>> However, I'm getting errors in step 1. I can execute the "Metamodel
>> Match -> Cartesian Product" (takes long but works), but I get errors
>> when running the "Name Equality" on the cp result (I'm attaching the
>> console output). I also get an error while trying step 3 on a partial
>> weaving model, but as the weaving model was partial and manual, I'll
>> wait until it is complete and try again.
>>
>> The question would be, are there any conditions on the metamodels in
>> order for the matching to work?, and is the available HOT general
>> enough for using it with our own weaving-metamodel extensions, or I
>> am supposed to make my own HOTs for them?.
>>
>> Thanks again, Marcos.
>> Regards,
>> Juan Pedro
>>
>>
>>
>> Marcos Didonet Del Fabro escribió:
>>>
>>> Hello,
>>>
>>> I didn't understand what you mean by "linking the rules with ATL".
>>>
>>> You can set the weaving model as input (or output) in the ATL
>>> transformation, and than use it in different ways. I depict some below:
>>>
>>> The signature of the transformation would be the following:
>>>
>>> module MyModule create OUT : MMB from IN : MMA, IN2 : AMW;
>>>
>>> 1) Matching the weaving link + the target actions:
>>>
>>> rule MatchLink {
>>>
>>> from
>>> link : AMW!ResourceCombination, resource : MMA!Resource (some
>>> condition to verify the correct input resource )
>>>
>>> to
>>> out : MMB!Resource (
>>> action <- -- check for the target resource actions
>>> -- see the AMW model handler Wiki
>>> (http://wiki.eclipse.org/index.php/AMW_Model_Handler) to check how
>>> the getReffered() method works)
>>> )
>>>
>>> }
>>>
>>> 2) you can create the rule similar as the one you have, and search
>>> for the linked elements.
>>>
>>> rule ActionsToResource {
>>> from
>>> cO : MMA!Resource
>>> to
>>> out : MMB!Resource
>>> (
>>> action <- cO.getOutputActions() -- The helper is
>>> created for better readability.
>>> )
>>> }
>>>
>>>
>>> helper context MMA!Resource getOutputActions() : Sequence
>>> (MMA!Action) =
>>> -- the helper should search for the ResourceCombination links and
>>> that returns the model elements based on the values of the
>>> references targetResource and createAction.
>>>
>>>
>>> Regards,
>>>
>>> Marcos.
>>>
>>>
>>>
>>> Juan Pedro Silva wrote:
>>>> Marcos, I'm back to this after some time doing some other stuff.
>>>> I have a doubt regarding how to link the semantics of the
>>>> transformation with the definition of the weaving metamodel
>>>> extensions.
>>>>
>>>> For example, I define the following extension (I based it on the
>>>> AOM use case):
>>>>
>>>> class ResourceCombination extends WLink {
>>>> -- @subsets end
>>>> reference targetResource [*] container : Resource;
>>>> -- @subsets end
>>>> reference createActions [*] container : Resource;
>>>> }
>>>> class Resource extends WLinkEnd {
>>>> }
>>>>
>>>> and now I want to express that, when I draw a "ResourceCombination"
>>>> link, every action that exists on the "createActions" Resource
>>>> should be created in the "targetResource" Resource (I want to do
>>>> more complicated things with it, but lets start with this).
>>>> In atl, such rule would be:
>>>>
>>>> rule ActionsToResource --My
>>>> guess is that the rule name doesn't affect
>>>> {
>>>> from
>>>> cO : MMA!Resource
>>>> to
>>>> out : MMB!Resource
>>>> (
>>>> action <- cO.action --where
>>>> "action" is a set of "Action" elements )
>>>> }
>>>>
>>>> What I don't know how to do is to associate the weaving model
>>>> (.amw) with the transformation rules (.atl), in order to apply the
>>>> weavings.
>>>> How does the linking of the amw extensions with the rules takes
>>>> place?.
>>>> Thank you very much.
>>>> Regards,
>>>> Juan Pedro
>>>>
>>>>
>>>>
>>>> Marcos Didonet Del Fabro escribió:
>>>>> Hello,
>>>>>
>>>>>
>>>>> In aspect oriented modeling, the metamodels are combined. It would
>>>>> be the creation of MMA + SecureUML metamodel based on links
>>>>> between MMA and SecureUML.
>>>>>
>>>>> Your case seems more similar to the "Merge of geographical data"
>>>>> use case. http://www.eclipse.org/gmt/amw/usecases/mergeSVG/.
>>>>>
>>>>> This is a complex case, where the generated transformation must
>>>>> take two models as input and produce one model as output. You need
>>>>> a special extension of AMW to support this kind of scenario. Take
>>>>> a look on this use case to see if you can get some inspiration. :)
>>>>> Let me know if you have any other questions.
>>>>>
>>>>> Regards,
>>>>>
>>>>> Marcos.
>>>>>
>>>>> Juan Pedro Silva wrote:
>>>>>> Hi Marcos and everybody.
>>>>>> I'm trying to use AMW for the first time, and I believe I could
>>>>>> use some help from people with more knowledge of it than me.
>>>>>>
>>>>>> I would like to use AMW to combine models (in a sort of
>>>>>> Aspect-Oriented Modeling). I have a Model 'IN1' corresponding to
>>>>>> Meta-Model "A" (something like a simpler version of UML), and a
>>>>>> second model "IN2", that is a security model that corresponds to
>>>>>> SecureUML metamodel. I wanted to combine this two models into a
>>>>>> target model that corresponds to a metamodel that is the result
>>>>>> of the merging of the first two (see the attached picture). This
>>>>>> "combination" of the models is more than a mere merging.
>>>>>>
>>>>>> How could I do this?. In the use cases I saw from the website
>>>>>> there is always one input model and some matching rules to
>>>>>> generate one output model (sort of as in a simple ATL
>>>>>> transformation).
>>>>>> I tried using the wizard declaring two input models (IN1 and IN2)
>>>>>> and the output metamodel, but when it comes to choosing the
>>>>>> input, I can only choose one element from either one of the input
>>>>>> models.
>>>>>>
>>>>>> I believe I'm missing the big picture here, and I surely need
>>>>>> some advice to get going.
>>>>>> Any help will be greatly appreciated.
>>>>>> Regards,
>>>>>> Juan Pedro
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------ ------------
>>>>>>
>>>>>>
|
|
|
Re: Model combination. [message #469551 is a reply to message #469548] |
Fri, 30 January 2009 12:53 |
Marcos Didonet Del Fabro Messages: 84 Registered: July 2009 |
Member |
|
|
Hi,
The problem is that it didn't find the right element (it returned a
"null" in the getElementRef method. However, I cannot say why this is
happening. Maybe there is a path problem or something related.
Can you copy the value of the "rightM" and "leftM" elements, and an
excerpt of the .prop.amw.file with the file paths?
The "rightM" element looks like the following:
<rightM xsi:type="_1:ModelRef" xmi:id="ModelRef2" name="rightM"
ref="/<metamodelpath>.ecore">
Marcos.
Juan Pedro Silva wrote:
> Hi Marcos, thanks for your quick answer.
> Ok on the HOT, I'll work on it.
> Regarding the matching operations, I was using the extensions you
> enumerated, and no others. I was following the "Metamodel comparison"
> use case verbatim with my own metamodels.
> The input model for the "Name Equality" matching operation was the
> output of the "cartesian product" operation. Validating this model
> returns no error or warnings.
>
> I looked for the matching rule (in the "_cp.amw") model that shows up in
> the error stack ("UIComboBox_EAnnotation"), and it has a right element:
>
> <ownedElement xsi:type="ElementEqual" name="UIComboBox_EAnnotation"
> similarity="0.0">
> <left xsi:type="LeftElement" name="UIComboBox"
> element="//@leftM/@ownedElementRef.18"/>
> <right xsi:type="RightElement" name="EAnnotation"
> element="//@rightM/@ownedElementRef.108"/>
> </ownedElement>
>
> I even navigated throw the "_cp.amw" file (opening it with the text
> editor) and found no rule that hadn't a right element (this was not
> exhaustive, though, as there are 223214 lines in that file).
> Re-running the "Name Equality" operation throws the same error but in a
> different rule each time.
> Any ideas?, would size be an issue?. I ask this because it takes quite
> some time (a couple of minutes) to open this file with the AMW editor,
> for instance.
> Regards,
> Juan Pedro
>
>
> Marcos Didonet Del Fabro escribió:
>> Hello,
>>
>> The matching transformations, as well as the corresponding HOTs, are
>> implemented based on specific extensions to the AMW core metamodel. If
>> you want to use new extensions, the HOT must be extended to be able to
>> support them.
>>
>> To execute the matching transformations of the plug-in, the following
>> extensions are needed:
>> - mw_base_ext
>> - mmw_match (equality, cardinality, type and conformance, Cartesian
>> product, link rewriting, threshold)
>> - mm_propagation (SF, propagation graph)
>> - mmw_compare (not equivalence)
>>
>> If you add new extensions, the transformations won't produce any
>> additional result, since they are not aware of the existence of new
>> types of links.
>>
>> Now, looking at your error log, it seems that you don't have any
>> element associated to the "right" reference:
>>
>> variables = {left = left!UIComboBox}}, 'right']
>>
>> The transformations need to have the "left" and "right" references set
>> up in the weaving model.
>>
>> Regards,
>>
>> Marcos.
>>
>>
>> Juan Pedro Silva wrote:
>>> Hi Marcos, sorry for not being clear.
>>> Your answer is of great help to manually generate the
>>> transformations. I'm currently generating the weaving model manually,
>>> but it will take some time to finish due to the size (moderate, but
>>> not small) of the metamodels. After that I'll give this a try.
>>>
>>> I was referring to the HOT (or "transfGen", as you call it in your
>>> phd Thesis).
>>> I'm having problems with the automatic generation of the
>>> transformation, in various steps.
>>> What I'm trying to do at this point (I postponed the combination of
>>> models until I get this right) is:
>>>
>>> 1. An automatic Matching model (as in the "Metamodel comparison use
>>> case") for my own metamodels.
>>> 2. Manually tune this model with some other wlink extensions
>>> (previously loading my km3 extension).
>>> 3. Generate the ATL transformation (HOT) by means of the AMW context
>>> menu option.
>>>
>>> However, I'm getting errors in step 1. I can execute the "Metamodel
>>> Match -> Cartesian Product" (takes long but works), but I get errors
>>> when running the "Name Equality" on the cp result (I'm attaching the
>>> console output). I also get an error while trying step 3 on a partial
>>> weaving model, but as the weaving model was partial and manual, I'll
>>> wait until it is complete and try again.
>>>
>>> The question would be, are there any conditions on the metamodels in
>>> order for the matching to work?, and is the available HOT general
>>> enough for using it with our own weaving-metamodel extensions, or I
>>> am supposed to make my own HOTs for them?.
>>>
>>> Thanks again, Marcos.
>>> Regards,
>>> Juan Pedro
>>>
>>>
>>>
>>> Marcos Didonet Del Fabro escribió:
>>>>
>>>> Hello,
>>>>
>>>> I didn't understand what you mean by "linking the rules with ATL".
>>>>
>>>> You can set the weaving model as input (or output) in the ATL
>>>> transformation, and than use it in different ways. I depict some below:
>>>>
>>>> The signature of the transformation would be the following:
>>>>
>>>> module MyModule create OUT : MMB from IN : MMA, IN2 : AMW;
>>>>
>>>> 1) Matching the weaving link + the target actions:
>>>>
>>>> rule MatchLink {
>>>>
>>>> from
>>>> link : AMW!ResourceCombination, resource : MMA!Resource (some
>>>> condition to verify the correct input resource )
>>>>
>>>> to
>>>> out : MMB!Resource (
>>>> action <- -- check for the target resource actions
>>>> -- see the AMW model handler Wiki
>>>> (http://wiki.eclipse.org/index.php/AMW_Model_Handler) to check how
>>>> the getReffered() method works)
>>>> )
>>>>
>>>> }
>>>>
>>>> 2) you can create the rule similar as the one you have, and search
>>>> for the linked elements.
>>>>
>>>> rule ActionsToResource {
>>>> from
>>>> cO : MMA!Resource
>>>> to
>>>> out : MMB!Resource
>>>> (
>>>> action <- cO.getOutputActions() -- The helper is
>>>> created for better readability.
>>>> )
>>>> }
>>>>
>>>>
>>>> helper context MMA!Resource getOutputActions() : Sequence
>>>> (MMA!Action) =
>>>> -- the helper should search for the ResourceCombination links and
>>>> that returns the model elements based on the values of the
>>>> references targetResource and createAction.
>>>>
>>>>
>>>> Regards,
>>>>
>>>> Marcos.
>>>>
>>>>
>>>>
>>>> Juan Pedro Silva wrote:
>>>>> Marcos, I'm back to this after some time doing some other stuff.
>>>>> I have a doubt regarding how to link the semantics of the
>>>>> transformation with the definition of the weaving metamodel
>>>>> extensions.
>>>>>
>>>>> For example, I define the following extension (I based it on the
>>>>> AOM use case):
>>>>>
>>>>> class ResourceCombination extends WLink {
>>>>> -- @subsets end
>>>>> reference targetResource [*] container : Resource;
>>>>> -- @subsets end
>>>>> reference createActions [*] container : Resource;
>>>>> }
>>>>> class Resource extends WLinkEnd {
>>>>> }
>>>>>
>>>>> and now I want to express that, when I draw a "ResourceCombination"
>>>>> link, every action that exists on the "createActions" Resource
>>>>> should be created in the "targetResource" Resource (I want to do
>>>>> more complicated things with it, but lets start with this).
>>>>> In atl, such rule would be:
>>>>>
>>>>> rule ActionsToResource --My
>>>>> guess is that the rule name doesn't affect
>>>>> {
>>>>> from
>>>>> cO : MMA!Resource
>>>>> to
>>>>> out : MMB!Resource
>>>>> (
>>>>> action <- cO.action --where
>>>>> "action" is a set of "Action" elements )
>>>>> }
>>>>>
>>>>> What I don't know how to do is to associate the weaving model
>>>>> (.amw) with the transformation rules (.atl), in order to apply the
>>>>> weavings.
>>>>> How does the linking of the amw extensions with the rules takes
>>>>> place?.
>>>>> Thank you very much.
>>>>> Regards,
>>>>> Juan Pedro
>>>>>
>>>>>
>>>>>
>>>>> Marcos Didonet Del Fabro escribió:
>>>>>> Hello,
>>>>>>
>>>>>>
>>>>>> In aspect oriented modeling, the metamodels are combined. It would
>>>>>> be the creation of MMA + SecureUML metamodel based on links
>>>>>> between MMA and SecureUML.
>>>>>>
>>>>>> Your case seems more similar to the "Merge of geographical data"
>>>>>> use case. http://www.eclipse.org/gmt/amw/usecases/mergeSVG/.
>>>>>>
>>>>>> This is a complex case, where the generated transformation must
>>>>>> take two models as input and produce one model as output. You need
>>>>>> a special extension of AMW to support this kind of scenario. Take
>>>>>> a look on this use case to see if you can get some inspiration. :)
>>>>>> Let me know if you have any other questions.
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Marcos.
>>>>>>
>>>>>> Juan Pedro Silva wrote:
>>>>>>> Hi Marcos and everybody.
>>>>>>> I'm trying to use AMW for the first time, and I believe I could
>>>>>>> use some help from people with more knowledge of it than me.
>>>>>>>
>>>>>>> I would like to use AMW to combine models (in a sort of
>>>>>>> Aspect-Oriented Modeling). I have a Model 'IN1' corresponding to
>>>>>>> Meta-Model "A" (something like a simpler version of UML), and a
>>>>>>> second model "IN2", that is a security model that corresponds to
>>>>>>> SecureUML metamodel. I wanted to combine this two models into a
>>>>>>> target model that corresponds to a metamodel that is the result
>>>>>>> of the merging of the first two (see the attached picture). This
>>>>>>> "combination" of the models is more than a mere merging.
>>>>>>>
>>>>>>> How could I do this?. In the use cases I saw from the website
>>>>>>> there is always one input model and some matching rules to
>>>>>>> generate one output model (sort of as in a simple ATL
>>>>>>> transformation).
>>>>>>> I tried using the wizard declaring two input models (IN1 and IN2)
>>>>>>> and the output metamodel, but when it comes to choosing the
>>>>>>> input, I can only choose one element from either one of the input
>>>>>>> models.
>>>>>>>
>>>>>>> I believe I'm missing the big picture here, and I surely need
>>>>>>> some advice to get going.
>>>>>>> Any help will be greatly appreciated.
>>>>>>> Regards,
>>>>>>> Juan Pedro
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------ ------------
>>>>>>>
>>>>>>>
|
|
|
Re: Model combination. [message #469553 is a reply to message #469551] |
Fri, 30 January 2009 13:14 |
Juan Pedro Silva Messages: 258 Registered: July 2009 |
Senior Member |
|
|
Marcos:
<leftM xsi:type="_1:ModelRef" xmi:id="ModelRef1" name="leftM"
ref="/iBuilderSecureUMLComposition/metamodels/iBuilderMM.ecore ">
<rightM xsi:type="_1:ModelRef" xmi:id="ModelRef2" name="rightM"
ref=" /iBuilderSecureUMLComposition/metamodels/iBuilder_plus_Secur eUML_Flat_MM.ecore ">
And the .prop.amw file:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<weaver>
<weaving>
<relative-path>/iBuilderMatching/iBuilderMatching.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>/iBuilderSecureUMLComposition/metamodels/iBuilderMM.ecore </metamodel-relative-path>
<reference>leftM</reference>
<title>leftM</title>
<panel>DefaultWovenPanelExtension</panel>
<wmodelref>ModelRef</wmodelref>
</woven>
<woven id="1">
<model-relative-path>null</model-relative-path>
<metamodel-relative-path> /iBuilderSecureUMLComposition/metamodels/iBuilder_plus_Secur eUML_Flat_MM.ecore </metamodel-relative-path>
<reference>rightM</reference>
<title>rightM</title>
<panel>DefaultWovenPanelExtension</panel>
<wmodelref>ModelRef</wmodelref>
</woven>
</weaver>
I load the metamodels in the wizard from other project, do you think
this could create problems?.
I could try copying them into this one and see if that helps.
Regards, and thanks for your help.
Marcos Didonet Del Fabro escribió:
> Hi,
>
> The problem is that it didn't find the right element (it returned a
> "null" in the getElementRef method. However, I cannot say why this is
> happening. Maybe there is a path problem or something related.
>
> Can you copy the value of the "rightM" and "leftM" elements, and an
> excerpt of the .prop.amw.file with the file paths?
>
> The "rightM" element looks like the following:
> <rightM xsi:type="_1:ModelRef" xmi:id="ModelRef2" name="rightM"
> ref="/<metamodelpath>.ecore">
>
>
>
> Marcos.
>
> Juan Pedro Silva wrote:
>> Hi Marcos, thanks for your quick answer.
>> Ok on the HOT, I'll work on it.
>> Regarding the matching operations, I was using the extensions you
>> enumerated, and no others. I was following the "Metamodel comparison"
>> use case verbatim with my own metamodels.
>> The input model for the "Name Equality" matching operation was the
>> output of the "cartesian product" operation. Validating this model
>> returns no error or warnings.
>>
>> I looked for the matching rule (in the "_cp.amw") model that shows up
>> in the error stack ("UIComboBox_EAnnotation"), and it has a right
>> element:
>>
>> <ownedElement xsi:type="ElementEqual" name="UIComboBox_EAnnotation"
>> similarity="0.0">
>> <left xsi:type="LeftElement" name="UIComboBox"
>> element="//@leftM/@ownedElementRef.18"/>
>> <right xsi:type="RightElement" name="EAnnotation"
>> element="//@rightM/@ownedElementRef.108"/>
>> </ownedElement>
>>
>> I even navigated throw the "_cp.amw" file (opening it with the text
>> editor) and found no rule that hadn't a right element (this was not
>> exhaustive, though, as there are 223214 lines in that file).
>> Re-running the "Name Equality" operation throws the same error but in
>> a different rule each time.
>> Any ideas?, would size be an issue?. I ask this because it takes
>> quite some time (a couple of minutes) to open this file with the AMW
>> editor, for instance.
>> Regards,
>> Juan Pedro
>>
>>
>> Marcos Didonet Del Fabro escribió:
>>> Hello,
>>>
>>> The matching transformations, as well as the corresponding HOTs, are
>>> implemented based on specific extensions to the AMW core metamodel.
>>> If you want to use new extensions, the HOT must be extended to be
>>> able to support them.
>>>
>>> To execute the matching transformations of the plug-in, the
>>> following extensions are needed:
>>> - mw_base_ext
>>> - mmw_match (equality, cardinality, type and conformance, Cartesian
>>> product, link rewriting, threshold)
>>> - mm_propagation (SF, propagation graph)
>>> - mmw_compare (not equivalence)
>>>
>>> If you add new extensions, the transformations won't produce any
>>> additional result, since they are not aware of the existence of new
>>> types of links.
>>>
>>> Now, looking at your error log, it seems that you don't have any
>>> element associated to the "right" reference:
>>>
>>> variables = {left = left!UIComboBox}}, 'right']
>>>
>>> The transformations need to have the "left" and "right" references
>>> set up in the weaving model.
>>>
>>> Regards,
>>>
>>> Marcos.
>>>
>>>
>>> Juan Pedro Silva wrote:
>>>> Hi Marcos, sorry for not being clear.
>>>> Your answer is of great help to manually generate the
>>>> transformations. I'm currently generating the weaving model
>>>> manually, but it will take some time to finish due to the size
>>>> (moderate, but not small) of the metamodels. After that I'll give
>>>> this a try.
>>>>
>>>> I was referring to the HOT (or "transfGen", as you call it in your
>>>> phd Thesis).
>>>> I'm having problems with the automatic generation of the
>>>> transformation, in various steps.
>>>> What I'm trying to do at this point (I postponed the combination of
>>>> models until I get this right) is:
>>>>
>>>> 1. An automatic Matching model (as in the "Metamodel comparison
>>>> use
>>>> case") for my own metamodels.
>>>> 2. Manually tune this model with some other wlink extensions
>>>> (previously loading my km3 extension).
>>>> 3. Generate the ATL transformation (HOT) by means of the AMW
>>>> context
>>>> menu option.
>>>>
>>>> However, I'm getting errors in step 1. I can execute the "Metamodel
>>>> Match -> Cartesian Product" (takes long but works), but I get
>>>> errors when running the "Name Equality" on the cp result (I'm
>>>> attaching the console output). I also get an error while trying
>>>> step 3 on a partial weaving model, but as the weaving model was
>>>> partial and manual, I'll wait until it is complete and try again.
>>>>
>>>> The question would be, are there any conditions on the metamodels
>>>> in order for the matching to work?, and is the available HOT
>>>> general enough for using it with our own weaving-metamodel
>>>> extensions, or I am supposed to make my own HOTs for them?.
>>>>
>>>> Thanks again, Marcos.
>>>> Regards,
>>>> Juan Pedro
>>>>
>>>>
>>>>
>>>> Marcos Didonet Del Fabro escribió:
>>>>>
>>>>> Hello,
>>>>>
>>>>> I didn't understand what you mean by "linking the rules with ATL".
>>>>>
>>>>> You can set the weaving model as input (or output) in the ATL
>>>>> transformation, and than use it in different ways. I depict some
>>>>> below:
>>>>>
>>>>> The signature of the transformation would be the following:
>>>>>
>>>>> module MyModule create OUT : MMB from IN : MMA, IN2 : AMW;
>>>>>
>>>>> 1) Matching the weaving link + the target actions:
>>>>>
>>>>> rule MatchLink {
>>>>>
>>>>> from
>>>>> link : AMW!ResourceCombination, resource : MMA!Resource (some
>>>>> condition to verify the correct input resource )
>>>>>
>>>>> to
>>>>> out : MMB!Resource (
>>>>> action <- -- check for the target resource actions
>>>>> -- see the AMW model handler Wiki
>>>>> (http://wiki.eclipse.org/index.php/AMW_Model_Handler) to check how
>>>>> the getReffered() method works)
>>>>> )
>>>>>
>>>>> }
>>>>>
>>>>> 2) you can create the rule similar as the one you have, and search
>>>>> for the linked elements.
>>>>>
>>>>> rule ActionsToResource {
>>>>> from
>>>>> cO : MMA!Resource
>>>>> to
>>>>> out : MMB!Resource
>>>>> (
>>>>> action <- cO.getOutputActions() -- The helper is
>>>>> created for better readability.
>>>>> )
>>>>> }
>>>>>
>>>>>
>>>>> helper context MMA!Resource getOutputActions() : Sequence
>>>>> (MMA!Action) =
>>>>> -- the helper should search for the ResourceCombination links
>>>>> and that returns the model elements based on the values of the
>>>>> references targetResource and createAction.
>>>>>
>>>>>
>>>>> Regards,
>>>>>
>>>>> Marcos.
>>>>>
>>>>>
>>>>>
>>>>> Juan Pedro Silva wrote:
>>>>>> Marcos, I'm back to this after some time doing some other stuff.
>>>>>> I have a doubt regarding how to link the semantics of the
>>>>>> transformation with the definition of the weaving metamodel
>>>>>> extensions.
>>>>>>
>>>>>> For example, I define the following extension (I based it on the
>>>>>> AOM use case):
>>>>>>
>>>>>> class ResourceCombination extends WLink {
>>>>>> -- @subsets end
>>>>>> reference targetResource [*] container : Resource;
>>>>>> -- @subsets end
>>>>>> reference createActions [*] container : Resource;
>>>>>> }
>>>>>> class Resource extends WLinkEnd {
>>>>>> }
>>>>>>
>>>>>> and now I want to express that, when I draw a
>>>>>> "ResourceCombination" link, every action that exists on the
>>>>>> "createActions" Resource should be created in the
>>>>>> "targetResource" Resource (I want to do more complicated things
>>>>>> with it, but lets start with this).
>>>>>> In atl, such rule would be:
>>>>>>
>>>>>> rule ActionsToResource --My
>>>>>> guess is that the rule name doesn't affect
>>>>>> {
>>>>>> from
>>>>>> cO : MMA!Resource
>>>>>> to
>>>>>> out : MMB!Resource
>>>>>> (
>>>>>> action <- cO.action
>>>>>> --where "action" is a set of "Action"
>>>>>> elements )
>>>>>> }
>>>>>>
>>>>>> What I don't know how to do is to associate the weaving model
>>>>>> (.amw) with the transformation rules (.atl), in order to apply
>>>>>> the weavings.
>>>>>> How does the linking of the amw extensions with the rules takes
>>>>>> place?.
>>>>>> Thank you very much.
>>>>>> Regards,
>>>>>> Juan Pedro
>>>>>>
>>>>>>
>>>>>>
>>>>>> Marcos Didonet Del Fabro escribió:
>>>>>>> Hello,
>>>>>>>
>>>>>>>
>>>>>>> In aspect oriented modeling, the metamodels are combined. It
>>>>>>> would be the creation of MMA + SecureUML metamodel based on
>>>>>>> links between MMA and SecureUML.
>>>>>>>
>>>>>>> Your case seems more similar to the "Merge of geographical data"
>>>>>>> use case. http://www.eclipse.org/gmt/amw/usecases/mergeSVG/.
>>>>>>>
>>>>>>> This is a complex case, where the generated transformation must
>>>>>>> take two models as input and produce one model as output. You
>>>>>>> need a special extension of AMW to support this kind of
>>>>>>> scenario. Take a look on this use case to see if you can get
>>>>>>> some inspiration. :) Let me know if you have any other questions.
>>>>>>>
>>>>>>> Regards,
>>>>>>>
>>>>>>> Marcos.
>>>>>>>
>>>>>>> Juan Pedro Silva wrote:
>>>>>>>> Hi Marcos and everybody.
>>>>>>>> I'm trying to use AMW for the first time, and I believe I could
>>>>>>>> use some help from people with more knowledge of it than me.
>>>>>>>>
>>>>>>>> I would like to use AMW to combine models (in a sort of
>>>>>>>> Aspect-Oriented Modeling). I have a Model 'IN1' corresponding
>>>>>>>> to Meta-Model "A" (something like a simpler version of UML),
>>>>>>>> and a second model "IN2", that is a security model that
>>>>>>>> corresponds to SecureUML metamodel. I wanted to combine this
>>>>>>>> two models into a target model that corresponds to a metamodel
>>>>>>>> that is the result of the merging of the first two (see the
>>>>>>>> attached picture). This "combination" of the models is more
>>>>>>>> than a mere merging.
>>>>>>>>
>>>>>>>> How could I do this?. In the use cases I saw from the website
>>>>>>>> there is always one input model and some matching rules to
>>>>>>>> generate one output model (sort of as in a simple ATL
>>>>>>>> transformation).
>>>>>>>> I tried using the wizard declaring two input models (IN1 and
>>>>>>>> IN2) and the output metamodel, but when it comes to choosing
>>>>>>>> the input, I can only choose one element from either one of the
>>>>>>>> input models.
>>>>>>>>
>>>>>>>> I believe I'm missing the big picture here, and I surely need
>>>>>>>> some advice to get going.
>>>>>>>> Any help will be greatly appreciated.
>>>>>>>> Regards,
>>>>>>>> Juan Pedro
>>>>>>>>
>>>>>>>>
>>>>>>>> ------------------------------------------------------------ ------------
>>>>>>>>
>>>>>>>>
|
|
|
Re: Model combination. [message #469555 is a reply to message #469553] |
Fri, 30 January 2009 13:44 |
Juan Pedro Silva Messages: 258 Registered: July 2009 |
Senior Member |
|
|
Making a new model weaverwith the metamodels in the root folder of the
same project has the same results as in the previous one, regretfully.
Juan Pedro Silva escribió:
> Marcos:
>
> <leftM xsi:type="_1:ModelRef" xmi:id="ModelRef1" name="leftM"
> ref="/iBuilderSecureUMLComposition/metamodels/iBuilderMM.ecore ">
>
> <rightM xsi:type="_1:ModelRef" xmi:id="ModelRef2" name="rightM"
> ref=" /iBuilderSecureUMLComposition/metamodels/iBuilder_plus_Secur eUML_Flat_MM.ecore ">
>
>
> And the .prop.amw file:
>
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <weaver>
> <weaving>
> <relative-path>/iBuilderMatching/iBuilderMatching.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>/iBuilderSecureUMLComposition/metamodels/iBuilderMM.ecore </metamodel-relative-path>
>
> <reference>leftM</reference>
> <title>leftM</title>
> <panel>DefaultWovenPanelExtension</panel>
> <wmodelref>ModelRef</wmodelref>
> </woven>
> <woven id="1">
> <model-relative-path>null</model-relative-path>
> <metamodel-relative-path> /iBuilderSecureUMLComposition/metamodels/iBuilder_plus_Secur eUML_Flat_MM.ecore </metamodel-relative-path>
>
> <reference>rightM</reference>
> <title>rightM</title>
> <panel>DefaultWovenPanelExtension</panel>
> <wmodelref>ModelRef</wmodelref>
> </woven>
> </weaver>
>
> I load the metamodels in the wizard from other project, do you think
> this could create problems?.
> I could try copying them into this one and see if that helps.
> Regards, and thanks for your help.
>
>
>
> Marcos Didonet Del Fabro escribió:
>> Hi,
>>
>> The problem is that it didn't find the right element (it returned a
>> "null" in the getElementRef method. However, I cannot say why this is
>> happening. Maybe there is a path problem or something related.
>>
>> Can you copy the value of the "rightM" and "leftM" elements, and an
>> excerpt of the .prop.amw.file with the file paths?
>>
>> The "rightM" element looks like the following:
>> <rightM xsi:type="_1:ModelRef" xmi:id="ModelRef2" name="rightM"
>> ref="/<metamodelpath>.ecore">
>>
>>
>>
>> Marcos.
>>
>> Juan Pedro Silva wrote:
>>> Hi Marcos, thanks for your quick answer.
>>> Ok on the HOT, I'll work on it.
>>> Regarding the matching operations, I was using the extensions you
>>> enumerated, and no others. I was following the "Metamodel
>>> comparison" use case verbatim with my own metamodels.
>>> The input model for the "Name Equality" matching operation was the
>>> output of the "cartesian product" operation. Validating this model
>>> returns no error or warnings.
>>>
>>> I looked for the matching rule (in the "_cp.amw") model that shows
>>> up in the error stack ("UIComboBox_EAnnotation"), and it has a right
>>> element:
>>>
>>> <ownedElement xsi:type="ElementEqual" name="UIComboBox_EAnnotation"
>>> similarity="0.0">
>>> <left xsi:type="LeftElement" name="UIComboBox"
>>> element="//@leftM/@ownedElementRef.18"/>
>>> <right xsi:type="RightElement" name="EAnnotation"
>>> element="//@rightM/@ownedElementRef.108"/>
>>> </ownedElement>
>>>
>>> I even navigated throw the "_cp.amw" file (opening it with the text
>>> editor) and found no rule that hadn't a right element (this was not
>>> exhaustive, though, as there are 223214 lines in that file).
>>> Re-running the "Name Equality" operation throws the same error but
>>> in a different rule each time.
>>> Any ideas?, would size be an issue?. I ask this because it takes
>>> quite some time (a couple of minutes) to open this file with the AMW
>>> editor, for instance.
>>> Regards,
>>> Juan Pedro
>>>
>>>
>>> Marcos Didonet Del Fabro escribió:
>>>> Hello,
>>>>
>>>> The matching transformations, as well as the corresponding HOTs,
>>>> are implemented based on specific extensions to the AMW core
>>>> metamodel. If you want to use new extensions, the HOT must be
>>>> extended to be able to support them.
>>>>
>>>> To execute the matching transformations of the plug-in, the
>>>> following extensions are needed:
>>>> - mw_base_ext
>>>> - mmw_match (equality, cardinality, type and conformance, Cartesian
>>>> product, link rewriting, threshold)
>>>> - mm_propagation (SF, propagation graph)
>>>> - mmw_compare (not equivalence)
>>>>
>>>> If you add new extensions, the transformations won't produce any
>>>> additional result, since they are not aware of the existence of new
>>>> types of links.
>>>>
>>>> Now, looking at your error log, it seems that you don't have any
>>>> element associated to the "right" reference:
>>>>
>>>> variables = {left = left!UIComboBox}}, 'right']
>>>>
>>>> The transformations need to have the "left" and "right" references
>>>> set up in the weaving model.
>>>>
>>>> Regards,
>>>>
>>>> Marcos.
>>>>
>>>>
>>>> Juan Pedro Silva wrote:
>>>>> Hi Marcos, sorry for not being clear.
>>>>> Your answer is of great help to manually generate the
>>>>> transformations. I'm currently generating the weaving model
>>>>> manually, but it will take some time to finish due to the size
>>>>> (moderate, but not small) of the metamodels. After that I'll give
>>>>> this a try.
>>>>>
>>>>> I was referring to the HOT (or "transfGen", as you call it in your
>>>>> phd Thesis).
>>>>> I'm having problems with the automatic generation of the
>>>>> transformation, in various steps.
>>>>> What I'm trying to do at this point (I postponed the combination
>>>>> of models until I get this right) is:
>>>>>
>>>>> 1. An automatic Matching model (as in the "Metamodel
>>>>> comparison use
>>>>> case") for my own metamodels.
>>>>> 2. Manually tune this model with some other wlink extensions
>>>>> (previously loading my km3 extension).
>>>>> 3. Generate the ATL transformation (HOT) by means of the AMW
>>>>> context
>>>>> menu option.
>>>>>
>>>>> However, I'm getting errors in step 1. I can execute the
>>>>> "Metamodel Match -> Cartesian Product" (takes long but works), but
>>>>> I get errors when running the "Name Equality" on the cp result
>>>>> (I'm attaching the console output). I also get an error while
>>>>> trying step 3 on a partial weaving model, but as the weaving model
>>>>> was partial and manual, I'll wait until it is complete and try again.
>>>>>
>>>>> The question would be, are there any conditions on the metamodels
>>>>> in order for the matching to work?, and is the available HOT
>>>>> general enough for using it with our own weaving-metamodel
>>>>> extensions, or I am supposed to make my own HOTs for them?.
>>>>>
>>>>> Thanks again, Marcos.
>>>>> Regards,
>>>>> Juan Pedro
>>>>>
>>>>>
>>>>>
>>>>> Marcos Didonet Del Fabro escribió:
>>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I didn't understand what you mean by "linking the rules with ATL".
>>>>>>
>>>>>> You can set the weaving model as input (or output) in the ATL
>>>>>> transformation, and than use it in different ways. I depict some
>>>>>> below:
>>>>>>
>>>>>> The signature of the transformation would be the following:
>>>>>>
>>>>>> module MyModule create OUT : MMB from IN : MMA, IN2 : AMW;
>>>>>>
>>>>>> 1) Matching the weaving link + the target actions:
>>>>>>
>>>>>> rule MatchLink {
>>>>>>
>>>>>> from
>>>>>> link : AMW!ResourceCombination, resource : MMA!Resource (some
>>>>>> condition to verify the correct input resource )
>>>>>>
>>>>>> to
>>>>>> out : MMB!Resource (
>>>>>> action <- -- check for the target resource actions
>>>>>> -- see the AMW model handler Wiki
>>>>>> (http://wiki.eclipse.org/index.php/AMW_Model_Handler) to check
>>>>>> how the getReffered() method works)
>>>>>> )
>>>>>>
>>>>>> }
>>>>>>
>>>>>> 2) you can create the rule similar as the one you have, and
>>>>>> search for the linked elements.
>>>>>>
>>>>>> rule ActionsToResource {
>>>>>> from
>>>>>> cO : MMA!Resource
>>>>>> to
>>>>>> out : MMB!Resource
>>>>>> (
>>>>>> action <- cO.getOutputActions() -- The helper is
>>>>>> created for better readability.
>>>>>> )
>>>>>> }
>>>>>>
>>>>>>
>>>>>> helper context MMA!Resource getOutputActions() : Sequence
>>>>>> (MMA!Action) =
>>>>>> -- the helper should search for the ResourceCombination links
>>>>>> and that returns the model elements based on the values of the
>>>>>> references targetResource and createAction.
>>>>>>
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Marcos.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Juan Pedro Silva wrote:
>>>>>>> Marcos, I'm back to this after some time doing some other stuff.
>>>>>>> I have a doubt regarding how to link the semantics of the
>>>>>>> transformation with the definition of the weaving metamodel
>>>>>>> extensions.
>>>>>>>
>>>>>>> For example, I define the following extension (I based it on the
>>>>>>> AOM use case):
>>>>>>>
>>>>>>> class ResourceCombination extends WLink {
>>>>>>> -- @subsets end
>>>>>>> reference targetResource [*] container : Resource;
>>>>>>> -- @subsets end
>>>>>>> reference createActions [*] container : Resource;
>>>>>>> }
>>>>>>> class Resource extends WLinkEnd {
>>>>>>> }
>>>>>>>
>>>>>>> and now I want to express that, when I draw a
>>>>>>> "ResourceCombination" link, every action that exists on the
>>>>>>> "createActions" Resource should be created in the
>>>>>>> "targetResource" Resource (I want to do more complicated things
>>>>>>> with it, but lets start with this).
>>>>>>> In atl, such rule would be:
>>>>>>>
>>>>>>> rule ActionsToResource --My
>>>>>>> guess is that the rule name doesn't affect
>>>>>>> {
>>>>>>> from
>>>>>>> cO : MMA!Resource
>>>>>>> to
>>>>>>> out : MMB!Resource
>>>>>>> (
>>>>>>> action <- cO.action
>>>>>>> --where "action" is a set of "Action"
>>>>>>> elements )
>>>>>>> }
>>>>>>>
>>>>>>> What I don't know how to do is to associate the weaving model
>>>>>>> (.amw) with the transformation rules (.atl), in order to apply
>>>>>>> the weavings.
>>>>>>> How does the linking of the amw extensions with the rules takes
>>>>>>> place?.
>>>>>>> Thank you very much.
>>>>>>> Regards,
>>>>>>> Juan Pedro
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Marcos Didonet Del Fabro escribió:
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>>
>>>>>>>> In aspect oriented modeling, the metamodels are combined. It
>>>>>>>> would be the creation of MMA + SecureUML metamodel based on
>>>>>>>> links between MMA and SecureUML.
>>>>>>>>
>>>>>>>> Your case seems more similar to the "Merge of geographical
>>>>>>>> data" use case. http://www.eclipse.org/gmt/amw/usecases/mergeSVG/.
>>>>>>>>
>>>>>>>> This is a complex case, where the generated transformation must
>>>>>>>> take two models as input and produce one model as output. You
>>>>>>>> need a special extension of AMW to support this kind of
>>>>>>>> scenario. Take a look on this use case to see if you can get
>>>>>>>> some inspiration. :) Let me know if you have any other questions.
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>>
>>>>>>>> Marcos.
>>>>>>>>
>>>>>>>> Juan Pedro Silva wrote:
>>>>>>>>> Hi Marcos and everybody.
>>>>>>>>> I'm trying to use AMW for the first time, and I believe I
>>>>>>>>> could use some help from people with more knowledge of it than
>>>>>>>>> me.
>>>>>>>>>
>>>>>>>>> I would like to use AMW to combine models (in a sort of
>>>>>>>>> Aspect-Oriented Modeling). I have a Model 'IN1' corresponding
>>>>>>>>> to Meta-Model "A" (something like a simpler version of UML),
>>>>>>>>> and a second model "IN2", that is a security model that
>>>>>>>>> corresponds to SecureUML metamodel. I wanted to combine this
>>>>>>>>> two models into a target model that corresponds to a metamodel
>>>>>>>>> that is the result of the merging of the first two (see the
>>>>>>>>> attached picture). This "combination" of the models is more
>>>>>>>>> than a mere merging.
>>>>>>>>>
>>>>>>>>> How could I do this?. In the use cases I saw from the website
>>>>>>>>> there is always one input model and some matching rules to
>>>>>>>>> generate one output model (sort of as in a simple ATL
>>>>>>>>> transformation).
>>>>>>>>> I tried using the wizard declaring two input models (IN1 and
>>>>>>>>> IN2) and the output metamodel, but when it comes to choosing
>>>>>>>>> the input, I can only choose one element from either one of
>>>>>>>>> the input models.
>>>>>>>>>
>>>>>>>>> I believe I'm missing the big picture here, and I surely need
>>>>>>>>> some advice to get going.
>>>>>>>>> Any help will be greatly appreciated.
>>>>>>>>> Regards,
>>>>>>>>> Juan Pedro
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ------------------------------------------------------------ ------------
>>>>>>>>>
>>>>>>>>>
|
|
|
Re: Model combination. [message #469557 is a reply to message #469555] |
Fri, 30 January 2009 14:54 |
Marcos Didonet Del Fabro Messages: 84 Registered: July 2009 |
Member |
|
|
It seems something related with the EAnnotation element. Can you explain
what is it about?
Marcos.
Juan Pedro Silva wrote:
> Making a new model weaverwith the metamodels in the root folder of the
> same project has the same results as in the previous one, regretfully.
>
> Juan Pedro Silva escribió:
>> Marcos:
>>
>> <leftM xsi:type="_1:ModelRef" xmi:id="ModelRef1" name="leftM"
>> ref="/iBuilderSecureUMLComposition/metamodels/iBuilderMM.ecore ">
>>
>> <rightM xsi:type="_1:ModelRef" xmi:id="ModelRef2" name="rightM"
>> ref=" /iBuilderSecureUMLComposition/metamodels/iBuilder_plus_Secur eUML_Flat_MM.ecore ">
>>
>>
>> And the .prop.amw file:
>>
>> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
>> <weaver>
>> <weaving>
>> <relative-path>/iBuilderMatching/iBuilderMatching.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>/iBuilderSecureUMLComposition/metamodels/iBuilderMM.ecore </metamodel-relative-path>
>>
>> <reference>leftM</reference>
>> <title>leftM</title>
>> <panel>DefaultWovenPanelExtension</panel>
>> <wmodelref>ModelRef</wmodelref>
>> </woven>
>> <woven id="1">
>> <model-relative-path>null</model-relative-path>
>> <metamodel-relative-path> /iBuilderSecureUMLComposition/metamodels/iBuilder_plus_Secur eUML_Flat_MM.ecore </metamodel-relative-path>
>>
>> <reference>rightM</reference>
>> <title>rightM</title>
>> <panel>DefaultWovenPanelExtension</panel>
>> <wmodelref>ModelRef</wmodelref>
>> </woven>
>> </weaver>
>>
>> I load the metamodels in the wizard from other project, do you think
>> this could create problems?.
>> I could try copying them into this one and see if that helps.
>> Regards, and thanks for your help.
>>
>>
>>
>> Marcos Didonet Del Fabro escribió:
>>> Hi,
>>>
>>> The problem is that it didn't find the right element (it returned a
>>> "null" in the getElementRef method. However, I cannot say why this is
>>> happening. Maybe there is a path problem or something related.
>>>
>>> Can you copy the value of the "rightM" and "leftM" elements, and an
>>> excerpt of the .prop.amw.file with the file paths?
>>>
>>> The "rightM" element looks like the following:
>>> <rightM xsi:type="_1:ModelRef" xmi:id="ModelRef2" name="rightM"
>>> ref="/<metamodelpath>.ecore">
>>>
>>>
>>>
>>> Marcos.
>>>
>>> Juan Pedro Silva wrote:
>>>> Hi Marcos, thanks for your quick answer.
>>>> Ok on the HOT, I'll work on it.
>>>> Regarding the matching operations, I was using the extensions you
>>>> enumerated, and no others. I was following the "Metamodel
>>>> comparison" use case verbatim with my own metamodels.
>>>> The input model for the "Name Equality" matching operation was the
>>>> output of the "cartesian product" operation. Validating this model
>>>> returns no error or warnings.
>>>>
>>>> I looked for the matching rule (in the "_cp.amw") model that shows
>>>> up in the error stack ("UIComboBox_EAnnotation"), and it has a right
>>>> element:
>>>>
>>>> <ownedElement xsi:type="ElementEqual" name="UIComboBox_EAnnotation"
>>>> similarity="0.0">
>>>> <left xsi:type="LeftElement" name="UIComboBox"
>>>> element="//@leftM/@ownedElementRef.18"/>
>>>> <right xsi:type="RightElement" name="EAnnotation"
>>>> element="//@rightM/@ownedElementRef.108"/>
>>>> </ownedElement>
>>>>
>>>> I even navigated throw the "_cp.amw" file (opening it with the text
>>>> editor) and found no rule that hadn't a right element (this was not
>>>> exhaustive, though, as there are 223214 lines in that file).
>>>> Re-running the "Name Equality" operation throws the same error but
>>>> in a different rule each time.
>>>> Any ideas?, would size be an issue?. I ask this because it takes
>>>> quite some time (a couple of minutes) to open this file with the AMW
>>>> editor, for instance.
>>>> Regards,
>>>> Juan Pedro
>>>>
>>>>
>>>> Marcos Didonet Del Fabro escribió:
>>>>> Hello,
>>>>>
>>>>> The matching transformations, as well as the corresponding HOTs,
>>>>> are implemented based on specific extensions to the AMW core
>>>>> metamodel. If you want to use new extensions, the HOT must be
>>>>> extended to be able to support them.
>>>>>
>>>>> To execute the matching transformations of the plug-in, the
>>>>> following extensions are needed:
>>>>> - mw_base_ext
>>>>> - mmw_match (equality, cardinality, type and conformance, Cartesian
>>>>> product, link rewriting, threshold)
>>>>> - mm_propagation (SF, propagation graph)
>>>>> - mmw_compare (not equivalence)
>>>>>
>>>>> If you add new extensions, the transformations won't produce any
>>>>> additional result, since they are not aware of the existence of new
>>>>> types of links.
>>>>>
>>>>> Now, looking at your error log, it seems that you don't have any
>>>>> element associated to the "right" reference:
>>>>>
>>>>> variables = {left = left!UIComboBox}}, 'right']
>>>>>
>>>>> The transformations need to have the "left" and "right" references
>>>>> set up in the weaving model.
>>>>>
>>>>> Regards,
>>>>>
>>>>> Marcos.
>>>>>
>>>>>
>>>>> Juan Pedro Silva wrote:
>>>>>> Hi Marcos, sorry for not being clear.
>>>>>> Your answer is of great help to manually generate the
>>>>>> transformations. I'm currently generating the weaving model
>>>>>> manually, but it will take some time to finish due to the size
>>>>>> (moderate, but not small) of the metamodels. After that I'll give
>>>>>> this a try.
>>>>>>
>>>>>> I was referring to the HOT (or "transfGen", as you call it in your
>>>>>> phd Thesis).
>>>>>> I'm having problems with the automatic generation of the
>>>>>> transformation, in various steps.
>>>>>> What I'm trying to do at this point (I postponed the combination
>>>>>> of models until I get this right) is:
>>>>>>
>>>>>> 1. An automatic Matching model (as in the "Metamodel
>>>>>> comparison use
>>>>>> case") for my own metamodels.
>>>>>> 2. Manually tune this model with some other wlink extensions
>>>>>> (previously loading my km3 extension).
>>>>>> 3. Generate the ATL transformation (HOT) by means of the AMW
>>>>>> context
>>>>>> menu option.
>>>>>>
>>>>>> However, I'm getting errors in step 1. I can execute the
>>>>>> "Metamodel Match -> Cartesian Product" (takes long but works), but
>>>>>> I get errors when running the "Name Equality" on the cp result
>>>>>> (I'm attaching the console output). I also get an error while
>>>>>> trying step 3 on a partial weaving model, but as the weaving model
>>>>>> was partial and manual, I'll wait until it is complete and try again.
>>>>>>
>>>>>> The question would be, are there any conditions on the metamodels
>>>>>> in order for the matching to work?, and is the available HOT
>>>>>> general enough for using it with our own weaving-metamodel
>>>>>> extensions, or I am supposed to make my own HOTs for them?.
>>>>>>
>>>>>> Thanks again, Marcos.
>>>>>> Regards,
>>>>>> Juan Pedro
>>>>>>
>>>>>>
>>>>>>
>>>>>> Marcos Didonet Del Fabro escribió:
>>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> I didn't understand what you mean by "linking the rules with ATL".
>>>>>>>
>>>>>>> You can set the weaving model as input (or output) in the ATL
>>>>>>> transformation, and than use it in different ways. I depict some
>>>>>>> below:
>>>>>>>
>>>>>>> The signature of the transformation would be the following:
>>>>>>>
>>>>>>> module MyModule create OUT : MMB from IN : MMA, IN2 : AMW;
>>>>>>>
>>>>>>> 1) Matching the weaving link + the target actions:
>>>>>>>
>>>>>>> rule MatchLink {
>>>>>>>
>>>>>>> from
>>>>>>> link : AMW!ResourceCombination, resource : MMA!Resource (some
>>>>>>> condition to verify the correct input resource )
>>>>>>>
>>>>>>> to
>>>>>>> out : MMB!Resource (
>>>>>>> action <- -- check for the target resource actions
>>>>>>> -- see the AMW model handler Wiki
>>>>>>> (http://wiki.eclipse.org/index.php/AMW_Model_Handler) to check
>>>>>>> how the getReffered() method works)
>>>>>>> )
>>>>>>>
>>>>>>> }
>>>>>>>
>>>>>>> 2) you can create the rule similar as the one you have, and
>>>>>>> search for the linked elements.
>>>>>>>
>>>>>>> rule ActionsToResource {
>>>>>>> from
>>>>>>> cO : MMA!Resource
>>>>>>> to
>>>>>>> out : MMB!Resource
>>>>>>> (
>>>>>>> action <- cO.getOutputActions() -- The helper is
>>>>>>> created for better readability.
>>>>>>> )
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>> helper context MMA!Resource getOutputActions() : Sequence
>>>>>>> (MMA!Action) =
>>>>>>> -- the helper should search for the ResourceCombination links
>>>>>>> and that returns the model elements based on the values of the
>>>>>>> references targetResource and createAction.
>>>>>>>
>>>>>>>
>>>>>>> Regards,
>>>>>>>
>>>>>>> Marcos.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Juan Pedro Silva wrote:
>>>>>>>> Marcos, I'm back to this after some time doing some other stuff.
>>>>>>>> I have a doubt regarding how to link the semantics of the
>>>>>>>> transformation with the definition of the weaving metamodel
>>>>>>>> extensions.
>>>>>>>>
>>>>>>>> For example, I define the following extension (I based it on the
>>>>>>>> AOM use case):
>>>>>>>>
>>>>>>>> class ResourceCombination extends WLink {
>>>>>>>> -- @subsets end
>>>>>>>> reference targetResource [*] container : Resource;
>>>>>>>> -- @subsets end
>>>>>>>> reference createActions [*] container : Resource;
>>>>>>>> }
>>>>>>>> class Resource extends WLinkEnd {
>>>>>>>> }
>>>>>>>>
>>>>>>>> and now I want to express that, when I draw a
>>>>>>>> "ResourceCombination" link, every action that exists on the
>>>>>>>> "createActions" Resource should be created in the
>>>>>>>> "targetResource" Resource (I want to do more complicated things
>>>>>>>> with it, but lets start with this).
>>>>>>>> In atl, such rule would be:
>>>>>>>>
>>>>>>>> rule ActionsToResource --My
>>>>>>>> guess is that the rule name doesn't affect
>>>>>>>> {
>>>>>>>> from
>>>>>>>> cO : MMA!Resource
>>>>>>>> to
>>>>>>>> out : MMB!Resource
>>>>>>>> (
>>>>>>>> action <- cO.action
>>>>>>>> --where "action" is a set of "Action"
>>>>>>>> elements )
>>>>>>>> }
>>>>>>>>
>>>>>>>> What I don't know how to do is to associate the weaving model
>>>>>>>> (.amw) with the transformation rules (.atl), in order to apply
>>>>>>>> the weavings.
>>>>>>>> How does the linking of the amw extensions with the rules takes
>>>>>>>> place?.
>>>>>>>> Thank you very much.
>>>>>>>> Regards,
>>>>>>>> Juan Pedro
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Marcos Didonet Del Fabro escribió:
>>>>>>>>> Hello,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> In aspect oriented modeling, the metamodels are combined. It
>>>>>>>>> would be the creation of MMA + SecureUML metamodel based on
>>>>>>>>> links between MMA and SecureUML.
>>>>>>>>>
>>>>>>>>> Your case seems more similar to the "Merge of geographical
>>>>>>>>> data" use case. http://www.eclipse.org/gmt/amw/usecases/mergeSVG/.
>>>>>>>>>
>>>>>>>>> This is a complex case, where the generated transformation must
>>>>>>>>> take two models as input and produce one model as output. You
>>>>>>>>> need a special extension of AMW to support this kind of
>>>>>>>>> scenario. Take a look on this use case to see if you can get
>>>>>>>>> some inspiration. :) Let me know if you have any other questions.
>>>>>>>>>
>>>>>>>>> Regards,
>>>>>>>>>
>>>>>>>>> Marcos.
>>>>>>>>>
>>>>>>>>> Juan Pedro Silva wrote:
>>>>>>>>>> Hi Marcos and everybody.
>>>>>>>>>> I'm trying to use AMW for the first time, and I believe I
>>>>>>>>>> could use some help from people with more knowledge of it than
>>>>>>>>>> me.
>>>>>>>>>>
>>>>>>>>>> I would like to use AMW to combine models (in a sort of
>>>>>>>>>> Aspect-Oriented Modeling). I have a Model 'IN1' corresponding
>>>>>>>>>> to Meta-Model "A" (something like a simpler version of UML),
>>>>>>>>>> and a second model "IN2", that is a security model that
>>>>>>>>>> corresponds to SecureUML metamodel. I wanted to combine this
>>>>>>>>>> two models into a target model that corresponds to a metamodel
>>>>>>>>>> that is the result of the merging of the first two (see the
>>>>>>>>>> attached picture). This "combination" of the models is more
>>>>>>>>>> than a mere merging.
>>>>>>>>>>
>>>>>>>>>> How could I do this?. In the use cases I saw from the website
>>>>>>>>>> there is always one input model and some matching rules to
>>>>>>>>>> generate one output model (sort of as in a simple ATL
>>>>>>>>>> transformation).
>>>>>>>>>> I tried using the wizard declaring two input models (IN1 and
>>>>>>>>>> IN2) and the output metamodel, but when it comes to choosing
>>>>>>>>>> the input, I can only choose one element from either one of
>>>>>>>>>> the input models.
>>>>>>>>>>
>>>>>>>>>> I believe I'm missing the big picture here, and I surely need
>>>>>>>>>> some advice to get going.
>>>>>>>>>> Any help will be greatly appreciated.
>>>>>>>>>> Regards,
>>>>>>>>>> Juan Pedro
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ------------------------------------------------------------ ------------
>>>>>>>>>>
>>>>>>>>>>
|
|
|
Re: Model combination. [message #469559 is a reply to message #469557] |
Fri, 30 January 2009 16:49 |
Juan Pedro Silva Messages: 258 Registered: July 2009 |
Senior Member |
|
|
You mean the EAnnotation element from the Ecore metamodel?.
There is no "EAnnotation" element in my metamodels (input or output).
There are some comments, however, in the input metamodel which are
expressed as:
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Some documentation text"/>
</eAnnotations>
I see there are mapping rules in the "Cartesian Product" result with
right elements EAnnotation (I believe it's allways the right element),
but such a metaclass/element doesn't exist in the target metamodel (I
opened it in a text editor and searched for the "EAnnotation" with no
results), nor does the previously described comments.
Hope this helps.
Marcos Didonet Del Fabro escribió:
>
> It seems something related with the EAnnotation element. Can you
> explain what is it about?
>
> Marcos.
>
> Juan Pedro Silva wrote:
>> Making a new model weaverwith the metamodels in the root folder of
>> the same project has the same results as in the previous one,
>> regretfully.
>>
>> Juan Pedro Silva escribió:
>>> Marcos:
>>>
>>> <leftM xsi:type="_1:ModelRef" xmi:id="ModelRef1" name="leftM"
>>> ref="/iBuilderSecureUMLComposition/metamodels/iBuilderMM.ecore ">
>>>
>>> <rightM xsi:type="_1:ModelRef" xmi:id="ModelRef2" name="rightM"
>>> ref=" /iBuilderSecureUMLComposition/metamodels/iBuilder_plus_Secur eUML_Flat_MM.ecore ">
>>>
>>>
>>> And the .prop.amw file:
>>>
>>> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
>>> <weaver>
>>> <weaving>
>>> <relative-path>/iBuilderMatching/iBuilderMatching.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>/iBuilderSecureUMLComposition/metamodels/iBuilderMM.ecore </metamodel-relative-path>
>>>
>>> <reference>leftM</reference>
>>> <title>leftM</title>
>>> <panel>DefaultWovenPanelExtension</panel>
>>> <wmodelref>ModelRef</wmodelref>
>>> </woven>
>>> <woven id="1">
>>> <model-relative-path>null</model-relative-path>
>>> <metamodel-relative-path> /iBuilderSecureUMLComposition/metamodels/iBuilder_plus_Secur eUML_Flat_MM.ecore </metamodel-relative-path>
>>>
>>> <reference>rightM</reference>
>>> <title>rightM</title>
>>> <panel>DefaultWovenPanelExtension</panel>
>>> <wmodelref>ModelRef</wmodelref>
>>> </woven>
>>> </weaver>
>>>
>>> I load the metamodels in the wizard from other project, do you think
>>> this could create problems?.
>>> I could try copying them into this one and see if that helps.
>>> Regards, and thanks for your help.
>>>
>>>
>>>
>>> Marcos Didonet Del Fabro escribió:
>>>> Hi,
>>>>
>>>> The problem is that it didn't find the right element (it returned a
>>>> "null" in the getElementRef method. However, I cannot say why this
>>>> is happening. Maybe there is a path problem or something related.
>>>>
>>>> Can you copy the value of the "rightM" and "leftM" elements, and
>>>> an excerpt of the .prop.amw.file with the file paths?
>>>>
>>>> The "rightM" element looks like the following:
>>>> <rightM xsi:type="_1:ModelRef" xmi:id="ModelRef2" name="rightM"
>>>> ref="/<metamodelpath>.ecore">
>>>>
>>>>
>>>>
>>>> Marcos.
>>>>
>>>> Juan Pedro Silva wrote:
>>>>> Hi Marcos, thanks for your quick answer.
>>>>> Ok on the HOT, I'll work on it.
>>>>> Regarding the matching operations, I was using the extensions you
>>>>> enumerated, and no others. I was following the "Metamodel
>>>>> comparison" use case verbatim with my own metamodels.
>>>>> The input model for the "Name Equality" matching operation was the
>>>>> output of the "cartesian product" operation. Validating this model
>>>>> returns no error or warnings.
>>>>>
>>>>> I looked for the matching rule (in the "_cp.amw") model that shows
>>>>> up in the error stack ("UIComboBox_EAnnotation"), and it has a
>>>>> right element:
>>>>>
>>>>> <ownedElement xsi:type="ElementEqual"
>>>>> name="UIComboBox_EAnnotation" similarity="0.0">
>>>>> <left xsi:type="LeftElement" name="UIComboBox"
>>>>> element="//@leftM/@ownedElementRef.18"/>
>>>>> <right xsi:type="RightElement" name="EAnnotation"
>>>>> element="//@rightM/@ownedElementRef.108"/>
>>>>> </ownedElement>
>>>>>
>>>>> I even navigated throw the "_cp.amw" file (opening it with the
>>>>> text editor) and found no rule that hadn't a right element (this
>>>>> was not exhaustive, though, as there are 223214 lines in that file).
>>>>> Re-running the "Name Equality" operation throws the same error but
>>>>> in a different rule each time.
>>>>> Any ideas?, would size be an issue?. I ask this because it takes
>>>>> quite some time (a couple of minutes) to open this file with the
>>>>> AMW editor, for instance.
>>>>> Regards,
>>>>> Juan Pedro
>>>>>
>>>>>
>>>>> Marcos Didonet Del Fabro escribió:
>>>>>> Hello,
>>>>>>
>>>>>> The matching transformations, as well as the corresponding HOTs,
>>>>>> are implemented based on specific extensions to the AMW core
>>>>>> metamodel. If you want to use new extensions, the HOT must be
>>>>>> extended to be able to support them.
>>>>>>
>>>>>> To execute the matching transformations of the plug-in, the
>>>>>> following extensions are needed:
>>>>>> - mw_base_ext
>>>>>> - mmw_match (equality, cardinality, type and conformance,
>>>>>> Cartesian product, link rewriting, threshold)
>>>>>> - mm_propagation (SF, propagation graph)
>>>>>> - mmw_compare (not equivalence)
>>>>>>
>>>>>> If you add new extensions, the transformations won't produce any
>>>>>> additional result, since they are not aware of the existence of
>>>>>> new types of links.
>>>>>>
>>>>>> Now, looking at your error log, it seems that you don't have any
>>>>>> element associated to the "right" reference:
>>>>>>
>>>>>> variables = {left = left!UIComboBox}}, 'right']
>>>>>>
>>>>>> The transformations need to have the "left" and "right"
>>>>>> references set up in the weaving model.
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Marcos.
>>>>>>
>>>>>>
>>>>>> Juan Pedro Silva wrote:
>>>>>>> Hi Marcos, sorry for not being clear.
>>>>>>> Your answer is of great help to manually generate the
>>>>>>> transformations. I'm currently generating the weaving model
>>>>>>> manually, but it will take some time to finish due to the size
>>>>>>> (moderate, but not small) of the metamodels. After that I'll
>>>>>>> give this a try.
>>>>>>>
>>>>>>> I was referring to the HOT (or "transfGen", as you call it in
>>>>>>> your phd Thesis).
>>>>>>> I'm having problems with the automatic generation of the
>>>>>>> transformation, in various steps.
>>>>>>> What I'm trying to do at this point (I postponed the combination
>>>>>>> of models until I get this right) is:
>>>>>>>
>>>>>>> 1. An automatic Matching model (as in the "Metamodel
>>>>>>> comparison use
>>>>>>> case") for my own metamodels.
>>>>>>> 2. Manually tune this model with some other wlink extensions
>>>>>>> (previously loading my km3 extension).
>>>>>>> 3. Generate the ATL transformation (HOT) by means of the AMW
>>>>>>> context
>>>>>>> menu option.
>>>>>>>
>>>>>>> However, I'm getting errors in step 1. I can execute the
>>>>>>> "Metamodel Match -> Cartesian Product" (takes long but works),
>>>>>>> but I get errors when running the "Name Equality" on the cp
>>>>>>> result (I'm attaching the console output). I also get an error
>>>>>>> while trying step 3 on a partial weaving model, but as the
>>>>>>> weaving model was partial and manual, I'll wait until it is
>>>>>>> complete and try again.
>>>>>>>
>>>>>>> The question would be, are there any conditions on the
>>>>>>> metamodels in order for the matching to work?, and is the
>>>>>>> available HOT general enough for using it with our own
>>>>>>> weaving-metamodel extensions, or I am supposed to make my own
>>>>>>> HOTs for them?.
>>>>>>>
>>>>>>> Thanks again, Marcos.
>>>>>>> Regards,
>>>>>>> Juan Pedro
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Marcos Didonet Del Fabro escribió:
>>>>>>>>
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> I didn't understand what you mean by "linking the rules with ATL".
>>>>>>>>
>>>>>>>> You can set the weaving model as input (or output) in the ATL
>>>>>>>> transformation, and than use it in different ways. I depict
>>>>>>>> some below:
>>>>>>>>
>>>>>>>> The signature of the transformation would be the following:
>>>>>>>>
>>>>>>>> module MyModule create OUT : MMB from IN : MMA, IN2 : AMW;
>>>>>>>>
>>>>>>>> 1) Matching the weaving link + the target actions:
>>>>>>>>
>>>>>>>> rule MatchLink {
>>>>>>>>
>>>>>>>> from
>>>>>>>> link : AMW!ResourceCombination, resource : MMA!Resource (some
>>>>>>>> condition to verify the correct input resource )
>>>>>>>>
>>>>>>>> to
>>>>>>>> out : MMB!Resource (
>>>>>>>> action <- -- check for the target resource actions
>>>>>>>> -- see the AMW model handler Wiki
>>>>>>>> (http://wiki.eclipse.org/index.php/AMW_Model_Handler) to check
>>>>>>>> how the getReffered() method works)
>>>>>>>> )
>>>>>>>>
>>>>>>>> }
>>>>>>>>
>>>>>>>> 2) you can create the rule similar as the one you have, and
>>>>>>>> search for the linked elements.
>>>>>>>>
>>>>>>>> rule ActionsToResource {
>>>>>>>> from
>>>>>>>> cO : MMA!Resource
>>>>>>>> to
>>>>>>>> out : MMB!Resource
>>>>>>>> (
>>>>>>>> action <- cO.getOutputActions() -- The helper is
>>>>>>>> created for better readability.
>>>>>>>> )
>>>>>>>> }
>>>>>>>>
>>>>>>>>
>>>>>>>> helper context MMA!Resource getOutputActions() : Sequence
>>>>>>>> (MMA!Action) =
>>>>>>>> -- the helper should search for the ResourceCombination
>>>>>>>> links and that returns the model elements based on the values
>>>>>>>> of the references targetResource and createAction.
>>>>>>>>
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>>
>>>>>>>> Marcos.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Juan Pedro Silva wrote:
>>>>>>>>> Marcos, I'm back to this after some time doing some other stuff.
>>>>>>>>> I have a doubt regarding how to link the semantics of the
>>>>>>>>> transformation with the definition of the weaving metamodel
>>>>>>>>> extensions.
>>>>>>>>>
>>>>>>>>> For example, I define the following extension (I based it on
>>>>>>>>> the AOM use case):
>>>>>>>>>
>>>>>>>>> class ResourceCombination extends WLink {
>>>>>>>>> -- @subsets end
>>>>>>>>> reference targetResource [*] container : Resource;
>>>>>>>>> -- @subsets end
>>>>>>>>> reference createActions [*] container : Resource;
>>>>>>>>> }
>>>>>>>>> class Resource extends WLinkEnd {
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> and now I want to express that, when I draw a
>>>>>>>>> "ResourceCombination" link, every action that exists on the
>>>>>>>>> "createActions" Resource should be created in the
>>>>>>>>> "targetResource" Resource (I want to do more complicated
>>>>>>>>> things with it, but lets start with this).
>>>>>>>>> In atl, such rule would be:
>>>>>>>>>
>>>>>>>>> rule ActionsToResource
>>>>>>>>> --My guess is that the rule name doesn't affect
>>>>>>>>> {
>>>>>>>>> from
>>>>>>>>> cO : MMA!Resource
>>>>>>>>> to
>>>>>>>>> out : MMB!Resource
>>>>>>>>> (
>>>>>>>>> action <- cO.action
>>>>>>>>> --where "action" is a set of "Action"
>>>>>>>>> elements )
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> What I don't know how to do is to associate the weaving model
>>>>>>>>> (.amw) with the transformation rules (.atl), in order to apply
>>>>>>>>> the weavings.
>>>>>>>>> How does the linking of the amw extensions with the rules
>>>>>>>>> takes place?.
>>>>>>>>> Thank you very much.
>>>>>>>>> Regards,
>>>>>>>>> Juan Pedro
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Marcos Didonet Del Fabro escribió:
>>>>>>>>>> Hello,
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> In aspect oriented modeling, the metamodels are combined. It
>>>>>>>>>> would be the creation of MMA + SecureUML metamodel based on
>>>>>>>>>> links between MMA and SecureUML.
>>>>>>>>>>
>>>>>>>>>> Your case seems more similar to the "Merge of geographical
>>>>>>>>>> data" use case.
>>>>>>>>>> http://www.eclipse.org/gmt/amw/usecases/mergeSVG/.
>>>>>>>>>>
>>>>>>>>>> This is a complex case, where the generated transformation
>>>>>>>>>> must take two models as input and produce one model as
>>>>>>>>>> output. You need a special extension of AMW to support this
>>>>>>>>>> kind of scenario. Take a look on this use case to see if you
>>>>>>>>>> can get some inspiration. :) Let me know if you have any
>>>>>>>>>> other questions.
>>>>>>>>>>
>>>>>>>>>> Regards,
>>>>>>>>>>
>>>>>>>>>> Marcos.
>>>>>>>>>>
>>>>>>>>>> Juan Pedro Silva wrote:
>>>>>>>>>>> Hi Marcos and everybody.
>>>>>>>>>>> I'm trying to use AMW for the first time, and I believe I
>>>>>>>>>>> could use some help from people with more knowledge of it
>>>>>>>>>>> than me.
>>>>>>>>>>>
>>>>>>>>>>> I would like to use AMW to combine models (in a sort of
>>>>>>>>>>> Aspect-Oriented Modeling). I have a Model 'IN1'
>>>>>>>>>>> corresponding to Meta-Model "A" (something like a simpler
>>>>>>>>>>> version of UML), and a second model "IN2", that is a
>>>>>>>>>>> security model that corresponds to SecureUML metamodel. I
>>>>>>>>>>> wanted to combine this two models into a target model that
>>>>>>>>>>> corresponds to a metamodel that is the result of the merging
>>>>>>>>>>> of the first two (see the attached picture). This
>>>>>>>>>>> "combination" of the models is more than a mere merging.
>>>>>>>>>>>
>>>>>>>>>>> How could I do this?. In the use cases I saw from the
>>>>>>>>>>> website there is always one input model and some matching
>>>>>>>>>>> rules to generate one output model (sort of as in a simple
>>>>>>>>>>> ATL transformation).
>>>>>>>>>>> I tried using the wizard declaring two input models (IN1 and
>>>>>>>>>>> IN2) and the output metamodel, but when it comes to choosing
>>>>>>>>>>> the input, I can only choose one element from either one of
>>>>>>>>>>> the input models.
>>>>>>>>>>>
>>>>>>>>>>> I believe I'm missing the big picture here, and I surely
>>>>>>>>>>> need some advice to get going.
>>>>>>>>>>> Any help will be greatly appreciated.
>>>>>>>>>>> Regards,
>>>>>>>>>>> Juan Pedro
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ------------------------------------------------------------ ------------
>>>>>>>>>>>
>>>>>>>>>>>
|
|
|
Re: Model combination. [message #469561 is a reply to message #469559] |
Fri, 30 January 2009 17:19 |
Marcos Didonet Del Fabro Messages: 84 Registered: July 2009 |
Member |
|
|
Hello,
I think I know the problem. One of the metamodels (right) refers to some
elements from Ecore, for instance, datatypes such as EString, EBoolean,
EInteger.
In this case, the EMF model handler resolves this reference, and it
"includes" all Ecore into the metamodel, so the matching transformation
will also match elements such as EAnnotation, EClass,
EStructuralFeature, etc.
These references should be deleted to be able to correctly execute the
matching transformations.
When creating "clean" metamodels, this practice should be avoided. In
the case of data types, the better solution is to create a package
"DataTypes" and create the corresponding data types (String, Double,
etc). This is how we proceed when creating KM3 or Ecore metamodels. You
can find examples int the ATL or AMW use cases page.
Regards,
Marcos.
Juan Pedro Silva wrote:
> You mean the EAnnotation element from the Ecore metamodel?.
> There is no "EAnnotation" element in my metamodels (input or output).
> There are some comments, however, in the input metamodel which are
> expressed as:
>
> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
> <details key="documentation" value="Some documentation text"/>
> </eAnnotations>
>
> I see there are mapping rules in the "Cartesian Product" result with
> right elements EAnnotation (I believe it's allways the right element),
> but such a metaclass/element doesn't exist in the target metamodel (I
> opened it in a text editor and searched for the "EAnnotation" with no
> results), nor does the previously described comments.
> Hope this helps.
>
> Marcos Didonet Del Fabro escribió:
>>
>> It seems something related with the EAnnotation element. Can you
>> explain what is it about?
>>
>> Marcos.
>>
>> Juan Pedro Silva wrote:
>>> Making a new model weaverwith the metamodels in the root folder of
>>> the same project has the same results as in the previous one,
>>> regretfully.
>>>
>>> Juan Pedro Silva escribió:
>>>> Marcos:
>>>>
>>>> <leftM xsi:type="_1:ModelRef" xmi:id="ModelRef1" name="leftM"
>>>> ref="/iBuilderSecureUMLComposition/metamodels/iBuilderMM.ecore ">
>>>>
>>>> <rightM xsi:type="_1:ModelRef" xmi:id="ModelRef2" name="rightM"
>>>> ref=" /iBuilderSecureUMLComposition/metamodels/iBuilder_plus_Secur eUML_Flat_MM.ecore ">
>>>>
>>>>
>>>> And the .prop.amw file:
>>>>
>>>> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
>>>> <weaver>
>>>> <weaving>
>>>> <relative-path>/iBuilderMatching/iBuilderMatching.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>/iBuilderSecureUMLComposition/metamodels/iBuilderMM.ecore </metamodel-relative-path>
>>>>
>>>> <reference>leftM</reference>
>>>> <title>leftM</title>
>>>> <panel>DefaultWovenPanelExtension</panel>
>>>> <wmodelref>ModelRef</wmodelref>
>>>> </woven>
>>>> <woven id="1">
>>>> <model-relative-path>null</model-relative-path>
>>>> <metamodel-relative-path> /iBuilderSecureUMLComposition/metamodels/iBuilder_plus_Secur eUML_Flat_MM.ecore </metamodel-relative-path>
>>>>
>>>> <reference>rightM</reference>
>>>> <title>rightM</title>
>>>> <panel>DefaultWovenPanelExtension</panel>
>>>> <wmodelref>ModelRef</wmodelref>
>>>> </woven>
>>>> </weaver>
>>>>
>>>> I load the metamodels in the wizard from other project, do you think
>>>> this could create problems?.
>>>> I could try copying them into this one and see if that helps.
>>>> Regards, and thanks for your help.
>>>>
>>>>
>>>>
>>>> Marcos Didonet Del Fabro escribió:
>>>>> Hi,
>>>>>
>>>>> The problem is that it didn't find the right element (it returned a
>>>>> "null" in the getElementRef method. However, I cannot say why this
>>>>> is happening. Maybe there is a path problem or something related.
>>>>>
>>>>> Can you copy the value of the "rightM" and "leftM" elements, and
>>>>> an excerpt of the .prop.amw.file with the file paths?
>>>>>
>>>>> The "rightM" element looks like the following:
>>>>> <rightM xsi:type="_1:ModelRef" xmi:id="ModelRef2" name="rightM"
>>>>> ref="/<metamodelpath>.ecore">
>>>>>
>>>>>
>>>>>
>>>>> Marcos.
>>>>>
>>>>> Juan Pedro Silva wrote:
>>>>>> Hi Marcos, thanks for your quick answer.
>>>>>> Ok on the HOT, I'll work on it.
>>>>>> Regarding the matching operations, I was using the extensions you
>>>>>> enumerated, and no others. I was following the "Metamodel
>>>>>> comparison" use case verbatim with my own metamodels.
>>>>>> The input model for the "Name Equality" matching operation was the
>>>>>> output of the "cartesian product" operation. Validating this model
>>>>>> returns no error or warnings.
>>>>>>
>>>>>> I looked for the matching rule (in the "_cp.amw") model that shows
>>>>>> up in the error stack ("UIComboBox_EAnnotation"), and it has a
>>>>>> right element:
>>>>>>
>>>>>> <ownedElement xsi:type="ElementEqual"
>>>>>> name="UIComboBox_EAnnotation" similarity="0.0">
>>>>>> <left xsi:type="LeftElement" name="UIComboBox"
>>>>>> element="//@leftM/@ownedElementRef.18"/>
>>>>>> <right xsi:type="RightElement" name="EAnnotation"
>>>>>> element="//@rightM/@ownedElementRef.108"/>
>>>>>> </ownedElement>
>>>>>>
>>>>>> I even navigated throw the "_cp.amw" file (opening it with the
>>>>>> text editor) and found no rule that hadn't a right element (this
>>>>>> was not exhaustive, though, as there are 223214 lines in that file).
>>>>>> Re-running the "Name Equality" operation throws the same error but
>>>>>> in a different rule each time.
>>>>>> Any ideas?, would size be an issue?. I ask this because it takes
>>>>>> quite some time (a couple of minutes) to open this file with the
>>>>>> AMW editor, for instance.
>>>>>> Regards,
>>>>>> Juan Pedro
>>>>>>
>>>>>>
>>>>>> Marcos Didonet Del Fabro escribió:
>>>>>>> Hello,
>>>>>>>
>>>>>>> The matching transformations, as well as the corresponding HOTs,
>>>>>>> are implemented based on specific extensions to the AMW core
>>>>>>> metamodel. If you want to use new extensions, the HOT must be
>>>>>>> extended to be able to support them.
>>>>>>>
>>>>>>> To execute the matching transformations of the plug-in, the
>>>>>>> following extensions are needed:
>>>>>>> - mw_base_ext
>>>>>>> - mmw_match (equality, cardinality, type and conformance,
>>>>>>> Cartesian product, link rewriting, threshold)
>>>>>>> - mm_propagation (SF, propagation graph)
>>>>>>> - mmw_compare (not equivalence)
>>>>>>>
>>>>>>> If you add new extensions, the transformations won't produce any
>>>>>>> additional result, since they are not aware of the existence of
>>>>>>> new types of links.
>>>>>>>
>>>>>>> Now, looking at your error log, it seems that you don't have any
>>>>>>> element associated to the "right" reference:
>>>>>>>
>>>>>>> variables = {left = left!UIComboBox}}, 'right']
>>>>>>>
>>>>>>> The transformations need to have the "left" and "right"
>>>>>>> references set up in the weaving model.
>>>>>>>
>>>>>>> Regards,
>>>>>>>
>>>>>>> Marcos.
>>>>>>>
>>>>>>>
>>>>>>> Juan Pedro Silva wrote:
>>>>>>>> Hi Marcos, sorry for not being clear.
>>>>>>>> Your answer is of great help to manually generate the
>>>>>>>> transformations. I'm currently generating the weaving model
>>>>>>>> manually, but it will take some time to finish due to the size
>>>>>>>> (moderate, but not small) of the metamodels. After that I'll
>>>>>>>> give this a try.
>>>>>>>>
>>>>>>>> I was referring to the HOT (or "transfGen", as you call it in
>>>>>>>> your phd Thesis).
>>>>>>>> I'm having problems with the automatic generation of the
>>>>>>>> transformation, in various steps.
>>>>>>>> What I'm trying to do at this point (I postponed the combination
>>>>>>>> of models until I get this right) is:
>>>>>>>>
>>>>>>>> 1. An automatic Matching model (as in the "Metamodel
>>>>>>>> comparison use
>>>>>>>> case") for my own metamodels.
>>>>>>>> 2. Manually tune this model with some other wlink extensions
>>>>>>>> (previously loading my km3 extension).
>>>>>>>> 3. Generate the ATL transformation (HOT) by means of the AMW
>>>>>>>> context
>>>>>>>> menu option.
>>>>>>>>
>>>>>>>> However, I'm getting errors in step 1. I can execute the
>>>>>>>> "Metamodel Match -> Cartesian Product" (takes long but works),
>>>>>>>> but I get errors when running the "Name Equality" on the cp
>>>>>>>> result (I'm attaching the console output). I also get an error
>>>>>>>> while trying step 3 on a partial weaving model, but as the
>>>>>>>> weaving model was partial and manual, I'll wait until it is
>>>>>>>> complete and try again.
>>>>>>>>
>>>>>>>> The question would be, are there any conditions on the
>>>>>>>> metamodels in order for the matching to work?, and is the
>>>>>>>> available HOT general enough for using it with our own
>>>>>>>> weaving-metamodel extensions, or I am supposed to make my own
>>>>>>>> HOTs for them?.
>>>>>>>>
>>>>>>>> Thanks again, Marcos.
>>>>>>>> Regards,
>>>>>>>> Juan Pedro
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Marcos Didonet Del Fabro escribió:
>>>>>>>>>
>>>>>>>>> Hello,
>>>>>>>>>
>>>>>>>>> I didn't understand what you mean by "linking the rules with ATL".
>>>>>>>>>
>>>>>>>>> You can set the weaving model as input (or output) in the ATL
>>>>>>>>> transformation, and than use it in different ways. I depict
>>>>>>>>> some below:
>>>>>>>>>
>>>>>>>>> The signature of the transformation would be the following:
>>>>>>>>>
>>>>>>>>> module MyModule create OUT : MMB from IN : MMA, IN2 : AMW;
>>>>>>>>>
>>>>>>>>> 1) Matching the weaving link + the target actions:
>>>>>>>>>
>>>>>>>>> rule MatchLink {
>>>>>>>>>
>>>>>>>>> from
>>>>>>>>> link : AMW!ResourceCombination, resource : MMA!Resource (some
>>>>>>>>> condition to verify the correct input resource )
>>>>>>>>>
>>>>>>>>> to
>>>>>>>>> out : MMB!Resource (
>>>>>>>>> action <- -- check for the target resource actions
>>>>>>>>> -- see the AMW model handler Wiki
>>>>>>>>> (http://wiki.eclipse.org/index.php/AMW_Model_Handler) to check
>>>>>>>>> how the getReffered() method works)
>>>>>>>>> )
>>>>>>>>>
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> 2) you can create the rule similar as the one you have, and
>>>>>>>>> search for the linked elements.
>>>>>>>>>
>>>>>>>>> rule ActionsToResource {
>>>>>>>>> from
>>>>>>>>> cO : MMA!Resource
>>>>>>>>> to
>>>>>>>>> out : MMB!Resource
>>>>>>>>> (
>>>>>>>>> action <- cO.getOutputActions() -- The helper is
>>>>>>>>> created for better readability.
>>>>>>>>> )
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> helper context MMA!Resource getOutputActions() : Sequence
>>>>>>>>> (MMA!Action) =
>>>>>>>>> -- the helper should search for the ResourceCombination
>>>>>>>>> links and that returns the model elements based on the values
>>>>>>>>> of the references targetResource and createAction.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Regards,
>>>>>>>>>
>>>>>>>>> Marcos.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Juan Pedro Silva wrote:
>>>>>>>>>> Marcos, I'm back to this after some time doing some other stuff.
>>>>>>>>>> I have a doubt regarding how to link the semantics of the
>>>>>>>>>> transformation with the definition of the weaving metamodel
>>>>>>>>>> extensions.
>>>>>>>>>>
>>>>>>>>>> For example, I define the following extension (I based it on
>>>>>>>>>> the AOM use case):
>>>>>>>>>>
>>>>>>>>>> class ResourceCombination extends WLink {
>>>>>>>>>> -- @subsets end
>>>>>>>>>> reference targetResource [*] container : Resource;
>>>>>>>>>> -- @subsets end
>>>>>>>>>> reference createActions [*] container : Resource;
>>>>>>>>>> }
>>>>>>>>>> class Resource extends WLinkEnd {
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>> and now I want to express that, when I draw a
>>>>>>>>>> "ResourceCombination" link, every action that exists on the
>>>>>>>>>> "createActions" Resource should be created in the
>>>>>>>>>> "targetResource" Resource (I want to do more complicated
>>>>>>>>>> things with it, but lets start with this).
>>>>>>>>>> In atl, such rule would be:
>>>>>>>>>>
>>>>>>>>>> rule ActionsToResource
>>>>>>>>>> --My guess is that the rule name doesn't affect
>>>>>>>>>> {
>>>>>>>>>> from
>>>>>>>>>> cO : MMA!Resource
>>>>>>>>>> to
>>>>>>>>>> out : MMB!Resource
>>>>>>>>>> (
>>>>>>>>>> action <- cO.action
>>>>>>>>>> --where "action" is a set of "Action"
>>>>>>>>>> elements )
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>> What I don't know how to do is to associate the weaving model
>>>>>>>>>> (.amw) with the transformation rules (.atl), in order to apply
>>>>>>>>>> the weavings.
>>>>>>>>>> How does the linking of the amw extensions with the rules
>>>>>>>>>> takes place?.
>>>>>>>>>> Thank you very much.
>>>>>>>>>> Regards,
>>>>>>>>>> Juan Pedro
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Marcos Didonet Del Fabro escribió:
>>>>>>>>>>> Hello,
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> In aspect oriented modeling, the metamodels are combined. It
>>>>>>>>>>> would be the creation of MMA + SecureUML metamodel based on
>>>>>>>>>>> links between MMA and SecureUML.
>>>>>>>>>>>
>>>>>>>>>>> Your case seems more similar to the "Merge of geographical
>>>>>>>>>>> data" use case.
>>>>>>>>>>> http://www.eclipse.org/gmt/amw/usecases/mergeSVG/.
>>>>>>>>>>>
>>>>>>>>>>> This is a complex case, where the generated transformation
>>>>>>>>>>> must take two models as input and produce one model as
>>>>>>>>>>> output. You need a special extension of AMW to support this
>>>>>>>>>>> kind of scenario. Take a look on this use case to see if you
>>>>>>>>>>> can get some inspiration. :) Let me know if you have any
>>>>>>>>>>> other questions.
>>>>>>>>>>>
>>>>>>>>>>> Regards,
>>>>>>>>>>>
>>>>>>>>>>> Marcos.
>>>>>>>>>>>
>>>>>>>>>>> Juan Pedro Silva wrote:
>>>>>>>>>>>> Hi Marcos and everybody.
>>>>>>>>>>>> I'm trying to use AMW for the first time, and I believe I
>>>>>>>>>>>> could use some help from people with more knowledge of it
>>>>>>>>>>>> than me.
>>>>>>>>>>>>
>>>>>>>>>>>> I would like to use AMW to combine models (in a sort of
>>>>>>>>>>>> Aspect-Oriented Modeling). I have a Model 'IN1'
>>>>>>>>>>>> corresponding to Meta-Model "A" (something like a simpler
>>>>>>>>>>>> version of UML), and a second model "IN2", that is a
>>>>>>>>>>>> security model that corresponds to SecureUML metamodel. I
>>>>>>>>>>>> wanted to combine this two models into a target model that
>>>>>>>>>>>> corresponds to a metamodel that is the result of the merging
>>>>>>>>>>>> of the first two (see the attached picture). This
>>>>>>>>>>>> "combination" of the models is more than a mere merging.
>>>>>>>>>>>>
>>>>>>>>>>>> How could I do this?. In the use cases I saw from the
>>>>>>>>>>>> website there is always one input model and some matching
>>>>>>>>>>>> rules to generate one output model (sort of as in a simple
>>>>>>>>>>>> ATL transformation).
>>>>>>>>>>>> I tried using the wizard declaring two input models (IN1 and
>>>>>>>>>>>> IN2) and the output metamodel, but when it comes to choosing
>>>>>>>>>>>> the input, I can only choose one element from either one of
>>>>>>>>>>>> the input models.
>>>>>>>>>>>>
>>>>>>>>>>>> I believe I'm missing the big picture here, and I surely
>>>>>>>>>>>> need some advice to get going.
>>>>>>>>>>>> Any help will be greatly appreciated.
>>>>>>>>>>>> Regards,
>>>>>>>>>>>> Juan Pedro
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ------------------------------------------------------------ ------------
>>>>>>>>>>>>
>>>>>>>>>>>>
|
|
|
Re: Model combination. [message #469564 is a reply to message #469561] |
Sat, 31 January 2009 01:18 |
Juan Pedro Silva Messages: 258 Registered: July 2009 |
Senior Member |
|
|
Marcos, you were right: deleting the EAnnotation elements made it work.
Thanks.
I have one more question, regarding enumerations. I see enumerations are
not being matched. If I match them manually (using "Element Equal" for
enums and "Attribute Equal" for literals), the HOT generation throws an
error (feature abstract does not exist in MOF!EEnum).
I don't know if this is the same issue as with EAnnotations, being
Enumeration a MOF element and all.
Perhaps I should use another type of link (instead of "Element Equal"),
one that the HOT doesn't check for the elements to be abstract. Any
suggestions?.
Best regards and thank you very much for all your help,
Juan Pedro
Marcos Didonet Del Fabro escribió:
> Hello,
>
> I think I know the problem. One of the metamodels (right) refers to
> some elements from Ecore, for instance, datatypes such as EString,
> EBoolean, EInteger.
>
> In this case, the EMF model handler resolves this reference, and it
> "includes" all Ecore into the metamodel, so the matching
> transformation will also match elements such as EAnnotation, EClass,
> EStructuralFeature, etc.
> These references should be deleted to be able to correctly execute the
> matching transformations.
>
> When creating "clean" metamodels, this practice should be avoided. In
> the case of data types, the better solution is to create a package
> "DataTypes" and create the corresponding data types (String, Double,
> etc). This is how we proceed when creating KM3 or Ecore metamodels.
> You can find examples int the ATL or AMW use cases page.
>
> Regards,
>
> Marcos.
>
> Juan Pedro Silva wrote:
>> You mean the EAnnotation element from the Ecore metamodel?.
>> There is no "EAnnotation" element in my metamodels (input or output).
>> There are some comments, however, in the input metamodel which are
>> expressed as:
>>
>> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
>> <details key="documentation" value="Some documentation text"/>
>> </eAnnotations>
>>
>> I see there are mapping rules in the "Cartesian Product" result with
>> right elements EAnnotation (I believe it's allways the right
>> element), but such a metaclass/element doesn't exist in the target
>> metamodel (I opened it in a text editor and searched for the
>> "EAnnotation" with no results), nor does the previously described
>> comments.
>> Hope this helps.
>>
>> Marcos Didonet Del Fabro escribió:
>>>
>>> It seems something related with the EAnnotation element. Can you
>>> explain what is it about?
>>>
>>> Marcos.
>>>
>>> Juan Pedro Silva wrote:
>>>> Making a new model weaverwith the metamodels in the root folder of
>>>> the same project has the same results as in the previous one,
>>>> regretfully.
>>>>
>>>> Juan Pedro Silva escribió:
>>>>> Marcos:
>>>>>
>>>>> <leftM xsi:type="_1:ModelRef" xmi:id="ModelRef1" name="leftM"
>>>>> ref="/iBuilderSecureUMLComposition/metamodels/iBuilderMM.ecore ">
>>>>>
>>>>> <rightM xsi:type="_1:ModelRef" xmi:id="ModelRef2" name="rightM"
>>>>> ref=" /iBuilderSecureUMLComposition/metamodels/iBuilder_plus_Secur eUML_Flat_MM.ecore ">
>>>>>
>>>>>
>>>>> And the .prop.amw file:
>>>>>
>>>>> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
>>>>> <weaver>
>>>>> <weaving>
>>>>> <relative-path>/iBuilderMatching/iBuilderMatching.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>/iBuilderSecureUMLComposition/metamodels/iBuilderMM.ecore </metamodel-relative-path>
>>>>>
>>>>> <reference>leftM</reference>
>>>>> <title>leftM</title>
>>>>> <panel>DefaultWovenPanelExtension</panel>
>>>>> <wmodelref>ModelRef</wmodelref>
>>>>> </woven>
>>>>> <woven id="1">
>>>>> <model-relative-path>null</model-relative-path>
>>>>> <metamodel-relative-path> /iBuilderSecureUMLComposition/metamodels/iBuilder_plus_Secur eUML_Flat_MM.ecore </metamodel-relative-path>
>>>>>
>>>>> <reference>rightM</reference>
>>>>> <title>rightM</title>
>>>>> <panel>DefaultWovenPanelExtension</panel>
>>>>> <wmodelref>ModelRef</wmodelref>
>>>>> </woven>
>>>>> </weaver>
>>>>>
>>>>> I load the metamodels in the wizard from other project, do you
>>>>> think this could create problems?.
>>>>> I could try copying them into this one and see if that helps.
>>>>> Regards, and thanks for your help.
>>>>>
>>>>>
>>>>>
>>>>> Marcos Didonet Del Fabro escribió:
>>>>>> Hi,
>>>>>>
>>>>>> The problem is that it didn't find the right element (it returned
>>>>>> a "null" in the getElementRef method. However, I cannot say why
>>>>>> this is happening. Maybe there is a path problem or something
>>>>>> related.
>>>>>>
>>>>>> Can you copy the value of the "rightM" and "leftM" elements, and
>>>>>> an excerpt of the .prop.amw.file with the file paths?
>>>>>>
>>>>>> The "rightM" element looks like the following:
>>>>>> <rightM xsi:type="_1:ModelRef" xmi:id="ModelRef2" name="rightM"
>>>>>> ref="/<metamodelpath>.ecore">
>>>>>>
>>>>>>
>>>>>>
>>>>>> Marcos.
>>>>>>
>>>>>> Juan Pedro Silva wrote:
>>>>>>> Hi Marcos, thanks for your quick answer.
>>>>>>> Ok on the HOT, I'll work on it.
>>>>>>> Regarding the matching operations, I was using the extensions
>>>>>>> you enumerated, and no others. I was following the "Metamodel
>>>>>>> comparison" use case verbatim with my own metamodels.
>>>>>>> The input model for the "Name Equality" matching operation was
>>>>>>> the output of the "cartesian product" operation. Validating this
>>>>>>> model returns no error or warnings.
>>>>>>>
>>>>>>> I looked for the matching rule (in the "_cp.amw") model that
>>>>>>> shows up in the error stack ("UIComboBox_EAnnotation"), and it
>>>>>>> has a right element:
>>>>>>>
>>>>>>> <ownedElement xsi:type="ElementEqual"
>>>>>>> name="UIComboBox_EAnnotation" similarity="0.0">
>>>>>>> <left xsi:type="LeftElement" name="UIComboBox"
>>>>>>> element="//@leftM/@ownedElementRef.18"/>
>>>>>>> <right xsi:type="RightElement" name="EAnnotation"
>>>>>>> element="//@rightM/@ownedElementRef.108"/>
>>>>>>> </ownedElement>
>>>>>>>
>>>>>>> I even navigated throw the "_cp.amw" file (opening it with the
>>>>>>> text editor) and found no rule that hadn't a right element (this
>>>>>>> was not exhaustive, though, as there are 223214 lines in that
>>>>>>> file).
>>>>>>> Re-running the "Name Equality" operation throws the same error
>>>>>>> but in a different rule each time.
>>>>>>> Any ideas?, would size be an issue?. I ask this because it takes
>>>>>>> quite some time (a couple of minutes) to open this file with the
>>>>>>> AMW editor, for instance.
>>>>>>> Regards,
>>>>>>> Juan Pedro
>>>>>>>
>>>>>>>
>>>>>>> Marcos Didonet Del Fabro escribió:
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> The matching transformations, as well as the corresponding
>>>>>>>> HOTs, are implemented based on specific extensions to the AMW
>>>>>>>> core metamodel. If you want to use new extensions, the HOT must
>>>>>>>> be extended to be able to support them.
>>>>>>>>
>>>>>>>> To execute the matching transformations of the plug-in, the
>>>>>>>> following extensions are needed:
>>>>>>>> - mw_base_ext
>>>>>>>> - mmw_match (equality, cardinality, type and conformance,
>>>>>>>> Cartesian product, link rewriting, threshold)
>>>>>>>> - mm_propagation (SF, propagation graph)
>>>>>>>> - mmw_compare (not equivalence)
>>>>>>>>
>>>>>>>> If you add new extensions, the transformations won't produce
>>>>>>>> any additional result, since they are not aware of the
>>>>>>>> existence of new types of links.
>>>>>>>>
>>>>>>>> Now, looking at your error log, it seems that you don't have
>>>>>>>> any element associated to the "right" reference:
>>>>>>>>
>>>>>>>> variables = {left = left!UIComboBox}}, 'right']
>>>>>>>>
>>>>>>>> The transformations need to have the "left" and "right"
>>>>>>>> references set up in the weaving model.
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>>
>>>>>>>> Marcos.
>>>>>>>>
>>>>>>>>
>>>>>>>> Juan Pedro Silva wrote:
>>>>>>>>> Hi Marcos, sorry for not being clear.
>>>>>>>>> Your answer is of great help to manually generate the
>>>>>>>>> transformations. I'm currently generating the weaving model
>>>>>>>>> manually, but it will take some time to finish due to the size
>>>>>>>>> (moderate, but not small) of the metamodels. After that I'll
>>>>>>>>> give this a try.
>>>>>>>>>
>>>>>>>>> I was referring to the HOT (or "transfGen", as you call it in
>>>>>>>>> your phd Thesis).
>>>>>>>>> I'm having problems with the automatic generation of the
>>>>>>>>> transformation, in various steps.
>>>>>>>>> What I'm trying to do at this point (I postponed the
>>>>>>>>> combination of models until I get this right) is:
>>>>>>>>>
>>>>>>>>> 1. An automatic Matching model (as in the "Metamodel
>>>>>>>>> comparison use
>>>>>>>>> case") for my own metamodels.
>>>>>>>>> 2. Manually tune this model with some other wlink extensions
>>>>>>>>> (previously loading my km3 extension).
>>>>>>>>> 3. Generate the ATL transformation (HOT) by means of the
>>>>>>>>> AMW context
>>>>>>>>> menu option.
>>>>>>>>>
>>>>>>>>> However, I'm getting errors in step 1. I can execute the
>>>>>>>>> "Metamodel Match -> Cartesian Product" (takes long but works),
>>>>>>>>> but I get errors when running the "Name Equality" on the cp
>>>>>>>>> result (I'm attaching the console output). I also get an error
>>>>>>>>> while trying step 3 on a partial weaving model, but as the
>>>>>>>>> weaving model was partial and manual, I'll wait until it is
>>>>>>>>> complete and try again.
>>>>>>>>>
>>>>>>>>> The question would be, are there any conditions on the
>>>>>>>>> metamodels in order for the matching to work?, and is the
>>>>>>>>> available HOT general enough for using it with our own
>>>>>>>>> weaving-metamodel extensions, or I am supposed to make my own
>>>>>>>>> HOTs for them?.
>>>>>>>>>
>>>>>>>>> Thanks again, Marcos.
>>>>>>>>> Regards,
>>>>>>>>> Juan Pedro
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Marcos Didonet Del Fabro escribió:
>>>>>>>>>>
>>>>>>>>>> Hello,
>>>>>>>>>>
>>>>>>>>>> I didn't understand what you mean by "linking the rules with
>>>>>>>>>> ATL".
>>>>>>>>>>
>>>>>>>>>> You can set the weaving model as input (or output) in the ATL
>>>>>>>>>> transformation, and than use it in different ways. I depict
>>>>>>>>>> some below:
>>>>>>>>>>
>>>>>>>>>> The signature of the transformation would be the following:
>>>>>>>>>>
>>>>>>>>>> module MyModule create OUT : MMB from IN : MMA, IN2 : AMW;
>>>>>>>>>>
>>>>>>>>>> 1) Matching the weaving link + the target actions:
>>>>>>>>>>
>>>>>>>>>> rule MatchLink {
>>>>>>>>>>
>>>>>>>>>> from
>>>>>>>>>> link : AMW!ResourceCombination, resource : MMA!Resource
>>>>>>>>>> (some condition to verify the correct input resource )
>>>>>>>>>>
>>>>>>>>>> to
>>>>>>>>>> out : MMB!Resource (
>>>>>>>>>> action <- -- check for the target resource actions
>>>>>>>>>> -- see the AMW model handler Wiki
>>>>>>>>>> (http://wiki.eclipse.org/index.php/AMW_Model_Handler) to
>>>>>>>>>> check how the getReffered() method works)
>>>>>>>>>> )
>>>>>>>>>>
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>> 2) you can create the rule similar as the one you have, and
>>>>>>>>>> search for the linked elements.
>>>>>>>>>>
>>>>>>>>>> rule ActionsToResource {
>>>>>>>>>> from
>>>>>>>>>> cO : MMA!Resource
>>>>>>>>>> to
>>>>>>>>>> out : MMB!Resource
>>>>>>>>>> (
>>>>>>>>>> action <- cO.getOutputActions() -- The helper
>>>>>>>>>> is created for better readability.
>>>>>>>>>> )
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> helper context MMA!Resource getOutputActions() : Sequence
>>>>>>>>>> (MMA!Action) =
>>>>>>>>>> -- the helper should search for the ResourceCombination
>>>>>>>>>> links and that returns the model elements based on the values
>>>>>>>>>> of the references targetResource and createAction.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Regards,
>>>>>>>>>>
>>>>>>>>>> Marcos.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Juan Pedro Silva wrote:
>>>>>>>>>>> Marcos, I'm back to this after some time doing some other
>>>>>>>>>>> stuff.
>>>>>>>>>>> I have a doubt regarding how to link the semantics of the
>>>>>>>>>>> transformation with the definition of the weaving metamodel
>>>>>>>>>>> extensions.
>>>>>>>>>>>
>>>>>>>>>>> For example, I define the following extension (I based it on
>>>>>>>>>>> the AOM use case):
>>>>>>>>>>>
>>>>>>>>>>> class ResourceCombination extends WLink {
>>>>>>>>>>> -- @subsets end
>>>>>>>>>>> reference targetResource [*] container : Resource;
>>>>>>>>>>> -- @subsets end
>>>>>>>>>>> reference createActions [*] container : Resource;
>>>>>>>>>>> }
>>>>>>>>>>> class Resource extends WLinkEnd {
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>> and now I want to express that, when I draw a
>>>>>>>>>>> "ResourceCombination" link, every action that exists on the
>>>>>>>>>>> "createActions" Resource should be created in the
>>>>>>>>>>> "targetResource" Resource (I want to do more complicated
>>>>>>>>>>> things with it, but lets start with this).
>>>>>>>>>>> In atl, such rule would be:
>>>>>>>>>>>
>>>>>>>>>>> rule ActionsToResource
>>>>>>>>>>> --My guess is that the rule name doesn't affect
>>>>>>>>>>> {
>>>>>>>>>>> from
>>>>>>>>>>> cO : MMA!Resource
>>>>>>>>>>> to
>>>>>>>>>>> out : MMB!Resource
>>>>>>>>>>> (
>>>>>>>>>>> action <- cO.action
>>>>>>>>>>> --where "action" is a set of "Action"
>>>>>>>>>>> elements )
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>> What I don't know how to do is to associate the weaving
>>>>>>>>>>> model (.amw) with the transformation rules (.atl), in order
>>>>>>>>>>> to apply the weavings.
>>>>>>>>>>> How does the linking of the amw extensions with the rules
>>>>>>>>>>> takes place?.
>>>>>>>>>>> Thank you very much.
>>>>>>>>>>> Regards,
>>>>>>>>>>> Juan Pedro
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Marcos Didonet Del Fabro escribió:
>>>>>>>>>>>> Hello,
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> In aspect oriented modeling, the metamodels are combined.
>>>>>>>>>>>> It would be the creation of MMA + SecureUML metamodel based
>>>>>>>>>>>> on links between MMA and SecureUML.
>>>>>>>>>>>>
>>>>>>>>>>>> Your case seems more similar to the "Merge of geographical
>>>>>>>>>>>> data" use case.
>>>>>>>>>>>> http://www.eclipse.org/gmt/amw/usecases/mergeSVG/.
>>>>>>>>>>>>
>>>>>>>>>>>> This is a complex case, where the generated transformation
>>>>>>>>>>>> must take two models as input and produce one model as
>>>>>>>>>>>> output. You need a special extension of AMW to support this
>>>>>>>>>>>> kind of scenario. Take a look on this use case to see if
>>>>>>>>>>>> you can get some inspiration. :) Let me know if you have
>>>>>>>>>>>> any other questions.
>>>>>>>>>>>>
>>>>>>>>>>>> Regards,
>>>>>>>>>>>>
>>>>>>>>>>>> Marcos.
>>>>>>>>>>>>
>>>>>>>>>>>> Juan Pedro Silva wrote:
>>>>>>>>>>>>> Hi Marcos and everybody.
>>>>>>>>>>>>> I'm trying to use AMW for the first time, and I believe I
>>>>>>>>>>>>> could use some help from people with more knowledge of it
>>>>>>>>>>>>> than me.
>>>>>>>>>>>>>
>>>>>>>>>>>>> I would like to use AMW to combine models (in a sort of
>>>>>>>>>>>>> Aspect-Oriented Modeling). I have a Model 'IN1'
>>>>>>>>>>>>> corresponding to Meta-Model "A" (something like a simpler
>>>>>>>>>>>>> version of UML), and a second model "IN2", that is a
>>>>>>>>>>>>> security model that corresponds to SecureUML metamodel. I
>>>>>>>>>>>>> wanted to combine this two models into a target model that
>>>>>>>>>>>>> corresponds to a metamodel that is the result of the
>>>>>>>>>>>>> merging of the first two (see the attached picture). This
>>>>>>>>>>>>> "combination" of the models is more than a mere merging.
>>>>>>>>>>>>>
>>>>>>>>>>>>> How could I do this?. In the use cases I saw from the
>>>>>>>>>>>>> website there is always one input model and some matching
>>>>>>>>>>>>> rules to generate one output model (sort of as in a simple
>>>>>>>>>>>>> ATL transformation).
>>>>>>>>>>>>> I tried using the wizard declaring two input models (IN1
>>>>>>>>>>>>> and IN2) and the output metamodel, but when it comes to
>>>>>>>>>>>>> choosing the input, I can only choose one element from
>>>>>>>>>>>>> either one of the input models.
>>>>>>>>>>>>>
>>>>>>>>>>>>> I believe I'm missing the big picture here, and I surely
>>>>>>>>>>>>> need some advice to get going.
>>>>>>>>>>>>> Any help will be greatly appreciated.
>>>>>>>>>>>>> Regards,
>>>>>>>>>>>>> Juan Pedro
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> ------------------------------------------------------------ ------------
>>>>>>>>>>>>>
>>>>>>>>>>>>>
|
|
|
Re: Model combination. [message #469567 is a reply to message #469564] |
Mon, 02 February 2009 09:30 |
Marcos Didonet Del Fabro Messages: 84 Registered: July 2009 |
Member |
|
|
Hello,
The matching transformations do not create links between enumerations.
We didn't implement the support to enumerations in the HOT. The HOT has
a rule that matches "ElementEqual" links, and it expects that they
connect two classes, so it tests the "abstract" property. That's why it
does not work.
You can create a different kind of link, though the current HOT won't
produce any extra result (but there will be no errors). You can, of
course, improve the HOT implementation to handle enumerations.
Regards,
Marcos.
Juan Pedro Silva wrote:
> Marcos, you were right: deleting the EAnnotation elements made it work.
> Thanks.
> I have one more question, regarding enumerations. I see enumerations are
> not being matched. If I match them manually (using "Element Equal" for
> enums and "Attribute Equal" for literals), the HOT generation throws an
> error (feature abstract does not exist in MOF!EEnum).
>
> I don't know if this is the same issue as with EAnnotations, being
> Enumeration a MOF element and all.
> Perhaps I should use another type of link (instead of "Element Equal"),
> one that the HOT doesn't check for the elements to be abstract. Any
> suggestions?.
>
> Best regards and thank you very much for all your help,
> Juan
> Pedro
>
>
>
> Marcos Didonet Del Fabro escribió:
>> Hello,
>>
>> I think I know the problem. One of the metamodels (right) refers to
>> some elements from Ecore, for instance, datatypes such as EString,
>> EBoolean, EInteger.
>>
>> In this case, the EMF model handler resolves this reference, and it
>> "includes" all Ecore into the metamodel, so the matching
>> transformation will also match elements such as EAnnotation, EClass,
>> EStructuralFeature, etc.
>> These references should be deleted to be able to correctly execute the
>> matching transformations.
>>
>> When creating "clean" metamodels, this practice should be avoided. In
>> the case of data types, the better solution is to create a package
>> "DataTypes" and create the corresponding data types (String, Double,
>> etc). This is how we proceed when creating KM3 or Ecore metamodels.
>> You can find examples int the ATL or AMW use cases page.
>>
>> Regards,
>>
>> Marcos.
>>
>> Juan Pedro Silva wrote:
>>> You mean the EAnnotation element from the Ecore metamodel?.
>>> There is no "EAnnotation" element in my metamodels (input or output).
>>> There are some comments, however, in the input metamodel which are
>>> expressed as:
>>>
>>> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
>>> <details key="documentation" value="Some documentation text"/>
>>> </eAnnotations>
>>>
>>> I see there are mapping rules in the "Cartesian Product" result with
>>> right elements EAnnotation (I believe it's allways the right
>>> element), but such a metaclass/element doesn't exist in the target
>>> metamodel (I opened it in a text editor and searched for the
>>> "EAnnotation" with no results), nor does the previously described
>>> comments.
>>> Hope this helps.
>>>
>>> Marcos Didonet Del Fabro escribió:
>>>>
>>>> It seems something related with the EAnnotation element. Can you
>>>> explain what is it about?
>>>>
>>>> Marcos.
>>>>
>>>> Juan Pedro Silva wrote:
>>>>> Making a new model weaverwith the metamodels in the root folder of
>>>>> the same project has the same results as in the previous one,
>>>>> regretfully.
>>>>>
>>>>> Juan Pedro Silva escribió:
>>>>>> Marcos:
>>>>>>
>>>>>> <leftM xsi:type="_1:ModelRef" xmi:id="ModelRef1" name="leftM"
>>>>>> ref="/iBuilderSecureUMLComposition/metamodels/iBuilderMM.ecore ">
>>>>>>
>>>>>> <rightM xsi:type="_1:ModelRef" xmi:id="ModelRef2" name="rightM"
>>>>>> ref=" /iBuilderSecureUMLComposition/metamodels/iBuilder_plus_Secur eUML_Flat_MM.ecore ">
>>>>>>
>>>>>>
>>>>>> And the .prop.amw file:
>>>>>>
>>>>>> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
>>>>>> <weaver>
>>>>>> <weaving>
>>>>>> <relative-path>/iBuilderMatching/iBuilderMatching.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>/iBuilderSecureUMLComposition/metamodels/iBuilderMM.ecore </metamodel-relative-path>
>>>>>>
>>>>>> <reference>leftM</reference>
>>>>>> <title>leftM</title>
>>>>>> <panel>DefaultWovenPanelExtension</panel>
>>>>>> <wmodelref>ModelRef</wmodelref>
>>>>>> </woven>
>>>>>> <woven id="1">
>>>>>> <model-relative-path>null</model-relative-path>
>>>>>> <metamodel-relative-path> /iBuilderSecureUMLComposition/metamodels/iBuilder_plus_Secur eUML_Flat_MM.ecore </metamodel-relative-path>
>>>>>>
>>>>>> <reference>rightM</reference>
>>>>>> <title>rightM</title>
>>>>>> <panel>DefaultWovenPanelExtension</panel>
>>>>>> <wmodelref>ModelRef</wmodelref>
>>>>>> </woven>
>>>>>> </weaver>
>>>>>>
>>>>>> I load the metamodels in the wizard from other project, do you
>>>>>> think this could create problems?.
>>>>>> I could try copying them into this one and see if that helps.
>>>>>> Regards, and thanks for your help.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Marcos Didonet Del Fabro escribió:
>>>>>>> Hi,
>>>>>>>
>>>>>>> The problem is that it didn't find the right element (it returned
>>>>>>> a "null" in the getElementRef method. However, I cannot say why
>>>>>>> this is happening. Maybe there is a path problem or something
>>>>>>> related.
>>>>>>>
>>>>>>> Can you copy the value of the "rightM" and "leftM" elements, and
>>>>>>> an excerpt of the .prop.amw.file with the file paths?
>>>>>>>
>>>>>>> The "rightM" element looks like the following:
>>>>>>> <rightM xsi:type="_1:ModelRef" xmi:id="ModelRef2" name="rightM"
>>>>>>> ref="/<metamodelpath>.ecore">
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Marcos.
>>>>>>>
>>>>>>> Juan Pedro Silva wrote:
>>>>>>>> Hi Marcos, thanks for your quick answer.
>>>>>>>> Ok on the HOT, I'll work on it.
>>>>>>>> Regarding the matching operations, I was using the extensions
>>>>>>>> you enumerated, and no others. I was following the "Metamodel
>>>>>>>> comparison" use case verbatim with my own metamodels.
>>>>>>>> The input model for the "Name Equality" matching operation was
>>>>>>>> the output of the "cartesian product" operation. Validating this
>>>>>>>> model returns no error or warnings.
>>>>>>>>
>>>>>>>> I looked for the matching rule (in the "_cp.amw") model that
>>>>>>>> shows up in the error stack ("UIComboBox_EAnnotation"), and it
>>>>>>>> has a right element:
>>>>>>>>
>>>>>>>> <ownedElement xsi:type="ElementEqual"
>>>>>>>> name="UIComboBox_EAnnotation" similarity="0.0">
>>>>>>>> <left xsi:type="LeftElement" name="UIComboBox"
>>>>>>>> element="//@leftM/@ownedElementRef.18"/>
>>>>>>>> <right xsi:type="RightElement" name="EAnnotation"
>>>>>>>> element="//@rightM/@ownedElementRef.108"/>
>>>>>>>> </ownedElement>
>>>>>>>>
>>>>>>>> I even navigated throw the "_cp.amw" file (opening it with the
>>>>>>>> text editor) and found no rule that hadn't a right element (this
>>>>>>>> was not exhaustive, though, as there are 223214 lines in that
>>>>>>>> file).
>>>>>>>> Re-running the "Name Equality" operation throws the same error
>>>>>>>> but in a different rule each time.
>>>>>>>> Any ideas?, would size be an issue?. I ask this because it takes
>>>>>>>> quite some time (a couple of minutes) to open this file with the
>>>>>>>> AMW editor, for instance.
>>>>>>>> Regards,
>>>>>>>> Juan Pedro
>>>>>>>>
>>>>>>>>
>>>>>>>> Marcos Didonet Del Fabro escribió:
>>>>>>>>> Hello,
>>>>>>>>>
>>>>>>>>> The matching transformations, as well as the corresponding
>>>>>>>>> HOTs, are implemented based on specific extensions to the AMW
>>>>>>>>> core metamodel. If you want to use new extensions, the HOT must
>>>>>>>>> be extended to be able to support them.
>>>>>>>>>
>>>>>>>>> To execute the matching transformations of the plug-in, the
>>>>>>>>> following extensions are needed:
>>>>>>>>> - mw_base_ext
>>>>>>>>> - mmw_match (equality, cardinality, type and conformance,
>>>>>>>>> Cartesian product, link rewriting, threshold)
>>>>>>>>> - mm_propagation (SF, propagation graph)
>>>>>>>>> - mmw_compare (not equivalence)
>>>>>>>>>
>>>>>>>>> If you add new extensions, the transformations won't produce
>>>>>>>>> any additional result, since they are not aware of the
>>>>>>>>> existence of new types of links.
>>>>>>>>>
>>>>>>>>> Now, looking at your error log, it seems that you don't have
>>>>>>>>> any element associated to the "right" reference:
>>>>>>>>>
>>>>>>>>> variables = {left = left!UIComboBox}}, 'right']
>>>>>>>>>
>>>>>>>>> The transformations need to have the "left" and "right"
>>>>>>>>> references set up in the weaving model.
>>>>>>>>>
>>>>>>>>> Regards,
>>>>>>>>>
>>>>>>>>> Marcos.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Juan Pedro Silva wrote:
>>>>>>>>>> Hi Marcos, sorry for not being clear.
>>>>>>>>>> Your answer is of great help to manually generate the
>>>>>>>>>> transformations. I'm currently generating the weaving model
>>>>>>>>>> manually, but it will take some time to finish due to the size
>>>>>>>>>> (moderate, but not small) of the metamodels. After that I'll
>>>>>>>>>> give this a try.
>>>>>>>>>>
>>>>>>>>>> I was referring to the HOT (or "transfGen", as you call it in
>>>>>>>>>> your phd Thesis).
>>>>>>>>>> I'm having problems with the automatic generation of the
>>>>>>>>>> transformation, in various steps.
>>>>>>>>>> What I'm trying to do at this point (I postponed the
>>>>>>>>>> combination of models until I get this right) is:
>>>>>>>>>>
>>>>>>>>>> 1. An automatic Matching model (as in the "Metamodel
>>>>>>>>>> comparison use
>>>>>>>>>> case") for my own metamodels.
>>>>>>>>>> 2. Manually tune this model with some other wlink extensions
>>>>>>>>>> (previously loading my km3 extension).
>>>>>>>>>> 3. Generate the ATL transformation (HOT) by means of the
>>>>>>>>>> AMW context
>>>>>>>>>> menu option.
>>>>>>>>>>
>>>>>>>>>> However, I'm getting errors in step 1. I can execute the
>>>>>>>>>> "Metamodel Match -> Cartesian Product" (takes long but works),
>>>>>>>>>> but I get errors when running the "Name Equality" on the cp
>>>>>>>>>> result (I'm attaching the console output). I also get an error
>>>>>>>>>> while trying step 3 on a partial weaving model, but as the
>>>>>>>>>> weaving model was partial and manual, I'll wait until it is
>>>>>>>>>> complete and try again.
>>>>>>>>>>
>>>>>>>>>> The question would be, are there any conditions on the
>>>>>>>>>> metamodels in order for the matching to work?, and is the
>>>>>>>>>> available HOT general enough for using it with our own
>>>>>>>>>> weaving-metamodel extensions, or I am supposed to make my own
>>>>>>>>>> HOTs for them?.
>>>>>>>>>>
>>>>>>>>>> Thanks again, Marcos.
>>>>>>>>>> Regards,
>>>>>>>>>> Juan Pedro
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Marcos Didonet Del Fabro escribió:
>>>>>>>>>>>
>>>>>>>>>>> Hello,
>>>>>>>>>>>
>>>>>>>>>>> I didn't understand what you mean by "linking the rules with
>>>>>>>>>>> ATL".
>>>>>>>>>>>
>>>>>>>>>>> You can set the weaving model as input (or output) in the ATL
>>>>>>>>>>> transformation, and than use it in different ways. I depict
>>>>>>>>>>> some below:
>>>>>>>>>>>
>>>>>>>>>>> The signature of the transformation would be the following:
>>>>>>>>>>>
>>>>>>>>>>> module MyModule create OUT : MMB from IN : MMA, IN2 : AMW;
>>>>>>>>>>>
>>>>>>>>>>> 1) Matching the weaving link + the target actions:
>>>>>>>>>>>
>>>>>>>>>>> rule MatchLink {
>>>>>>>>>>>
>>>>>>>>>>> from
>>>>>>>>>>> link : AMW!ResourceCombination, resource : MMA!Resource
>>>>>>>>>>> (some condition to verify the correct input resource )
>>>>>>>>>>>
>>>>>>>>>>> to
>>>>>>>>>>> out : MMB!Resource (
>>>>>>>>>>> action <- -- check for the target resource actions
>>>>>>>>>>> -- see the AMW model handler Wiki
>>>>>>>>>>> (http://wiki.eclipse.org/index.php/AMW_Model_Handler) to
>>>>>>>>>>> check how the getReffered() method works)
>>>>>>>>>>> )
>>>>>>>>>>>
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>> 2) you can create the rule similar as the one you have, and
>>>>>>>>>>> search for the linked elements.
>>>>>>>>>>>
>>>>>>>>>>> rule ActionsToResource {
>>>>>>>>>>> from
>>>>>>>>>>> cO : MMA!Resource
>>>>>>>>>>> to
>>>>>>>>>>> out : MMB!Resource
>>>>>>>>>>> (
>>>>>>>>>>> action <- cO.getOutputActions() -- The helper
>>>>>>>>>>> is created for better readability.
>>>>>>>>>>> )
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> helper context MMA!Resource getOutputActions() : Sequence
>>>>>>>>>>> (MMA!Action) =
>>>>>>>>>>> -- the helper should search for the ResourceCombination
>>>>>>>>>>> links and that returns the model elements based on the values
>>>>>>>>>>> of the references targetResource and createAction.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Regards,
>>>>>>>>>>>
>>>>>>>>>>> Marcos.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Juan Pedro Silva wrote:
>>>>>>>>>>>> Marcos, I'm back to this after some time doing some other
>>>>>>>>>>>> stuff.
>>>>>>>>>>>> I have a doubt regarding how to link the semantics of the
>>>>>>>>>>>> transformation with the definition of the weaving metamodel
>>>>>>>>>>>> extensions.
>>>>>>>>>>>>
>>>>>>>>>>>> For example, I define the following extension (I based it on
>>>>>>>>>>>> the AOM use case):
>>>>>>>>>>>>
>>>>>>>>>>>> class ResourceCombination extends WLink {
>>>>>>>>>>>> -- @subsets end
>>>>>>>>>>>> reference targetResource [*] container : Resource;
>>>>>>>>>>>> -- @subsets end
>>>>>>>>>>>> reference createActions [*] container : Resource;
>>>>>>>>>>>> }
>>>>>>>>>>>> class Resource extends WLinkEnd {
>>>>>>>>>>>> }
>>>>>>>>>>>>
>>>>>>>>>>>> and now I want to express that, when I draw a
>>>>>>>>>>>> "ResourceCombination" link, every action that exists on the
>>>>>>>>>>>> "createActions" Resource should be created in the
>>>>>>>>>>>> "targetResource" Resource (I want to do more complicated
>>>>>>>>>>>> things with it, but lets start with this).
>>>>>>>>>>>> In atl, such rule would be:
>>>>>>>>>>>>
>>>>>>>>>>>> rule ActionsToResource
>>>>>>>>>>>> --My guess is that the rule name doesn't affect
>>>>>>>>>>>> {
>>>>>>>>>>>> from
>>>>>>>>>>>> cO : MMA!Resource
>>>>>>>>>>>> to
>>>>>>>>>>>> out : MMB!Resource
>>>>>>>>>>>> (
>>>>>>>>>>>> action <- cO.action
>>>>>>>>>>>> --where "action" is a set of "Action"
>>>>>>>>>>>> elements )
>>>>>>>>>>>> }
>>>>>>>>>>>>
>>>>>>>>>>>> What I don't know how to do is to associate the weaving
>>>>>>>>>>>> model (.amw) with the transformation rules (.atl), in order
>>>>>>>>>>>> to apply the weavings.
>>>>>>>>>>>> How does the linking of the amw extensions with the rules
>>>>>>>>>>>> takes place?.
>>>>>>>>>>>> Thank you very much.
>>>>>>>>>>>> Regards,
>>>>>>>>>>>> Juan Pedro
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Marcos Didonet Del Fabro escribió:
>>>>>>>>>>>>> Hello,
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> In aspect oriented modeling, the metamodels are combined.
>>>>>>>>>>>>> It would be the creation of MMA + SecureUML metamodel based
>>>>>>>>>>>>> on links between MMA and SecureUML.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Your case seems more similar to the "Merge of geographical
>>>>>>>>>>>>> data" use case.
>>>>>>>>>>>>> http://www.eclipse.org/gmt/amw/usecases/mergeSVG/.
>>>>>>>>>>>>>
>>>>>>>>>>>>> This is a complex case, where the generated transformation
>>>>>>>>>>>>> must take two models as input and produce one model as
>>>>>>>>>>>>> output. You need a special extension of AMW to support this
>>>>>>>>>>>>> kind of scenario. Take a look on this use case to see if
>>>>>>>>>>>>> you can get some inspiration. :) Let me know if you have
>>>>>>>>>>>>> any other questions.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Regards,
>>>>>>>>>>>>>
>>>>>>>>>>>>> Marcos.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Juan Pedro Silva wrote:
>>>>>>>>>>>>>> Hi Marcos and everybody.
>>>>>>>>>>>>>> I'm trying to use AMW for the first time, and I believe I
>>>>>>>>>>>>>> could use some help from people with more knowledge of it
>>>>>>>>>>>>>> than me.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I would like to use AMW to combine models (in a sort of
>>>>>>>>>>>>>> Aspect-Oriented Modeling). I have a Model 'IN1'
>>>>>>>>>>>>>> corresponding to Meta-Model "A" (something like a simpler
>>>>>>>>>>>>>> version of UML), and a second model "IN2", that is a
>>>>>>>>>>>>>> security model that corresponds to SecureUML metamodel. I
>>>>>>>>>>>>>> wanted to combine this two models into a target model that
>>>>>>>>>>>>>> corresponds to a metamodel that is the result of the
>>>>>>>>>>>>>> merging of the first two (see the attached picture). This
>>>>>>>>>>>>>> "combination" of the models is more than a mere merging.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> How could I do this?. In the use cases I saw from the
>>>>>>>>>>>>>> website there is always one input model and some matching
>>>>>>>>>>>>>> rules to generate one output model (sort of as in a simple
>>>>>>>>>>>>>> ATL transformation).
>>>>>>>>>>>>>> I tried using the wizard declaring two input models (IN1
>>>>>>>>>>>>>> and IN2) and the output metamodel, but when it comes to
>>>>>>>>>>>>>> choosing the input, I can only choose one element from
>>>>>>>>>>>>>> either one of the input models.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I believe I'm missing the big picture here, and I surely
>>>>>>>>>>>>>> need some advice to get going.
>>>>>>>>>>>>>> Any help will be greatly appreciated.
>>>>>>>>>>>>>> Regards,
>>>>>>>>>>>>>> Juan Pedro
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ------------------------------------------------------------ ------------
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
|
|
|
Re: Model combination. [message #469569 is a reply to message #469567] |
Mon, 02 February 2009 11:47 |
Juan Pedro Silva Messages: 258 Registered: July 2009 |
Senior Member |
|
|
Thanks for everything, Marcos.
I'll work on the HOT for my resource combination and include
enumerations in it.
Best regards,
Juan Pedro
Marcos Didonet Del Fabro escribió:
> Hello,
>
> The matching transformations do not create links between enumerations.
> We didn't implement the support to enumerations in the HOT. The HOT
> has a rule that matches "ElementEqual" links, and it expects that they
> connect two classes, so it tests the "abstract" property. That's why
> it does not work.
>
> You can create a different kind of link, though the current HOT won't
> produce any extra result (but there will be no errors). You can, of
> course, improve the HOT implementation to handle enumerations.
>
>
> Regards,
>
> Marcos.
>
> Juan Pedro Silva wrote:
>> Marcos, you were right: deleting the EAnnotation elements made it
>> work. Thanks.
>> I have one more question, regarding enumerations. I see enumerations
>> are not being matched. If I match them manually (using "Element
>> Equal" for enums and "Attribute Equal" for literals), the HOT
>> generation throws an error (feature abstract does not exist in
>> MOF!EEnum).
>>
>> I don't know if this is the same issue as with EAnnotations, being
>> Enumeration a MOF element and all.
>> Perhaps I should use another type of link (instead of "Element
>> Equal"), one that the HOT doesn't check for the elements to be
>> abstract. Any suggestions?.
>>
>> Best regards and thank you very much for all your help,
>>
>> Juan Pedro
>>
>>
>>
>> Marcos Didonet Del Fabro escribió:
>>> Hello,
>>>
>>> I think I know the problem. One of the metamodels (right) refers to
>>> some elements from Ecore, for instance, datatypes such as EString,
>>> EBoolean, EInteger.
>>>
>>> In this case, the EMF model handler resolves this reference, and it
>>> "includes" all Ecore into the metamodel, so the matching
>>> transformation will also match elements such as EAnnotation, EClass,
>>> EStructuralFeature, etc.
>>> These references should be deleted to be able to correctly execute
>>> the matching transformations.
>>>
>>> When creating "clean" metamodels, this practice should be avoided.
>>> In the case of data types, the better solution is to create a
>>> package "DataTypes" and create the corresponding data types (String,
>>> Double, etc). This is how we proceed when creating KM3 or Ecore
>>> metamodels. You can find examples int the ATL or AMW use cases page.
>>>
>>> Regards,
>>>
>>> Marcos.
>>>
>>> Juan Pedro Silva wrote:
>>>> You mean the EAnnotation element from the Ecore metamodel?.
>>>> There is no "EAnnotation" element in my metamodels (input or
>>>> output). There are some comments, however, in the input metamodel
>>>> which are expressed as:
>>>>
>>>> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
>>>> <details key="documentation" value="Some documentation text"/>
>>>> </eAnnotations>
>>>>
>>>> I see there are mapping rules in the "Cartesian Product" result
>>>> with right elements EAnnotation (I believe it's allways the right
>>>> element), but such a metaclass/element doesn't exist in the target
>>>> metamodel (I opened it in a text editor and searched for the
>>>> "EAnnotation" with no results), nor does the previously described
>>>> comments.
>>>> Hope this helps.
>>>>
>>>> Marcos Didonet Del Fabro escribió:
>>>>>
>>>>> It seems something related with the EAnnotation element. Can you
>>>>> explain what is it about?
>>>>>
>>>>> Marcos.
>>>>>
>>>>> Juan Pedro Silva wrote:
>>>>>> Making a new model weaverwith the metamodels in the root folder
>>>>>> of the same project has the same results as in the previous one,
>>>>>> regretfully.
>>>>>>
>>>>>> Juan Pedro Silva escribió:
>>>>>>> Marcos:
>>>>>>>
>>>>>>> <leftM xsi:type="_1:ModelRef" xmi:id="ModelRef1" name="leftM"
>>>>>>> ref="/iBuilderSecureUMLComposition/metamodels/iBuilderMM.ecore ">
>>>>>>>
>>>>>>> <rightM xsi:type="_1:ModelRef" xmi:id="ModelRef2" name="rightM"
>>>>>>> ref=" /iBuilderSecureUMLComposition/metamodels/iBuilder_plus_Secur eUML_Flat_MM.ecore ">
>>>>>>>
>>>>>>>
>>>>>>> And the .prop.amw file:
>>>>>>>
>>>>>>> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
>>>>>>> <weaver>
>>>>>>> <weaving>
>>>>>>> <relative-path>/iBuilderMatching/iBuilderMatching.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>/iBuilderSecureUMLComposition/metamodels/iBuilderMM.ecore </metamodel-relative-path>
>>>>>>>
>>>>>>> <reference>leftM</reference>
>>>>>>> <title>leftM</title>
>>>>>>> <panel>DefaultWovenPanelExtension</panel>
>>>>>>> <wmodelref>ModelRef</wmodelref>
>>>>>>> </woven>
>>>>>>> <woven id="1">
>>>>>>> <model-relative-path>null</model-relative-path>
>>>>>>> <metamodel-relative-path> /iBuilderSecureUMLComposition/metamodels/iBuilder_plus_Secur eUML_Flat_MM.ecore </metamodel-relative-path>
>>>>>>>
>>>>>>> <reference>rightM</reference>
>>>>>>> <title>rightM</title>
>>>>>>> <panel>DefaultWovenPanelExtension</panel>
>>>>>>> <wmodelref>ModelRef</wmodelref>
>>>>>>> </woven>
>>>>>>> </weaver>
>>>>>>>
>>>>>>> I load the metamodels in the wizard from other project, do you
>>>>>>> think this could create problems?.
>>>>>>> I could try copying them into this one and see if that helps.
>>>>>>> Regards, and thanks for your help.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Marcos Didonet Del Fabro escribió:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> The problem is that it didn't find the right element (it
>>>>>>>> returned a "null" in the getElementRef method. However, I
>>>>>>>> cannot say why this is happening. Maybe there is a path problem
>>>>>>>> or something related.
>>>>>>>>
>>>>>>>> Can you copy the value of the "rightM" and "leftM" elements,
>>>>>>>> and an excerpt of the .prop.amw.file with the file paths?
>>>>>>>>
>>>>>>>> The "rightM" element looks like the following:
>>>>>>>> <rightM xsi:type="_1:ModelRef" xmi:id="ModelRef2"
>>>>>>>> name="rightM" ref="/<metamodelpath>.ecore">
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Marcos.
>>>>>>>>
>>>>>>>> Juan Pedro Silva wrote:
>>>>>>>>> Hi Marcos, thanks for your quick answer.
>>>>>>>>> Ok on the HOT, I'll work on it.
>>>>>>>>> Regarding the matching operations, I was using the extensions
>>>>>>>>> you enumerated, and no others. I was following the "Metamodel
>>>>>>>>> comparison" use case verbatim with my own metamodels.
>>>>>>>>> The input model for the "Name Equality" matching operation was
>>>>>>>>> the output of the "cartesian product" operation. Validating
>>>>>>>>> this model returns no error or warnings.
>>>>>>>>>
>>>>>>>>> I looked for the matching rule (in the "_cp.amw") model that
>>>>>>>>> shows up in the error stack ("UIComboBox_EAnnotation"), and it
>>>>>>>>> has a right element:
>>>>>>>>>
>>>>>>>>> <ownedElement xsi:type="ElementEqual"
>>>>>>>>> name="UIComboBox_EAnnotation" similarity="0.0">
>>>>>>>>> <left xsi:type="LeftElement" name="UIComboBox"
>>>>>>>>> element="//@leftM/@ownedElementRef.18"/>
>>>>>>>>> <right xsi:type="RightElement" name="EAnnotation"
>>>>>>>>> element="//@rightM/@ownedElementRef.108"/>
>>>>>>>>> </ownedElement>
>>>>>>>>>
>>>>>>>>> I even navigated throw the "_cp.amw" file (opening it with the
>>>>>>>>> text editor) and found no rule that hadn't a right element
>>>>>>>>> (this was not exhaustive, though, as there are 223214 lines in
>>>>>>>>> that file).
>>>>>>>>> Re-running the "Name Equality" operation throws the same error
>>>>>>>>> but in a different rule each time.
>>>>>>>>> Any ideas?, would size be an issue?. I ask this because it
>>>>>>>>> takes quite some time (a couple of minutes) to open this file
>>>>>>>>> with the AMW editor, for instance.
>>>>>>>>> Regards,
>>>>>>>>> Juan Pedro
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Marcos Didonet Del Fabro escribió:
>>>>>>>>>> Hello,
>>>>>>>>>>
>>>>>>>>>> The matching transformations, as well as the corresponding
>>>>>>>>>> HOTs, are implemented based on specific extensions to the AMW
>>>>>>>>>> core metamodel. If you want to use new extensions, the HOT
>>>>>>>>>> must be extended to be able to support them.
>>>>>>>>>>
>>>>>>>>>> To execute the matching transformations of the plug-in, the
>>>>>>>>>> following extensions are needed:
>>>>>>>>>> - mw_base_ext
>>>>>>>>>> - mmw_match (equality, cardinality, type and conformance,
>>>>>>>>>> Cartesian product, link rewriting, threshold)
>>>>>>>>>> - mm_propagation (SF, propagation graph)
>>>>>>>>>> - mmw_compare (not equivalence)
>>>>>>>>>>
>>>>>>>>>> If you add new extensions, the transformations won't produce
>>>>>>>>>> any additional result, since they are not aware of the
>>>>>>>>>> existence of new types of links.
>>>>>>>>>>
>>>>>>>>>> Now, looking at your error log, it seems that you don't have
>>>>>>>>>> any element associated to the "right" reference:
>>>>>>>>>>
>>>>>>>>>> variables = {left = left!UIComboBox}}, 'right']
>>>>>>>>>>
>>>>>>>>>> The transformations need to have the "left" and "right"
>>>>>>>>>> references set up in the weaving model.
>>>>>>>>>>
>>>>>>>>>> Regards,
>>>>>>>>>>
>>>>>>>>>> Marcos.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Juan Pedro Silva wrote:
>>>>>>>>>>> Hi Marcos, sorry for not being clear.
>>>>>>>>>>> Your answer is of great help to manually generate the
>>>>>>>>>>> transformations. I'm currently generating the weaving model
>>>>>>>>>>> manually, but it will take some time to finish due to the
>>>>>>>>>>> size (moderate, but not small) of the metamodels. After that
>>>>>>>>>>> I'll give this a try.
>>>>>>>>>>>
>>>>>>>>>>> I was referring to the HOT (or "transfGen", as you call it
>>>>>>>>>>> in your phd Thesis).
>>>>>>>>>>> I'm having problems with the automatic generation of the
>>>>>>>>>>> transformation, in various steps.
>>>>>>>>>>> What I'm trying to do at this point (I postponed the
>>>>>>>>>>> combination of models until I get this right) is:
>>>>>>>>>>>
>>>>>>>>>>> 1. An automatic Matching model (as in the "Metamodel
>>>>>>>>>>> comparison use
>>>>>>>>>>> case") for my own metamodels.
>>>>>>>>>>> 2. Manually tune this model with some other wlink extensions
>>>>>>>>>>> (previously loading my km3 extension).
>>>>>>>>>>> 3. Generate the ATL transformation (HOT) by means of the
>>>>>>>>>>> AMW context
>>>>>>>>>>> menu option.
>>>>>>>>>>>
>>>>>>>>>>> However, I'm getting errors in step 1. I can execute the
>>>>>>>>>>> "Metamodel Match -> Cartesian Product" (takes long but
>>>>>>>>>>> works), but I get errors when running the "Name Equality" on
>>>>>>>>>>> the cp result (I'm attaching the console output). I also get
>>>>>>>>>>> an error while trying step 3 on a partial weaving model, but
>>>>>>>>>>> as the weaving model was partial and manual, I'll wait until
>>>>>>>>>>> it is complete and try again.
>>>>>>>>>>>
>>>>>>>>>>> The question would be, are there any conditions on the
>>>>>>>>>>> metamodels in order for the matching to work?, and is the
>>>>>>>>>>> available HOT general enough for using it with our own
>>>>>>>>>>> weaving-metamodel extensions, or I am supposed to make my
>>>>>>>>>>> own HOTs for them?.
>>>>>>>>>>>
>>>>>>>>>>> Thanks again, Marcos.
>>>>>>>>>>> Regards,
>>>>>>>>>>> Juan Pedro
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Marcos Didonet Del Fabro escribió:
>>>>>>>>>>>>
>>>>>>>>>>>> Hello,
>>>>>>>>>>>>
>>>>>>>>>>>> I didn't understand what you mean by "linking the rules
>>>>>>>>>>>> with ATL".
>>>>>>>>>>>>
>>>>>>>>>>>> You can set the weaving model as input (or output) in the
>>>>>>>>>>>> ATL transformation, and than use it in different ways. I
>>>>>>>>>>>> depict some below:
>>>>>>>>>>>>
>>>>>>>>>>>> The signature of the transformation would be the following:
>>>>>>>>>>>>
>>>>>>>>>>>> module MyModule create OUT : MMB from IN : MMA, IN2 : AMW;
>>>>>>>>>>>>
>>>>>>>>>>>> 1) Matching the weaving link + the target actions:
>>>>>>>>>>>>
>>>>>>>>>>>> rule MatchLink {
>>>>>>>>>>>>
>>>>>>>>>>>> from
>>>>>>>>>>>> link : AMW!ResourceCombination, resource : MMA!Resource
>>>>>>>>>>>> (some condition to verify the correct input resource )
>>>>>>>>>>>>
>>>>>>>>>>>> to
>>>>>>>>>>>> out : MMB!Resource (
>>>>>>>>>>>> action <- -- check for the target resource actions
>>>>>>>>>>>> -- see the AMW model handler Wiki
>>>>>>>>>>>> (http://wiki.eclipse.org/index.php/AMW_Model_Handler) to
>>>>>>>>>>>> check how the getReffered() method works)
>>>>>>>>>>>> )
>>>>>>>>>>>>
>>>>>>>>>>>> }
>>>>>>>>>>>>
>>>>>>>>>>>> 2) you can create the rule similar as the one you have, and
>>>>>>>>>>>> search for the linked elements.
>>>>>>>>>>>>
>>>>>>>>>>>> rule ActionsToResource {
>>>>>>>>>>>> from
>>>>>>>>>>>> cO : MMA!Resource
>>>>>>>>>>>> to
>>>>>>>>>>>> out : MMB!Resource
>>>>>>>>>>>> (
>>>>>>>>>>>> action <- cO.getOutputActions() -- The helper
>>>>>>>>>>>> is created for better readability.
>>>>>>>>>>>> )
>>>>>>>>>>>> }
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> helper context MMA!Resource getOutputActions() : Sequence
>>>>>>>>>>>> (MMA!Action) =
>>>>>>>>>>>> -- the helper should search for the ResourceCombination
>>>>>>>>>>>> links and that returns the model elements based on the
>>>>>>>>>>>> values of the references targetResource and createAction.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Regards,
>>>>>>>>>>>>
>>>>>>>>>>>> Marcos.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Juan Pedro Silva wrote:
>>>>>>>>>>>>> Marcos, I'm back to this after some time doing some other
>>>>>>>>>>>>> stuff.
>>>>>>>>>>>>> I have a doubt regarding how to link the semantics of the
>>>>>>>>>>>>> transformation with the definition of the weaving
>>>>>>>>>>>>> metamodel extensions.
>>>>>>>>>>>>>
>>>>>>>>>>>>> For example, I define the following extension (I based it
>>>>>>>>>>>>> on the AOM use case):
>>>>>>>>>>>>>
>>>>>>>>>>>>> class ResourceCombination extends WLink {
>>>>>>>>>>>>> -- @subsets end
>>>>>>>>>>>>> reference targetResource [*] container : Resource;
>>>>>>>>>>>>> -- @subsets end
>>>>>>>>>>>>> reference createActions [*] container : Resource;
>>>>>>>>>>>>> }
>>>>>>>>>>>>> class Resource extends WLinkEnd {
>>>>>>>>>>>>> }
>>>>>>>>>>>>>
>>>>>>>>>>>>> and now I want to express that, when I draw a
>>>>>>>>>>>>> "ResourceCombination" link, every action that exists on
>>>>>>>>>>>>> the "createActions" Resource should be created in the
>>>>>>>>>>>>> "targetResource" Resource (I want to do more complicated
>>>>>>>>>>>>> things with it, but lets start with this).
>>>>>>>>>>>>> In atl, such rule would be:
>>>>>>>>>>>>>
>>>>>>>>>>>>> rule
>>>>>>>>>>>>> ActionsToResource
>>>>>>>>>>>>> --My guess is that the rule name doesn't affect
>>>>>>>>>>>>> {
>>>>>>>>>>>>> from
>>>>>>>>>>>>> cO : MMA!Resource
>>>>>>>>>>>>> to
>>>>>>>>>>>>> out : MMB!Resource
>>>>>>>>>>>>> (
>>>>>>>>>>>>> action <-
>>>>>>>>>>>>> cO.action --where "action" is a set of
>>>>>>>>>>>>> "Action" elements )
>>>>>>>>>>>>> }
>>>>>>>>>>>>>
>>>>>>>>>>>>> What I don't know how to do is to associate the weaving
>>>>>>>>>>>>> model (.amw) with the transformation rules (.atl), in
>>>>>>>>>>>>> order to apply the weavings.
>>>>>>>>>>>>> How does the linking of the amw extensions with the rules
>>>>>>>>>>>>> takes place?.
>>>>>>>>>>>>> Thank you very much.
>>>>>>>>>>>>> Regards,
>>>>>>>>>>>>> Juan Pedro
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Marcos Didonet Del Fabro escribió:
>>>>>>>>>>>>>> Hello,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> In aspect oriented modeling, the metamodels are combined.
>>>>>>>>>>>>>> It would be the creation of MMA + SecureUML metamodel
>>>>>>>>>>>>>> based on links between MMA and SecureUML.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Your case seems more similar to the "Merge of
>>>>>>>>>>>>>> geographical data" use case.
>>>>>>>>>>>>>> http://www.eclipse.org/gmt/amw/usecases/mergeSVG/.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> This is a complex case, where the generated
>>>>>>>>>>>>>> transformation must take two models as input and produce
>>>>>>>>>>>>>> one model as output. You need a special extension of AMW
>>>>>>>>>>>>>> to support this kind of scenario. Take a look on this use
>>>>>>>>>>>>>> case to see if you can get some inspiration. :) Let me
>>>>>>>>>>>>>> know if you have any other questions.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Regards,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Marcos.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Juan Pedro Silva wrote:
>>>>>>>>>>>>>>> Hi Marcos and everybody.
>>>>>>>>>>>>>>> I'm trying to use AMW for the first time, and I believe
>>>>>>>>>>>>>>> I could use some help from people with more knowledge of
>>>>>>>>>>>>>>> it than me.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I would like to use AMW to combine models (in a sort of
>>>>>>>>>>>>>>> Aspect-Oriented Modeling). I have a Model 'IN1'
>>>>>>>>>>>>>>> corresponding to Meta-Model "A" (something like a
>>>>>>>>>>>>>>> simpler version of UML), and a second model "IN2", that
>>>>>>>>>>>>>>> is a security model that corresponds to SecureUML
>>>>>>>>>>>>>>> metamodel. I wanted to combine this two models into a
>>>>>>>>>>>>>>> target model that corresponds to a metamodel that is the
>>>>>>>>>>>>>>> result of the merging of the first two (see the attached
>>>>>>>>>>>>>>> picture). This "combination" of the models is more than
>>>>>>>>>>>>>>> a mere merging.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> How could I do this?. In the use cases I saw from the
>>>>>>>>>>>>>>> website there is always one input model and some
>>>>>>>>>>>>>>> matching rules to generate one output model (sort of as
>>>>>>>>>>>>>>> in a simple ATL transformation).
>>>>>>>>>>>>>>> I tried using the wizard declaring two input models (IN1
>>>>>>>>>>>>>>> and IN2) and the output metamodel, but when it comes to
>>>>>>>>>>>>>>> choosing the input, I can only choose one element from
>>>>>>>>>>>>>>> either one of the input models.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I believe I'm missing the big picture here, and I surely
>>>>>>>>>>>>>>> need some advice to get going.
>>>>>>>>>>>>>>> Any help will be greatly appreciated.
>>>>>>>>>>>>>>> Regards,
>>>>>>>>>>>>>>> Juan Pedro
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> ------------------------------------------------------------ ------------
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
|
|
|
Goto Forum:
Current Time: Tue Sep 24 16:30:45 GMT 2024
Powered by FUDForum. Page generated in 0.07173 seconds
|