[ATL]on defining source and domains with more than one element [message #25089] |
Fri, 23 March 2007 15:39 |
Eclipse User |
|
|
|
Originally posted by: maher.lamari.lip6.fr
Hi,
I would like to know if the current version of ATL supports defining a
source domain (the from part) with more than one element as in the following
relation which defines a class and an attribute in the source domain.
rule Class2Table {
from
c : UMLClass!Class (isPersistent) , a : UMLClass!Attribute
to
out : RDB!Table (
name <- c.name
)
}
Thanks in advance,
Maher
|
|
|
Re: [ATL]on defining source and domains with more than one element [message #25132 is a reply to message #25089] |
Fri, 23 March 2007 16:51 |
Eclipse User |
|
|
|
Originally posted by: marcos.didonet-del-fabro.univ-nantes.fr
Hi,
Yes, ATL 2006 supports matching several input elements. We have been using this feature
for a while to develop matching transformations that produce weaving models.
However, the guard should be unique for both elements, so you should rewrite your rule
like that:
rule Class2Table {
from
c : UMLClass!Class , a : UMLClass!Attribute (c.isPersistent)
....
This rule will match all classes and attributes of the model, not only the attributes
contained in class "c".
Don't forget to put the following annotation in the first line of your ATL transformation:
-- @atlcompiler atl2006
Regards,
Marcos.
Maher wrote:
> Hi,
>
> I would like to know if the current version of ATL supports defining a
> source domain (the from part) with more than one element as in the following
> relation which defines a class and an attribute in the source domain.
>
> rule Class2Table {
> from
>
> c : UMLClass!Class (isPersistent) , a : UMLClass!Attribute
>
> to
>
> out : RDB!Table (
>
> name <- c.name
>
> )
>
> }
>
>
>
> Thanks in advance,
>
>
>
> Maher
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.01495 seconds