Can you please let me know how to get the child node which is defined as a Component in my model structure. I could able to get the top node of the Model structure, but facing difficulty in getting the Component node. This CX i am launching it from front end.
I tried with the below, but no luck.
IRuntimeNode compo = rootNode.getChildByID(modelId);
and also with
IRuntimeNode compo = rootNode.getChildByPersistentID(15420);
public void displayAttributes(IRuntimeNode irn)
Configuration config = irn.getConfiguration();
rootNode = config.getRootComponent(); etc...
CNX1000 (Model Root node - BOM Nodes)
SLSCNX1000 (Node which is defined as component)
+Sales Option class1
+Sales Option class2
I want to get 'SLSCNX1000' node and loop through. I could able to get CNX1000 the BOM root node.
Thanks in advance,
Edited by: Vijay Nimmakuri on Jan 5, 2013 1:54 AM
It is generally not advisable to get children by IDs. Doing so requires determination of information that is not known without querying the CZ schema, and that is rarely necessary, as you typically at least know the name of the node to which you're trying to navigate. You can use the following to get the Component:
IRuntimeNode compo = rootNode.getChildByName("SLSCNX1000");
I don't know exactly what you mean by "loop through"; I assume you intend to iterate through that Component's "Sales Options", which I take to be Option Features. To get a List of all of the Component's Option Features, you'd use:
Hope this helps.
Thanks it helped me i implemented it this way.
IRuntimeNode compo = irn.getChildByName(componentname);
List czItemNode =compo.getChildrenByType(IRuntimeNode.OPTION_FEATURE);
ListIterator Oclist = czItemNode.listIterator();
IRuntimeNode nodeTemp = (IRuntimeNode) Oclist.next();
// Added for gettings tokens
String country = getModelOptions(irn);
InformationalMessage iMsg3 = new InformationalMessage((new StringBuilder("getCountrySelected---->")).append(country).toString(), irn);
StringTokenizer st = new StringTokenizer(country, ".");
Thanks a Lot :)