Service Desk Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

How to use API to find CIs based on a view?

Highlighted
Alan_7
Collector

How to use API to find CIs based on a view?

Basically, I need to find some CIs, which is availabe in an exisiting view. From the Javadoc, I found this:

findConfigurationItem(com.hp.ov.obs.OID view)
Find a set of ConfigurationItem objects, using the criteria of a view.

However, I use this:
OID viewOid=null;
viewOid = OID.parse("00000000-0000-0000-027d-941caca74216");
ciHome1.findConfigurationItem(viewOid);

I got error:
java.lang.NullPointerException
at com.hp.ov.obs.impl.wf.AppEntityHome.filterViewableTypes(AppEntityHome.java:800)
at com.hp.ov.obs.impl.wf.AppEntityHome.find(AppEntityHome.java:754)
at com.hp.ov.obs.impl.wf.AppEntityHome.find(AppEntityHome.java:690)

Anyone can help?

Consultant
//Add this to "OnDomLoad" event