this.env = env;
if (processInstance == null) {
try {
ByteArrayInputStream bais =
new ByteArrayInputStream(processInstanceByteArray);
MarshallerReaderContext context = new MarshallerReaderContext(
bais, (InternalRuleBase) workingMemory.getRuleBase(),
null, null);
context.wm = (InternalWorkingMemory) workingMemory;
ProcessInstanceMarshaller marshaller = getMarshallerFromContext(context);
processInstance = marshaller.readProcessInstance(context, !externalVariables);
if (externalVariables) {
restoreVariables();
}
context.close();
} catch (IOException e) {
e.printStackTrace();
throw new IllegalArgumentException(
"IOException while loading process instance: " + e.getMessage(), e);
}