JBoss Community

Get subprocess id from outside the process

reply from Michael Wohlfart in jBPM - View the full discussion

I tried to reproduce this issue so I added a testcase to

org.jbpm.examples.subprocess.outcomeactivity.SubProcessOutcomeActivityTest

 

but the following testcase passed for me:

public void testSubProcessIdQuery() {
        ProcessInstance processInstance = executionService.startProcessInstanceByKey("SubProcessDocument");
        final Execution execution = processInstance.findActiveExecutionIn("review");
        assertNotNull(execution);
        assertNotNull(processEngine);
        String pid = ((ExecutionImpl) execution).getSubProcessInstance().getId();
        assertNotNull(pid);
        List<Task> taskList = taskService.findPersonalTasks("johndoe");
        Task task = taskList.get(0);
        taskService.completeTask(task.getId(), "reject");
}

 

so maybe if you post your testcase someone is able to shed some light on this

Reply to this message by going to Community

Start a new discussion in jBPM at Community