05-10-2017 02:44 AM - edited 03-01-2019 03:50 AM
I want to pick up ID from another service model java code.
In this case , I want to some data calculate from "tenant-id" under 'AIO001' data.
But my code does not work for test2 for loop. i can not pick up "tenant-id" under each Aio-id.
I can see testlist1 printout only in my debug log.
Please any comments or advises.
ID service model inputs are below;
/services/aioid:aioid[Aio-id='AIO001']/site-id[site-id='S001']/tunnel-id 1
/services/aioid:aioid[Aio-id='AIO001']/site-id[site-id='S002']/tunnel-id 2
/services/aioid:aioid[Aio-id='AIO002']/vCPE-id 2
/services/aioid:aioid[Aio-id='AIO002']/site-id[site-id='S003']/tunnel-id 3
Java Code;
NavuList AioId = ncsRoot.container("services").list("aioid","aioid");
NavuList testlist1 = AioId.elem(tenantID.valueAsString()).list("site-id");
System.out.println(testlist1); <— work
for (NavuContainer test2: testlist1.elements()){
System.out.println(test2.leaf("tunnel-id").valueAsString()); <— does not work
}
My debug output is below;
NavuList[NavuNodeInfo[site-id,7,2],/ncs:services/aioid:aioid{AIO001}/site-id]
Solved! Go to Solution.
05-10-2017 02:44 AM
You should use NavuList.children(), i.e. "for (NavuContainer test2: testlist1.children()){"
05-10-2017 02:44 AM
You should use NavuList.children(), i.e. "for (NavuContainer test2: testlist1.children()){"
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide