//Search Work Item in Roaster
public static VWWorkObject getVWWorkObject(VWSession peSession,String rosterName){
VWWorkObject vwwObj=null;
try{
VWRoster roster=peSession.getRoster(rosterName);
int queryFlags=VWRoster.QUERY_NO_OPTIONS;
String abc = "abc";
String filter="Property_Name ="+abc;
//Change filter based on requirement
VWRosterQuery query=roster.createQuery(null, null, null, queryFlags, filter, null, VWFetchType.FETCH_TYPE_WORKOBJECT);
log.info("Total records for Work ITem: "+query.fetchCount());
while(query.hasNext()){
vwwObj=(VWWorkObject) query.next();
}
}catch(VWException vwe){
log.error("Exception found at PEManager.getVWWorkObject():"+vwe,vwe);
vwe.printStackTrace();
}catch(Exception vwe){
log.error("Exception found at PEManager.getVWWorkObject():"+vwe,vwe);
vwe.printStackTrace();
}
return vwwObj;
}
public static VWWorkObject getVWWorkObject(VWSession peSession,String rosterName){
VWWorkObject vwwObj=null;
try{
VWRoster roster=peSession.getRoster(rosterName);
int queryFlags=VWRoster.QUERY_NO_OPTIONS;
String abc = "abc";
String filter="Property_Name ="+abc;
//Change filter based on requirement
VWRosterQuery query=roster.createQuery(null, null, null, queryFlags, filter, null, VWFetchType.FETCH_TYPE_WORKOBJECT);
log.info("Total records for Work ITem: "+query.fetchCount());
while(query.hasNext()){
vwwObj=(VWWorkObject) query.next();
}
}catch(VWException vwe){
log.error("Exception found at PEManager.getVWWorkObject():"+vwe,vwe);
vwe.printStackTrace();
}catch(Exception vwe){
log.error("Exception found at PEManager.getVWWorkObject():"+vwe,vwe);
vwe.printStackTrace();
}
return vwwObj;
}
please mention sample filter...here...
ReplyDeleteI am getting error when I am filtering with Datafileds
Hi
Delete