Is the following code the correct way to retrieve the taskinstances for the 
specific tasknode name and task name?
 

  |     private java.util.List getTaskInstance(String tasknodename, String 
taskname) throws Exception {
  |             log.debug("getTaskInstance() is called");
  |             log.debug("" + ctx.getCallerPrincipal().getName());
  |             JbpmConfiguration config = null;
  |             JbpmContext jbpmContext = null;
  |             java.util.List list = null;
  |             java.util.List list2 = new ArrayList();
  |             try {
  |                     InitialContext ic = new InitialContext();
  |                     config = (JbpmConfiguration) ic
  |                                     .lookup("java:/jbpm/JbpmConfiguration");
  |                     jbpmContext = config.createJbpmContext();
  |                     list = 
jbpmContext.getTaskMgmtSession().findPooledTaskInstances(ctx.getCallerPrincipal().getName());
  |                     for(Iterator iter=list.iterator();iter.hasNext();){
  |                             TaskInstance taskinstance =(TaskInstance) 
iter.next();
  |                             Task task =  taskinstance.getTask();
  |                             if(task.getName()!=null 
&&task.getName().equals(taskname) && 
task.getTaskNode().getName().equals(tasknodename)){
  |                                     list2.add(taskinstance);
  |                             }
  |                     }
  |                     log.debug("return task instance set size 
="+list2.size());
  |             } finally {
  |                     if (jbpmContext != null)
  |                             jbpmContext.close();
  |             }
  |             return list2;
  |     }
  | 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964829#3964829

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964829
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to