[jboss-user] [jBPM] - Re: How to list human tasks with HQ API?

Alex Wulms do-not-reply at jboss.com
Tue Jul 31 03:32:16 EDT 2012

Alex Wulms [https://community.jboss.org/people/awulms_work] created the discussion

"Re: How to list human tasks with HQ API?"

To view the discussion, visit: https://community.jboss.org/message/751122#751122


I have found a solution. Apparently I must specify a human task client (session) id to the constructor of the AsyncHronetQTaskClient class. It works fine with following code:
 public static void main(String args[])
  String user="krisv";
  String language="en-UK";
  List<Status> status = Arrays.asList(new Status[] { Status.Reserved });
  String clientSessionID = UUID.randomUUID().toString();
  System.out.println("*** Connecting to human task service with HornetQ protocol, using client session ID: " + clientSessionID);
  SyncTaskServiceWrapper tk = new SyncTaskServiceWrapper(new AsyncHornetQTaskClient(clientSessionID));
  tk.connect("", 5445);
  System.out.println("*** Getting " + status + " tasks for " + user + " with language " + language);
  List<TaskSummary> tasks = tk.getTasksAssignedAsPotentialOwnerByStatus(user, status, language);
  System.out.println("*** Got " + tasks.size() + " tasks");
  System.out.println("*** Closing connection");
  try {
  } catch (Exception e) {
   System.out.println("*** Error during disconnect: " + e.getMessage());

Thanks and kind regards,

PS: I found the solution thanks to the jbpm-examples module, in which the human task example also specifies a (hard-coded) client-session-id to the constructor.


Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120731/f8b95c9c/attachment.html 

More information about the jboss-user mailing list