How do I add a move node (child) to an IfNode? (when creating a Template from Java)

I create a Template in my URcap to simplify for the user.

In this template I want to use an IfNode. Creating the IfNode is no problem, however I cannot find information in the 1.8.0 Api on
how to add a node in the If.

image

Thank you all in advance!
-Benny

I found the solution myself,

Instead of adding the IfNode directly to the root tree I create an TreeNode ifNodeTreeNode and then add the ifNode as a child.
After that it is possible to add children to the IfNode, below is some of my test code.

root_ = programModel_.getRootTreeNode(programNode_.get());
TreeNode ifNodeTreeNode = root_ .addChild(createIfNode(“digital_in[0]”,“true”));
FolderNode testFolderNode = programNodeFactory_.createFolderNode();
String folderNametest = “TestFolder”;
testFolderNode.setName(folderNametest);
ifNodeTreeNode.addChild(testFolderNode);

image

/Benny

1 Like