@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 ); }
pctxFactory.createPropagationContext(0, PropagationContext.Type.INSERTION, null, pctxFactory.createPropagationContext(0, PropagationContext.Type.INSERTION, null, pctxFactory.createPropagationContext(0, PropagationContext.Type.INSERTION, null,
pctxFactory.createPropagationContext(0, PropagationContext.Type.INSERTION, null, pctxFactory.createPropagationContext(0, PropagationContext.Type.INSERTION, null,
pctxFactory.createPropagationContext(0, PropagationContext.Type.INSERTION, null,
@Test public void testIsShadowed() { StatefulKnowledgeSessionImpl ksession = (StatefulKnowledgeSessionImpl)kBase.newKieSession(); // Create a Rete network with ObjectTypeNodes for List, Collection and ArrayList final Rete rete = kBase.getRete(); final ObjectTypeNode objectTypeNode = new ObjectTypeNode(1, this.entryPoint, new ClassObjectType(Cheese.class), buildContext); objectTypeNode.attach(buildContext); final MockObjectSink sink1 = new MockObjectSink(); objectTypeNode.addObjectSink(sink1); // There are no String ObjectTypeNodes, make sure its not propagated final Cheese cheese = new Cheese("brie", 15); final DefaultFactHandle h1 = new DefaultFactHandle(1, cheese); rete.assertObject(h1, pctxFactory.createPropagationContext(0, PropagationContext.Type.INSERTION, null, null, null), ksession); ksession.fireAllRules(); final Object[] results = (Object[]) sink1.getAsserted().get(0); }
new ArrayList()); rete.assertObject(h1, pctxFactory.createPropagationContext(0, PropagationContext.Type.INSERTION, null, pctxFactory.createPropagationContext(0, PropagationContext.Type.INSERTION, null,
final PropagationContext context = pctxFactory.createPropagationContext(0, PropagationContext.Type.INSERTION, null, null, null);
final PropagationContext context = pctxFactory.createPropagationContext(0, PropagationContext.Type.INSERTION, null, null, null);
pctxFactory.createPropagationContext( 1, PropagationContext.Type.DELETION, null, tuple != null ? (TerminalNode)tuple.getTupleSink() : null, null ), new RuleTerminalNode(0, new CompositeObjectSinkAdapterTest.MockBetaNode(), context.getRule(), subrule, 0, new BuildContext( kBase )), null); final DefaultKnowledgeHelper kbHelper = new DefaultKnowledgeHelper( ksession );
public void evaluate(final KnowledgeHelper knowledgeHelper, final WorkingMemory workingMemory) { /* on first invoke add another one to the agenda */ if (data.size() < 3) { final PropagationContext context2 = pctxFactory.createPropagationContext(0, 0, rule, (RuleTerminalNodeLeftTuple) knowledgeHelper.getTuple(), null); final RuleTerminalNodeLeftTuple tuple2 = new RuleTerminalNodeLeftTuple(new DefaultFactHandle(2, "cheese"), node, true); node.assertLeftTuple(tuple2, context2, (StatefulKnowledgeSessionImpl) workingMemory); } data.add("tested"); }
public void evaluate(final KnowledgeHelper knowledgeHelper, final WorkingMemory workingMemory) { /* on first invoke add another one to the agenda */ if (data.size() < 5) { final PropagationContext context2 = pctxFactory.createPropagationContext(0, 0, rule, (RuleTerminalNodeLeftTuple) knowledgeHelper.getTuple(), null); final RuleTerminalNodeLeftTuple tuple2 = new RuleTerminalNodeLeftTuple(new DefaultFactHandle(2, "cheese"), node, true); node.assertLeftTuple(tuple2, context2, (StatefulKnowledgeSessionImpl) workingMemory); } data.add("tested"); }
final PropagationContext context = pctxFactory.createPropagationContext(0, PropagationContext.Type.INSERTION, null, null, null);
context = pctxFactory.createPropagationContext(0, PropagationContext.Type.INSERTION, null, null, null);
context = pctxFactory.createPropagationContext(0, PropagationContext.Type.INSERTION, null, null, null);
context = pctxFactory.createPropagationContext(0, PropagationContext.Type.INSERTION, null, null, null);
@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(); }
pctxFactory.createPropagationContext(0, PropagationContext.INSERTION, null, null, f0), this.workingMemory ); pctxFactory.createPropagationContext(0, PropagationContext.INSERTION, null, null, f0), this.workingMemory );
@Test public void testAssignable() { final PropagationContext context = pctxFactory.createPropagationContext(0, PropagationContext.INSERTION, null, null, null); final StatefulKnowledgeSessionImpl workingMemory = new StatefulKnowledgeSessionImpl( 1L, kBase );
@Test public void testSlotSpecific() { PropagationContext contextPassAll = pctxFactory.createPropagationContext(0, PropagationContext.INSERTION, null, null, null, 0, 0, EntryPointId.DEFAULT, allSetButTraitBitMask()); PropagationContext contextPassNothing = pctxFactory.createPropagationContext(0, PropagationContext.INSERTION, null, null, null, 0, 0, EntryPointId.DEFAULT, EmptyBitMask.get()); PropagationContext contextPass2And3 = pctxFactory.createPropagationContext(0, PropagationContext.INSERTION, null, null, null, 0, 0, EntryPointId.DEFAULT, new LongBitMask(6));
final PropagationContext context = pctxFactory.createPropagationContext(0, PropagationContext.INSERTION, null,