}
public static void readTruthMaintenanceSystem(MarshallerReaderContext context) throws IOException {
ObjectInputStream stream = context.stream;
TruthMaintenanceSystem tms = context.wm.getTruthMaintenanceSystem();
while ( stream.readShort() == PersisterEnums.EQUALITY_KEY ) {
int status = stream.readInt();
int factHandleId = stream.readInt();
InternalFactHandle handle = (InternalFactHandle) context.handles.get( factHandleId );
// ObjectTypeConf state is not marshalled, so it needs to be re-determined
ObjectTypeConf typeConf = context.wm.getObjectTypeConfigurationRegistry().getObjectTypeConf( context.wm.getEntryPoint(), handle.getObject() );
if ( !typeConf.isTMSEnabled() ) {
typeConf.enableTMS();
}
EqualityKey key = new EqualityKey( handle,
status );
handle.setEqualityKey( key );
while ( stream.readShort() == PersisterEnums.FACT_HANDLE ) {
factHandleId = stream.readInt();
handle = (InternalFactHandle) context.handles.get( factHandleId );
key.addFactHandle( handle );
handle.setEqualityKey( key );
}
tms.put( key );
}
}