Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] trace model problem with source element
[ATL] trace model problem with source element [message #789088] Thu, 02 February 2012 15:34 Go to next message
Fy Za is currently offline Fy ZaFriend
Messages: 245
Registered: March 2010
Senior Member
Hi All
I Have this simple transformation
rule Person2Student{
from 
	person : PersonMM!Person(person.age < 26)
to
	student : StudentMM!Student(
		name <- person.name --attribute
                has_adress <-person.has_adress -- reference  Person ----- 1..* : has_adress ----> Home 
        )
}

}

I try to add anothor target that is the trace of my transformation
So, my transformation will be
rule Person2Student{
from 
	person : PersonMM!Person(person.age < 26)
to
	student : StudentMM!Student(
		name <- person.name --attribute
                has_adress <-person.has_adress -- reference  Person ----- 1..* : has_adress ----> Home 
        )
        person2Student : TraceMM!Person2Student
           (per <- person,
            std <- student
           )
}

}

the problem that I have the same cross reference in the trace instance between person and student
and that is the student cross reference.
for example,

<?xml version="1.0" encoding="ISO-8859-1"?>
<trace:Trace xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"......
  <pr2st>
    <per href="My.student#//@students.0"/>
    <std href="My.student#//@students.0"/>
  </pr2st>

So, How Can I reference to a source element in my trace model

Thanks
Re: [ATL] trace model problem with source element [message #789693 is a reply to message #789088] Fri, 03 February 2012 09:29 Go to previous message
Fy Za is currently offline Fy ZaFriend
Messages: 245
Registered: March 2010
Senior Member
Resolved Problem !!!!!!! Smile
with this block in my transformation
rule Person2Student{
from 
	person : PersonMM!Person(person.age < 26)
to
	student : StudentMM!Student(
		name <- person.name --attribute
                has_adress <-person.has_adress -- reference  Person ----- 1..* : has_adress ----> Home 
        )
        person2Student : TraceMM!Person2Student
           (
            -- per <- person,
            std <- student
           )
}
do
{
   person2Student.refSetValue('per',person);
}
}

try to see this presentation

www.sintef.no/uploadpages/10558/LCT4A-1.pdf
Previous Topic:[ATL] Logging to file
Next Topic:[QVTo] composing transformations
Goto Forum:
  


Current Time: Fri Apr 19 00:58:18 GMT 2024

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

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

Back to the top