long nodeInstanceCounter = stream.readLong();
processInstance.setWorkingMemory(wm);
int nbVariables = stream.readInt();
if (nbVariables > 0) {
Context variableScope = process
.getDefaultContext(VariableScope.VARIABLE_SCOPE);
VariableScopeInstance variableScopeInstance = (VariableScopeInstance)
processInstance.getContextInstance(variableScope);
for (int i = 0; i < nbVariables; i++) {
String name = stream.readUTF();
try {
Object value = stream.readObject();
variableScopeInstance.setVariable(name, value);
} catch (ClassNotFoundException e) {
throw new IllegalArgumentException(
"Could not reload variable " + name);
}
}
}
int nbSwimlanes = stream.readInt();
if (nbSwimlanes > 0) {
Context swimlaneContext = process.getDefaultContext(SwimlaneContext.SWIMLANE_SCOPE);
SwimlaneContextInstance swimlaneContextInstance = (SwimlaneContextInstance)
processInstance.getContextInstance(swimlaneContext);
for (int i = 0; i < nbSwimlanes; i++) {
String name = stream.readUTF();
String value = stream.readUTF();