How two generate root node an children inside also as root node

Hi all,

in my model i have my root concept called Window, and inside the Window are two Forms. Now the question is: how can i generate 3 Java files out of that ...

Window myWindow:
  Form: myForm1
  Form: myForm2

and i need:
myForm1.java
myForm2.java
myWindow.java (which containes a reference to myForm1 and myForm2, e.g. two instances)


I can not use abandon root node in generator, because i need the root node too...

So what i need is kind of a ReferenceMacro at the place, where the Forms were in the inputModel. But how do i get myForm1.java myForm2.java generated?

Any ideas?
Dan
3 comments
I m not sure,

but i think i found the solution myself. It s quite simple. Just write two root mapping rules.... and reference them where needed?

root mapping rules are kind of independent from reduction rules ..

Dan
0
Hello Dan,
I've got a similar problem. Could you please tell me how you have referenced root mapping rules? They do not have a name, so I can't imagine how you get this work.
Thanks
0
Hi Fabma,

ok, the root mapping rules do not have a name - they will be executed automatically when you run the gen and the input node suits.

but you can add reduction rules for same nodes - so you can reference you generated stuff from within a reduction rule.

in my case: the root mapping rule creates the myForm1.java

and the reduction rule creates a: new myForm1() Expression

dan
0

Please sign in to leave a comment.