Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Process Manager (Stardust) » findUsers - Webservice API (findUsers - needs only the valid users)
findUsers - Webservice API [message #1149875] Tue, 22 October 2013 11:20 Go to next message
VENKATESH CHIDAMBARANATHAN is currently offline VENKATESH CHIDAMBARANATHANFriend
Messages: 10
Registered: September 2013
Junior Member
Hi,
In the findUsers webservice API i need to fetch all the valid users only.
What is the input query we can give for fetching only valid users.
can you provide the sample UserQueryXto input.


Thanks
Venkatesh C
Re: findUsers - Webservice API [message #1158957 is a reply to message #1149875] Mon, 28 October 2013 07:48 Go to previous messageGo to next message
Vikash Pandey is currently offline Vikash PandeyFriend
Messages: 12
Registered: October 2011
Junior Member
Venkatesh,
Following code snippet can be used to find only valid users:


private static UsersXto findValidUsers() throws BpmFault
{
LOGGER.info("-- Finding Valid Users --");
final UserQueryXto user = new UserQueryXto();
UserQueryResultXto userQueryResultXto = QUERY_SERVICE.findUsers(user);
UsersXto usersXto_ret = new UsersXto();
UsersXto usersXto = userQueryResultXto.getUsers();

List<UserXto> userXto = usersXto.getUser();
Iterator<UserXto> iterator = userXto.iterator();
while(iterator.hasNext()){
UserXto userXto2 = iterator.next();

if(userXto2.getValidTo() !=null && userXto2.getValidTo().getTime() < System.currentTimeMillis()){
iterator.remove();

System.out.println("Invalid User - " + userXto2.getFirstName());
}

}

return usersXto;
}

Assuming you have queryService with you in your code.

At the calling method end, you can traverse the returned UsersXto object like below and fetch the required properties of the valid users:

UsersXto usersXto = findValidUsers();
List<UserXto> userXto = usersXto.getUser();
for (UserXto userXto2 : userXto) {
System.out.println(userXto2.getFirstName());
}

[Updated on: Mon, 28 October 2013 07:49]

Report message to a moderator

Re: findUsers - Webservice API [message #1216396 is a reply to message #1158957] Thu, 28 November 2013 13:02 Go to previous message
VENKATESH CHIDAMBARANATHAN is currently offline VENKATESH CHIDAMBARANATHANFriend
Messages: 10
Registered: September 2013
Junior Member
Hi Vikash Pandey,
Thanks for the reply. Is there any other inbuilt option to filter the same?
Previous Topic:Web project doesn't run on Eclipse's Tomcat
Next Topic:Unable to deploy stardust in Jboss 5.1
Goto Forum:
  


Current Time: Mon Nov 24 18:18:51 GMT 2014

Powered by FUDForum. Page generated in 0.01720 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software