Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sapphire » Recursive Node Factory
Recursive Node Factory [message #1023804] Mon, 25 March 2013 03:49 Go to next message
Hazem ELRAFFIEE is currently offline Hazem ELRAFFIEE
Messages: 59
Registered: September 2012
Member
Hello Again Smile Smile

I visited this topic before posting mine. But it didn't help me at my situation.

I have a tag called "subcomponent" like:
<subcomponent name="p1" version="1.0"></subcomponent>

the thing is, a "subcomponent" can have children "subcomponent" tags. Infinite number of levels, and infinite number of children for each.
<subcomponent name="p1" version="1.0">
    <subcomponent name="c1" version="2.0"></subcomponent>
    <subcomponent name="c2" version="1.3">
        <subcomponent name="g1" version="2.0"></subcomponent>
        <subcomponent name="g2" version="1.2"></subcomponent>
    </subcomponent>
</subcomponent>


For the model, it's very straight forward, but how can I do it in the SDEF? any ideas?
Re: Recursive Node Factory [message #1024038 is a reply to message #1023804] Mon, 25 March 2013 13:36 Go to previous message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 935
Registered: July 2009
Senior Member
You need to define a node factory at the top level of sdef with an id that self-references. Something like this:

<definition>
    <node-factory>
        <id>MyNodeFactory</id>
        <property>SomeListProperty</property>
        <case>
            <model-element-type>SomeType</model-element-type>
            <node-include>MyNodeFactory</node-include>
        </case>
    </node-factory>
</definition>
Previous Topic:How to enable/disable Action Button
Next Topic:ReferenceValue target object property in EL
Goto Forum:
  


Current Time: Wed Jul 23 03:55:22 EDT 2014

Powered by FUDForum. Page generated in 0.08991 seconds