Thank you for your response. Yep, we tried that and it does work but we also need to target the direct path. We are traversing different JSON structures with deep arrays and objects and sometimes with a combination of both so we need to target the path directly without using the getChild or getSiblings. Are there any other ways to do it like the one in this documentation?
Original Message:
Sent: Mon April 03, 2023 02:17 PM
From: Gabriel Marte Blanco
Subject: Array value traversion/manipulation in Java Compute Node
Hi Nathaniel,
Here is a message from the team:
The XPath in incorrect. You are calling getFirstElementByPath. The correct path is "sampleArray/Item". Item[1] is an array index, not a path to an element name. The function getFirstElementByPath will always return the first instance of an array structure. Try changing to Item and see if that works.
Thank you,
------------------------------
Gabriel Marte Blanco
Austin TX
Original Message:
Sent: Mon April 03, 2023 07:56 AM
From: Nathaniel Santiago
Subject: Array value traversion/manipulation in Java Compute Node
Good Day,
I currently have a task, it is to traverse and/or manipulate an array or array value using a Java compute node. I have seen documentation regarding this, here is the link: Modifying a JSON message
The goal is like this (convert the index 1 to ABC)
and here is what I did (based on docs):

but it only ends with this error when we try to run it,
BIP4395E: Java exception: ''java.lang.NullPointerException''; thrown from class name: ''GetProfile_sample'', method name: ''evaluate'', file: ''GetProfile_sample.java'', line: '25'
I don't know if I'm missing something or the documentation just really doesn't work
------------------------------
Nathaniel Santiago
------------------------------