public static void readActionQueue(MarshallerReaderContext context, RuleData _session) throws IOException, ClassNotFoundException { ReteooWorkingMemory wm = (ReteooWorkingMemory) context.wm; Queue<WorkingMemoryAction> actionQueue = wm.getActionQueue(); for ( ProtobufMessages.ActionQueue.Action _action : _session.getActionQueue().getActionList() ) { actionQueue.offer( PersisterHelper.deserializeWorkingMemoryAction( context, _action ) ); } }
private static void readInitialFactHandle(MarshallerReaderContext context, RuleData _session ) { int ifhId = context.wm.getInitialFactHandle().getId(); context.handles.put( ifhId, context.wm.getInitialFactHandle() ); // special case we have to handle for the initial fact boolean initialFactPropagated = true; for ( ProtobufMessages.ActionQueue.Action _action : _session.getActionQueue().getActionList() ) { if( _action.getType() == ProtobufMessages.ActionQueue.ActionType.ASSERT ) { if( _action.getAssert().getHandleId() == ifhId ) { initialFactPropagated = false; break; } } } if( initialFactPropagated ) { assertHandleIntoOTN( context, context.wm, context.wm.getInitialFactHandle() ); } }