return new ArrayList<String>(engine.getTaskService().getOutcomes(internalId));
}
public boolean updateSubprocess(final ProcessInstance parentPi, String executionId, ProcessToolContext ctx) {
ProcessEngine engine = getProcessEngine(ctx);
ExecutionService executionService = engine.getExecutionService();
Execution jbpmPi = executionService.findExecutionById(executionId);
if(jbpmPi != null){
Execution subprocess = jbpmPi.getSubProcessInstance();
if(subprocess != null){
ctx.getHibernateSession().refresh(subprocess);
if (ctx.getProcessInstanceDAO().getProcessInstanceByInternalId(subprocess.getId()) == null)
{
String processDefinitionId = subprocess.getProcessDefinitionId().replaceFirst("-\\d+$", "");
ProcessDefinitionConfig config = ctx.getProcessDefinitionDAO().getActiveConfigurationByKey(
processDefinitionId);
/* Create new instance of parent process' subprocess */
ProcessInstance subProcessInstance = createSubprocessInstance(config, ctx, parentPi, "parent_process", subprocess.getId());
long subPiId = ctx.getProcessInstanceDAO().saveProcessInstance(subProcessInstance);
executionService.createVariable(subprocess.getId(), "processInstanceId", String.valueOf(subPiId),
false);
return true;
}
}