Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » problem with rule
problem with rule [message #108563] Thu, 23 July 2009 02:34
debutante is currently offline debutanteFriend
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
Previous Topic:How to Visualize a generic XMI metamodel in some Class Diagrams?
Next Topic:[ATL] stack overflow from simple script
Goto Forum:
  


Current Time: Sat Apr 27 03:06:18 GMT 2024

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

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

Back to the top