Problem with references and lazy rules [message #520459] |
Fri, 12 March 2010 13:34 |
katja Messages: 18 Registered: March 2010 |
Junior Member |
|
|
Hi!
I need to write some transformations rules with ATL for one project in my university, and I have the problem at the moment which I can't solve. Could anyone help me?
Description of the problem:
I write the following rules:
rule lane2model {
from
cLane : xx!BLane
using {
xmiID : String = cLane.__xmiID__;
}
to
model : soaml!Model(
__xmiID__ <- xmiID,
packagedElement <- cLane.dataElements -> select(a | a.oclType() = xx!DataObject) -> collect (b | thisModule.DataObject2ClassObject(b)),
packagedElement <- cLane.dataElements -> select(a | a.oclType() = xx!Relationship) -> select(c | c.isAss())-> collect (b | thisModule.relationship2assoc(b))
--isAss() is a helper which works without problems
)
}
lazy rule DataObject2ClassObject {
from
artif : xx!DataObject
using {
xmiID : String = artif.__xmiID__;
}
to
ClassObject : soaml!Class(
name <- artif.dname,
__xmiID__ <- xmiID,
visibility <- artif.visibility,
generalization <- artif.getGen() -> collect(a | thisModule.relationship2gen(a))
--getGen() is a helper which works without problems
)
}
lazy rule relationship2gen {
from
gen : xx!Relationship
using {
xmiID : String = gen.__xmiID__;
}
to
sgener : soaml!Generalization(
__xmiID__ <- xmiID,
general <- gen.relationsTarget
--gen.relationsTarget has type xx!DataObject
--general has type soaml!Class
)
}
The problem is that the attribute "general" in the last rule should contain the reference to transformed by rule "ClassObject" gen.relationsTarget, what doesn't happen.
If I do it with rule(without "lazy"), it works, but I need that it works also with lazy rule. Is there a possibility to solve the problem and get the references with using lazy rules?
Thank you in advance,
Katja
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03956 seconds