problem with rule [message #108563] |
Thu, 23 July 2009 02:34 |
debutante Messages: 6 Registered: July 2009 |
Junior Member |
|
|
Good morning,
I have a problem in defining a rule.
source model : a content model
destination model: java model
i have to transform a "StructureElement" to a "java class". a
"StructureElement" can be a "chapiter" or a "section". if it's a
"chapiter", so it will includes "sections" and if it's a "section" it will
contains "compositeObject".
in my source model i have a "StructureElement" under this
"StructureElement", i have their "sections". in the java model, i want to
have like a tree that means under the "StructureElement" i want to have
their "sections".
i define these rules but i don't obtain the appropriate result.
rule SE2C {
from e : DSLC!StructureElement (e.include->size()<>0)
to out : javaMM!JAVAClass (
name <- e.name,
Fields<-if e.name='chapiter'
then DSLC!StructureElement.include->collect(c | thisModule.second(c) )
else
DSLC!StructureElement.MyLObject->collect(c | thisModule.LO2F(c) )
endif
)
}
unique lazy rule second {
from e : DSLC!StructureElement (e.include->size()=0)
to out : javaMM!JAVAClass (
name <- e.name
)
}
unique lazy rule LO2F{
from e : DSLC!LearningObject
to out : javaMM!Field (
name <- e.name
)
i prefer to send you the model to understand the problem.
thank you
|
|
|
Powered by
FUDForum. Page generated in 0.03030 seconds