New nodes using variable Follow
I have an abstract concept and few subconcepts that extend it. I created a node factory that creates one instance of each subconcept when new root node is created. Everything works when I specify subconcepts directly:
But when I want to create instances using a cycle through all subconcepts, add new() method is not accepting any parameter or expression. I expected the code to look like this, but this is not valid:
Thanks.
Tomas
Please sign in to leave a comment.
Expressions cannot be used as parameters to "add new". You'll have to use "add()" instead:
newNode.subObjects.add(it.new instance())
Vaclav, thanks very much, works nicely. Tomas