ExclusiveGroupInstance exclusiveGroupInstance = new ExclusiveGroupInstance();
((org.jbpm.process.instance.ProcessInstance) processInstance).addContextInstance(ExclusiveGroup.EXCLUSIVE_GROUP, exclusiveGroupInstance);
int nodeInstances = stream.readInt();
for (int j = 0; j < nodeInstances; j++) {
long nodeInstanceId = stream.readLong();
NodeInstance groupNodeInstance = processInstance.getNodeInstance(nodeInstanceId);
if (groupNodeInstance == null) {
throw new IllegalArgumentException("Could not find node instance when deserializing exclusive group instance: " + nodeInstanceId);
}
exclusiveGroupInstance.addNodeInstance(groupNodeInstance);
}