Refine search
@Before public void setUp() throws Exception { this.kBase = (InternalKnowledgeBase) KnowledgeBaseFactory.newKnowledgeBase(); this.pctxFactory = kBase.getConfiguration().getComponentFactory().getPropagationContextFactory(); this.buildContext = new BuildContext(kBase); this.entryPoint = buildContext.getKnowledgeBase().getRete().getEntryPointNodes().values().iterator().next();; }
private InternalFactHandle createEventFactHandle(StatefulKnowledgeSessionImpl wm, InternalKnowledgeBase kBase) { // EntryPointNode Rete rete = kBase.getRete(); NodeFactory nFacotry = kBase.getConfiguration().getComponentFactory().getNodeFactoryService(); RuleBasePartitionId partionId = RuleBasePartitionId.MAIN_PARTITION; EntryPointNode entryPointNode = nFacotry.buildEntryPointNode(1, partionId, false, (ObjectSource) rete , EntryPointId.DEFAULT); WorkingMemoryEntryPoint wmEntryPoint = new NamedEntryPoint( EntryPointId.DEFAULT, entryPointNode, wm); EventFactHandle factHandle = new EventFactHandle(1, (Object) new Person(),0, (new Date()).getTime(), 0, wmEntryPoint); return factHandle; }
@Before public void setUp() { this.kBase = (InternalKnowledgeBase) KnowledgeBaseFactory.newKnowledgeBase(); this.buildContext = new BuildContext( kBase ); this.buildContext.setRule(new RuleImpl()); PropagationContextFactory pctxFactory = kBase.getConfiguration().getComponentFactory().getPropagationContextFactory(); this.context = pctxFactory.createPropagationContext(0, PropagationContext.Type.INSERTION, null, null, null); this.workingMemory = new InstrumentedWorkingMemory( 0, this.kBase ); }
@Test public void testAdd() { /* * create a RuleBase with a single ObjectTypeNode we attach a * MockObjectSink so we can detect assertions and retractions */ InternalKnowledgeBase kBase = (InternalKnowledgeBase) KnowledgeBaseFactory.newKnowledgeBase(); BuildContext context = new BuildContext(kBase); NodeFactory nFacotry = kBase.getConfiguration().getComponentFactory().getNodeFactoryService(); EntryPointNode entryPoint = context.getKnowledgeBase().getRete().getEntryPointNodes().values().iterator().next(); final ObjectTypeNode objectTypeNode = nFacotry.buildObjectTypeNode( 0, entryPoint, new ClassObjectType( Object.class ), context ); objectTypeNode.attach(context); final MockObjectSink sink = new MockObjectSink(); objectTypeNode.addObjectSink( sink ); kBase.newKieSession(); // objectTypeNode. }
Rete rete = kBase.getRete(); NodeFactory nFacotry = kBase.getConfiguration().getComponentFactory().getNodeFactoryService(); EntryPointNode epn = nFacotry.buildEntryPointNode( kBase.getReteooBuilder().getIdGenerator().getNextId(), RuleBasePartitionId.MAIN_PARTITION, kBase.getConfiguration().isMultithreadEvaluation(), rete, new EntryPointId( "xxx" ) );
PropagationContextFactory pctxFactory = kBase.getConfiguration().getComponentFactory().getPropagationContextFactory(); final PropagationContext context = pctxFactory.createPropagationContext(0, PropagationContext.Type.INSERTION, null, null, null);
PropagationContextFactory pctxFactory = kBase.getConfiguration().getComponentFactory().getPropagationContextFactory(); final PropagationContext context = pctxFactory.createPropagationContext(0, PropagationContext.Type.INSERTION, null, null, null);
PropagationContextFactory pctxFactory = kBase.getConfiguration().getComponentFactory().getPropagationContextFactory(); kBase.addPackage(pkg);
private InternalFactHandle createEventFactHandle(StatefulKnowledgeSessionImpl wm, InternalKnowledgeBase kBase) { // EntryPointNode Rete rete = kBase.getRete(); NodeFactory nFacotry = kBase.getConfiguration().getComponentFactory().getNodeFactoryService(); RuleBasePartitionId partionId = new RuleBasePartitionId("P-MAIN"); EntryPointNode entryPointNode = nFacotry.buildEntryPointNode(1, partionId, false, (ObjectSource) rete , EntryPointId.DEFAULT); InternalWorkingMemoryEntryPoint wmEntryPoint = new NamedEntryPoint( EntryPointId.DEFAULT, entryPointNode, wm); EventFactHandle factHandle = new EventFactHandle(1, (Object) new Person(),0, (new Date()).getTime(), 0, wmEntryPoint); return factHandle; }
PropagationContextFactory pctxFactory = kBase.getConfiguration().getComponentFactory().getPropagationContextFactory(); final PropagationContext context = pctxFactory.createPropagationContext(0, PropagationContext.Type.INSERTION, null, null, null);
PropagationContextFactory pctxFactory = kBase.getConfiguration().getComponentFactory().getPropagationContextFactory(); context = pctxFactory.createPropagationContext(0, PropagationContext.Type.INSERTION, null, null, null);
buildContext = new BuildContext( kBase ); PropagationContextFactory pctxFactory = kBase.getConfiguration().getComponentFactory().getPropagationContextFactory(); context = pctxFactory.createPropagationContext(0, PropagationContext.Type.INSERTION, null, null, null);
buildContext = new BuildContext( kBase ); PropagationContextFactory pctxFactory = kBase.getConfiguration().getComponentFactory().getPropagationContextFactory(); context = pctxFactory.createPropagationContext(0, PropagationContext.Type.INSERTION, null, null, null);
@Before public void setUp() throws Exception { store.setClassFieldAccessorCache(new ClassFieldAccessorCache(Thread.currentThread().getContextClassLoader())); store.setEagerWire(true); this.kBase = (InternalKnowledgeBase) KnowledgeBaseFactory.newKnowledgeBase(); buildContext = new BuildContext(kBase, new ReteooBuilder.IdGenerator()); pctxFactory = kBase.getConfiguration().getComponentFactory().getPropagationContextFactory(); }
@Before public void setUp() throws Exception { kBase = (InternalKnowledgeBase) KnowledgeBaseFactory.newKnowledgeBase(); buildContext = new BuildContext(kBase, kBase.getReteooBuilder().getIdGenerator()); pctxFactory = kBase.getConfiguration().getComponentFactory().getPropagationContextFactory(); }
@Before public void setUp() { this.kBase = (InternalKnowledgeBase) KnowledgeBaseFactory.newKnowledgeBase(); this.buildContext = new BuildContext(kBase, kBase.getReteooBuilder().getIdGenerator()); PropagationContextFactory pctxFactory = kBase.getConfiguration().getComponentFactory().getPropagationContextFactory(); this.context = pctxFactory.createPropagationContext(0, PropagationContext.INSERTION, null, null, null); StatefulKnowledgeSessionImpl ksession = (StatefulKnowledgeSessionImpl)kBase.newStatefulKnowledgeSession(); }
@Before public void setUp() throws Exception { RuleBaseConfiguration config = new RuleBaseConfiguration(); config.setPhreakEnabled(false); kBase = (InternalKnowledgeBase) KnowledgeBaseFactory.newKnowledgeBase(); buildContext = new BuildContext(kBase, kBase.getReteooBuilder().getIdGenerator()); pctxFactory = kBase.getConfiguration().getComponentFactory().getPropagationContextFactory(); }
@Before public void setUp() throws Exception { kBase = (InternalKnowledgeBase) KnowledgeBaseFactory.newKnowledgeBase(); buildContext = new BuildContext(kBase, kBase.getReteooBuilder().getIdGenerator()); this.entryPoint = new EntryPointNode(0, this.kBase.getRete(), buildContext); this.entryPoint.attach(buildContext); pctxFactory = kBase.getConfiguration().getComponentFactory().getPropagationContextFactory(); }
pctxFactory = kBase.getConfiguration().getComponentFactory().getPropagationContextFactory(); this.context = pctxFactory.createPropagationContext(0, PropagationContext.INSERTION, null, null, null); this.workingMemory = new StatefulKnowledgeSessionImpl(1L, kBase);