Startprocess(pName) - HumanTaskInstance - inconsistency in Ids

1
0
-1

Hi there,

Bonita Studio 6.3.3, Java 1.7.0.67, Windows 8.1

I am starting processes in the background with

  1. for(3 iterations){
  2. ProcessInstance processInstance = processAPI.startProcess(processId);
  3. }

which gives me (for example name:processInstanceId pairing) p2:11; p2:12; p2:13 using

  1. processInstance.getName()+":"+processInstance.getId()

but when I go and do a search and display of the pending tasks of the process I get a different set of IDs for the pending processes. for example:

instead of p2:11; p2:12; p2:13 I get p2:23; p2:24; p2:25

Code is below...

My question is how do I get the same information for the pending task through HumanTaskInstance as that returned to me from the StartProcess

Many thanks in advance, regards Seán

  1. SearchOptionsBuilder searchOptionsBuilder = new SearchOptionsBuilder(0, 100);
  2. searchOptionsBuilder.filter(HumanTaskInstanceSearchDescriptor.NAME, processProcessId[0]);
  3. // searchOptionsBuilder.filter(HumanTaskInstanceSearchDescriptor.PROCESS_INSTANCE_ID, processProcessId[0]);
  4. SearchOptions searchOptions = searchOptionsBuilder.done();
  5.  
  6. SearchResult<HumanTaskInstance> searchHumanTaskInstances = processAPI.searchHumanTaskInstances(searchOptions);
  7. for (HumanTaskInstance pendingTask : searchHumanTaskInstances.getResult()) {
  8.  
  9. logger.severe(thisTrace+"processProcessId[0]: "+processProcessId[0]);
  10. logger.severe(thisTrace+"processProcessId[1]: "+processProcessId[1]);
  11. logger.severe(thisTrace+"pendingTask.getId(): "+pendingTask.getId());
  12. if (pendingTask.getId().equals(processProcessId[1])){
  13.  
  14. logger.severe(thisTrace+"A4-pt: "+pendingTask.getName()+" "+pendingTask.getId()+" "+pendingTask.getParentProcessInstanceId());
  15. if (pendingTask.getId()>activityId){
  16. activityId = pendingTask.getId();
  17. logger.severe(thisTrace+"process.split(:): "+processProcessId[0]+" "+processProcessId[1]+" "+activityId);
  18. }
  19. }
  20. }
No answers yet.
Notifications