Skip navigation
Currently Being Moderated

Search for tasks that belong to running process instances

Jan 26, 2011 10:26 PM

Hi, I am trying to search for tasks that belong to running process instance by using the follwoing code:

 

     ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);
     TaskManagerQueryService queryManager = TaskManagerClientFactory.getQueryManager(myFactory);

     TaskSearchFilter filter = new TaskSearchFilter();
     filter.setServiceName(serviceName);
     filter.addCondition(TaskSearchingConstants.pPROCESS_INSTANCE_STATUS, Operator.EQUALS, JobStatus.JOB_STATUS_RUNNING);

     filter.setAdminIgnoreAllAcls(true);

     List<TaskRow> result = queryManager.taskSearch(filter);

 

It returns no results while I search it via adminui I found a few running process instance. I tried to comment out the line addCondition, then it returns all tasks, and I found that when I retrieve the taskinfo by taskinfo.getProcessInstanceStatus(), it return -1 for all tasks.

 

My question is how can I set the condition to search the tasks belong to running process instance? Thanks.

 
Replies
  • Currently Being Moderated
    Feb 7, 2011 5:43 AM   in reply to hkho

    I have been away on vacation ......do you get an answer for this query?

     

    Paul

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 17, 2012 3:19 AM   in reply to hkho

    You have to use:

     

    filter.addCondition(TaskSearchingConstants.pPROCESS_INSTANCE_STATUS, Operator.EQUALS, ProcessInstanceRow.STATUS_RUNNING);

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points