Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

get string from XML


Level 2

I have the following in an execute script. It creates an XML quite nicely. However, I need it to retrieve the data for comparison versus creating an XML. Is there an easy way to convert what I have so this can be accomplished? I need to compare the commonName to a string value that will be static, and store the userId that corresponds to it as a string. 

DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();
DocumentBuilder bd = fact.newDocumentBuilder();
Document doc = bd.newDocument();
Element root = (Element) doc.createElement("users");

if(userlist != null)
Iterator iterator = userlist.iterator();
while ( iterator.hasNext() )
  User eachUser = (User);

  Element UserNode = doc.createElement("user");

  Element ValueNode = doc.createElement("userID");

  Element ValueNode = doc.createElement("commonName");

patExecContext.setProcessDataValue("/process_data/uXML", (Object)doc)

2 Replies


Level 10

I am not sure I follow.

The Execute Script service instance, above, creates the process variable "uXML" of type Object. Is the intent to iterate over "commonName" in "uXML" in a subsequent operation to determine the existence of the content of a second process variable containing the name?



Level 2

I found my solution. To get the value in the node it's eachUser.userId.toString().