Skip to main content



      Home
Home » Archived » Eclipse Process Manager (Stardust) » findUsers - Webservice API (findUsers - needs only the valid users)
findUsers - Webservice API [message #1149875] Tue, 22 October 2013 07:20 Go to next message
Eclipse UserFriend
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 03:48 Go to previous messageGo to next message
Eclipse UserFriend
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 03:49] by Moderator

Re: findUsers - Webservice API [message #1216396 is a reply to message #1158957] Thu, 28 November 2013 08:02 Go to previous message
Eclipse UserFriend
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: Fri May 16 05:35:48 EDT 2025

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

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

Back to the top