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
Fi Fi is currently offline Fi FiFriend
Messages: 133
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
Fi Fi is currently offline Fi FiFriend
Messages: 133
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: Sun Dec 21 18:45:34 GMT 2014

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

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