Forum Discussion
scorpionawal
14 years agoOccasional Contributor
deepesh.jain wrote: Hi Amit,
What you can do is get the xml in xml holder and check for the count of the tag in question. In case the count is 0, you can set desired property as 0. Here is how:def groovyUtils1 = new GroovyUtils (context) ;
def holder = groovyUtils1.getXmlHolder("<Step_Name>#Response") ;
def tagCount = holder["count(//Results[1]/ResultSet[1]/Row[FROM="66850117700" and TO="66860111111"]/number(SUM))"];
if (tagCount == 0)
{
//set desired property as 0
}
Let me know if this helps.
Regards,
Deeepsh Jain
Hi Deepak,
I tried the first method also. But I get an error message
startup failed: Script8.groovy: 1: unable to resolve class GroovyUtils @ line 1, column 20. def groovyUtils1 = new GroovyUtils (context) ; ^
org.codehaus.groovy.syntax.SyntaxException: unable to resolve class GroovyUtils @ line 1, column 20.
at org.codehaus.groovy.ast.ClassCodeVisitorSupport.addError(ClassCodeVisitorSupport.java:148) at
------------
------------
What am I missing.?
Regards
Amit