(org.jbpm.process.instance.ProcessInstance) processInstances.get(id);
if (processInstance != null) {
return processInstance;
}
ProcessInstanceInfo processInstanceInfo = GrailsIntegration
.getGormDomainService().getProcessInstanceInfo(id, this.kruntime.getEnvironment());
if ( processInstanceInfo == null ) {
return null;
}
processInstanceInfo.updateLastReadDate();
processInstance =
processInstanceInfo.getProcessInstance(kruntime, this.kruntime.getEnvironment());
Process process = kruntime.getKnowledgeBase().getProcess( processInstance.getProcessId() );
if ( process == null ) {
throw new IllegalArgumentException( "Could not find process " + processInstance.getProcessId() );
}
processInstance.setProcess( process );