cancel
Showing results for 
Search instead for 
Did you mean: 

Get called activities

nik10_mah
Champ in-the-making
Champ in-the-making
Hi ,

Is there a way to get the linked process instances that have been started via callActiviti element.

I found runtimeService.getActiveActivityIds(task.getExecutionId());

but it only returns the activiti of current execution.
But i want all the active and linked process instances. For example, a process intance PI-1 generates three more process instances through callActiviti tag namely CA-1,CA-2 and CA-3. So is there a way to that get all the three instance CA-1, CA-2 and CA-3 using PI-1 or vice versa
1 REPLY 1

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

good example could be (activiti jUnit test):


  @Deployment(resources = {"org/activiti/engine/test/api/runtime/superProcess.bpmn20.xml",
                           "org/activiti/engine/test/api/runtime/subProcess.bpmn20.xml"})
  public void testQueryBySuperProcessInstanceId() {
    ProcessInstance superProcessInstance = runtimeService.startProcessInstanceByKey("subProcessQueryTest");
   
    ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery().superProcessInstanceId(superProcessInstance.getId());
    ProcessInstance subProcessInstance = query.singleResult();
    assertNotNull(subProcessInstance);
    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
  }

Regards
Martin