[ATL] remove elements [message #758770] |
Thu, 24 November 2011 14:07 |
Fy Za Messages: 245 Registered: March 2010 |
Senior Member |
|
|
Hi All,
I have a problem with this simple transformation
that generate the result and also inappropriate elements (adresses of persons that person.age > 26)
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
)
}
rule Home2Adress{){
from
home : PersonMM!Home
to
adress : StudentMM!Adress(
adress <- home.adress
)
}
So plz, How remove these elements from my output model
I want to express : remove Adresses of persons which are not transformed to Student
Thanks
[Updated on: Thu, 24 November 2011 14:27] Report message to a moderator
|
|
|
|
Re: [ATL] remove elements [message #758796 is a reply to message #758786] |
Thu, 24 November 2011 15:22 |
Fy Za Messages: 245 Registered: March 2010 |
Senior Member |
|
|
Thank you Sylvain,
it works with a simple modification :
helper context PersonMM!Home def : filter : Boolean =
PersonMM!Person.allInstances()->select(e | e.filter)->exists(e |e.has_adress->includes(self));
because has_adress is an 1..* reference
[Updated on: Thu, 24 November 2011 15:23] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03104 seconds