Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Problem with ATL rules
[ATL] Problem with ATL rules [message #79435] Wed, 16 April 2008 18:27 Go to next message
Eclipse UserFriend
Originally posted by: a.kenzi.yahoo.fr

Dear colleagues
In order to test some ATL example, I defined several rules to generate
output models from input model conforming to their metamodels. The problem
is that when I define many rules in the same ATL file, only the first rule
which is executed. The others rules cannot be executed. I trying this with
many examples and I have the same problem.
Best regards,
adil
Re: [ATL] Problem with ATL rules [message #79480 is a reply to message #79435] Thu, 17 April 2008 15:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: a.kenzi.yahoo.fr

Dear collegues,
in order to describe my problem with ATL, I illustrate the Problem with an
extension of the Example provided With ATL : Author2Person. I just added
the class “Diploma” and the required reference to the Class Author
defined in the Author2Person example. and I added a class Qualification to
the metamodel Person.ecore:

The metamodel Author defined in the file Author.km3:

package Author {
class Author {
attribute name: String;
attribute surname: String;
reference diploms [*] : Diploma oppositeOf owner;

}
class Diploma {
attribute year: String;
attribute title : String;
reference owner : Author oppositeOf diploms;

}

}
package PrimitivesTypes {
datatype String;
}

The model which conforms to the metamodels Author.ecore ( after injecting
the Author.km3 to Author.ecore)

<?xml version="1.0" encoding="ASCII"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns="Author">
<Author name="David" surname="Touzet">
<diploms year="1999" title="PHD"/>
<diploms year="1990" title="bachelor"/>
</Author>
<Author name="Freddy" surname="Allilaire">
<diploms year="1999" title="PHD"/>
<diploms year="1990" title="bachelor"/>
<diploms year="1999" title="PHD"/>
<diploms year="1990" title="bachelor"/>
</Author>
<Author name="Kenzi" surname="Adil">
<diploms year="1999" title="PHD"/>
</Author>
</xmi:XMI>

the metamodel for Person:
the file Person.km3 is :

package Person {

class Person {
attribute name : String;
attribute lastname: String;
reference qualifications [*] : Qualification oppositeOf
owner;
}
class Qualification {
attribute qualif: String;
reference owner : Person oppositeOf qualifications;
}
}

package PrimitivesTypes {
datatype String;
}



The Program ATL that I created. I just added the Rule
diploma2Qualification to the ATL program defined for Author2Person


module Author2Person; -- Module Template
create OUT : Person from IN : Author;
rule Autho2person {

from a: Author!Author
to
p: Person!Person (
name <- a.name,
lastname<-a.surname
)
}
rule diploma2Qualification {
from diplom :Author!Diploma
to
Q : Person!Qualification(
qualif<-diplom.title
)
}


After running this atl program, I have as a result the follow model :

<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns="Person">
<Person name="Kenzi" lastname="Adil"/>
<Person name="David" lastname="Touzet"/>
<Person name="Freddy" lastname="Allilaire"/>
</xmi:XMI>


As we can see the second rules defined in the atl program is not executed.
The information about Qualification doesn’t exist in the result model.
The Question is How to identify the Problem? Is a model problem? Why the
second rule is not executed?
Best regards,
Adil
Re: [ATL] Problem with ATL rules [message #79493 is a reply to message #79480] Thu, 17 April 2008 17:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: adilanwar10.yahoo.fr

Hi adil,
I think that the problem comes on the second rule called
'diploma2Qualification '
you can try with this:
rule diploma2Qualification {
from diplom :Author!Diploma
to Q : Person!Qualification(
qualif<-diplom.title ,
owner <- diplom .owner
)
}
Regards
Adil anwar

"Adil" <a.kenzi@yahoo.fr> a
Re: [ATL] Problem with ATL rules [message #79580 is a reply to message #79493] Fri, 18 April 2008 15:06 Go to previous message
Eclipse UserFriend
Originally posted by: a.kenzi.yahoo.fr

Dear Adil,
Thank you very much for your feedback. I modified the second rule as you
suggested( I added the owner <-diplom.owner to the second rule ), however
the probelem can't be resolved. I can't run the second rule.
best regards,
Previous Topic:[QVTO] transforming profile-based models
Next Topic:[ATL][newbie] Some problem in UML2 to UML2 transformation
Goto Forum:
  


Current Time: Thu Apr 25 00:34:07 GMT 2024

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

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

Back to the top