public org.drools.marshalling.impl.ProtobufMessages.RuleData buildPartial() { org.drools.marshalling.impl.ProtobufMessages.RuleData result = new org.drools.marshalling.impl.ProtobufMessages.RuleData(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0;
public Builder mergeFrom(org.drools.marshalling.impl.ProtobufMessages.RuleData other) { if (other == org.drools.marshalling.impl.ProtobufMessages.RuleData.getDefaultInstance()) return this; if (other.hasLastId()) { setLastId(other.getLastId()); if (other.hasLastRecency()) { setLastRecency(other.getLastRecency()); if (other.hasInitialFact()) { mergeInitialFact(other.getInitialFact()); if (other.hasAgenda()) { mergeAgenda(other.getAgenda()); if (other.hasActionQueue()) { mergeActionQueue(other.getActionQueue()); if (other.hasTms()) { mergeTms(other.getTms()); this.mergeUnknownFields(other.getUnknownFields()); return this;
private static void readNodeMemories(MarshallerReaderContext context, RuleData _session) { for( ProtobufMessages.NodeMemory _node : _session.getNodeMemoryList() ) { Object memory = null; switch( _node.getNodeType() ) {
_session.getRuleData() ); for ( ProtobufMessages.EntryPoint _ep : _session.getRuleData().getEntryPointList() ) { WorkingMemoryEntryPoint wmep = context.wm.getEntryPoints().get( _ep.getEntryPointId() ); readFactHandles( context, if ( _session.getRuleData().hasInitialFact() ) { ((AbstractWorkingMemory)context.wm).initInitialFact(context.ruleBase, context); context.handles.put( session.getInitialFactHandle().getId(), session.getInitialFactHandle() );
ProtobufMessages.TruthMaintenanceSystem _tms = _session.getTms(); org.drools.marshalling.impl.ProtobufMessages.EntryPoint _ep = _session.getEntryPoint(0); boolean wasOTCSerialized = _ep.getOtcCount() > 0; // if 0, then the OTC was not serialized (older versions of drools) Set<String> tmsEnabled = new HashSet<String>();
public static void readAgenda(MarshallerReaderContext context, RuleData _ruleData, DefaultAgenda agenda) { ProtobufMessages.Agenda _agenda = _ruleData.getAgenda();
public Builder clear() { super.clear(); multithread_ = false; bitField0_ = (bitField0_ & ~0x00000001); time_ = 0L; bitField0_ = (bitField0_ & ~0x00000002); if (ruleDataBuilder_ == null) { ruleData_ = org.drools.marshalling.impl.ProtobufMessages.RuleData.getDefaultInstance(); } else { ruleDataBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000004); if (processDataBuilder_ == null) { processData_ = org.drools.marshalling.impl.ProtobufMessages.ProcessData.getDefaultInstance(); } else { processDataBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000008); if (timersBuilder_ == null) { timers_ = org.drools.marshalling.impl.ProtobufMessages.Timers.getDefaultInstance(); } else { timersBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000010); return this; }
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() ); } }
private static ReteooStatefulSession createAndInitializeSession(MarshallerReaderContext context, int id, ExecutorService executor, Environment environment, SessionConfiguration config, ProtobufMessages.KnowledgeSession _session) throws IOException { FactHandleFactory handleFactory = context.ruleBase.newFactHandleFactory( _session.getRuleData().getLastId(), _session.getRuleData().getLastRecency() ); DefaultAgenda agenda = context.ruleBase.getConfiguration().getComponentFactory().getAgendaFactory().createAgenda( context.ruleBase, false ); readAgenda( context, _session.getRuleData(), agenda ); ReteooStatefulSession session = new ReteooStatefulSession( id, context.ruleBase, executor, handleFactory, false, 1, config, agenda, environment ); new StatefulKnowledgeSessionImpl( session ); return session; }
/** * <code>optional .org.drools.marshalling.RuleData rule_data = 3;</code> */ public Builder mergeRuleData(org.drools.marshalling.impl.ProtobufMessages.RuleData value) { if (ruleDataBuilder_ == null) { if (((bitField0_ & 0x00000004) == 0x00000004) && ruleData_ != org.drools.marshalling.impl.ProtobufMessages.RuleData.getDefaultInstance()) { ruleData_ = org.drools.marshalling.impl.ProtobufMessages.RuleData.newBuilder(ruleData_).mergeFrom(value).buildPartial(); } else { ruleData_ = value; } onChanged(); } else { ruleDataBuilder_.mergeFrom(value); } bitField0_ |= 0x00000004; return this; } /**
/** * <code>optional .org.drools.marshalling.RuleData rule_data = 3;</code> */ public Builder clearRuleData() { if (ruleDataBuilder_ == null) { ruleData_ = org.drools.marshalling.impl.ProtobufMessages.RuleData.getDefaultInstance(); onChanged(); } else { ruleDataBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000004); return this; } /**
public org.drools.marshalling.impl.ProtobufMessages.RuleData getDefaultInstanceForType() { return org.drools.marshalling.impl.ProtobufMessages.RuleData.getDefaultInstance(); }
private static DefaultAgenda resetSession(ReteooStatefulSession session, MarshallerReaderContext context, ProtobufMessages.KnowledgeSession _session) { session.reset( _session.getRuleData().getLastId(), _session.getRuleData().getLastRecency(), 1 ); DefaultAgenda agenda = (DefaultAgenda) session.getAgenda(); readAgenda( context, _session.getRuleData(), agenda ); return agenda; }
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 void initFields() { multithread_ = false; time_ = 0L; ruleData_ = org.drools.marshalling.impl.ProtobufMessages.RuleData.getDefaultInstance(); processData_ = org.drools.marshalling.impl.ProtobufMessages.ProcessData.getDefaultInstance(); timers_ = org.drools.marshalling.impl.ProtobufMessages.Timers.getDefaultInstance(); } private byte memoizedIsInitialized = -1;