Tuesday, 17 February 2015

How to read multiple attributes using xpath and based on that trigger the jenkins job



I am having an xml file(executeRM.xml) with contents as mentioned below.



<r1> <n1 name="component1" version="14.0" state="ToBeInstalled"/> <n2 name="Component2" version="13.0" state="Installed"/> <n3 name="Component3" version="12.0" state="TobeInstalled"></r1>


I have used "FS trigger-Monitor files" and is an every one minute schedule, where I have given the full path of the above xml file. Now I want to write an xpath query, which will trigger the job only when state will be "ToBeInstalled" for any of the 3 components or all. I have written the below xpath query, but the job itself is not getting triggered.



/r1/n1[@name='Component1' and @state='ToBeInstalled'] /r1/n2[@name='Component2' and @state='ToBeInstalled'] /r1/n3[@name='Component3' and @state='ToBeInstalled']

No comments:

Post a Comment