use of org.drools.core.spi.FactHandleFactory in project drools by kiegroup.
the class ProtobufInputMarshaller method createAndInitializeSession.
private static StatefulKnowledgeSessionImpl createAndInitializeSession(MarshallerReaderContext context, int id, Environment environment, SessionConfiguration config, ProtobufMessages.KnowledgeSession _session) throws IOException {
FactHandleFactory handleFactory = context.kBase.newFactHandleFactory(_session.getRuleData().getLastId(), _session.getRuleData().getLastRecency());
InternalAgenda agenda = context.kBase.getConfiguration().getComponentFactory().getAgendaFactory().createAgenda(context.kBase, false);
readAgenda(context, _session.getRuleData(), agenda);
WorkingMemoryFactory wmFactory = context.kBase.getConfiguration().getComponentFactory().getWorkingMemoryFactory();
StatefulKnowledgeSessionImpl session = (StatefulKnowledgeSessionImpl) wmFactory.createWorkingMemory(id, context.kBase, handleFactory, // pCTx starts at 1, as InitialFact is 0
1, config, agenda, environment);
return session;
}
use of org.drools.core.spi.FactHandleFactory in project drools by kiegroup.
the class CursoredDataSource method insertIntoWm.
private FactHandle insertIntoWm(T object) {
FactHandleFactory fhFactory = workingMemory.getFactHandleFactory();
DataSourceFactHandle factHandle = new DataSourceFactHandle(this, fhFactory.getNextId(), fhFactory.getNextRecency(), object);
objectStore.addHandle(factHandle, object);
propagate(() -> new Insert(factHandle));
return factHandle;
}
Aggregations