}
return tempInst;
*/ }
ProcessTransactionContext ptc = getProcessTransactionContext();
if (options != null && options.containsKey("ptc")) {
ptc = (ProcessTransactionContext)options.get("ptc");
}
if(ptc==null)
throw new UEngineException("TransactionContext should be provided.");
setProcessTransactionContext(ptc);
if(isCaching()){
ProcessInstance instance = ptc.getProcessInstanceInTransaction(instanceId);
if(instance!=null)
return instance;
}
try{
addDebugInfo("EJBProcessInstance: instanceId is set by " + instanceId);
setInstanceId(instanceId);
boolean isArchive = getProcessInstanceDAO().getIsArchive();
if(GlobalContext.logLevelIsDebug){
addDebugInfo("Definition administration url",GlobalContext.WEB_CONTEXT_ROOT + "/processmanager/viewProcessFlowChart.jsp?processDefinition=" + getProcessInstanceDAO().getDefId() + "&processDefinitionVersionID=" + getProcessInstanceDAO().getDefVerId());
addDebugInfo("Process Designer launch url",GlobalContext.WEB_CONTEXT_ROOT + "/processmanager/ProcessDesigner.jnlp?defVerId=" + getProcessInstanceDAO().getDefVerId() + "&defId=" + getProcessInstanceDAO().getDefId());
addDebugInfo("Instance administration url", GlobalContext.WEB_CONTEXT_ROOT + "/processmanager/viewProcessInformation.jsp?instanceId=" + getInstanceId());
}
//if the instance is archived, the instance would be loaded from a serialized XML file.
if(isArchive){
return FileProcessArchive.load(instanceId, ptc);
}
// ProcessInstance inst = create();
// inst.setInstanceId(instanceId);
//
// return inst;
getProcessTransactionContext().addTransactionListener(this);
ptc.registerProcessInstance(this);
//if the instance has been retreived by instanceId, it tells us it is not newly initiated status.
isNew = false;
return this;