@Test public void testAssertObject() throws Exception { StatefulKnowledgeSessionImpl ksession = (StatefulKnowledgeSessionImpl)kBase.newKieSession(); final Rete rete = kBase.getRete(); final ObjectTypeNode objectTypeNode = new ObjectTypeNode(1, this.entryPoint, new ClassObjectType(List.class), buildContext); objectTypeNode.attach(buildContext); final MockObjectSink sink1 = new MockObjectSink(); objectTypeNode.addObjectSink(sink1); final String string = "String"; final DefaultFactHandle h1 = new DefaultFactHandle(1, string); rete.assertObject(h1, pctxFactory.createPropagationContext(0, PropagationContext.Type.INSERTION, null, null, null), ksession); assertLength(0, sink1.getAsserted()); final List list = new ArrayList(); final DefaultFactHandle h2 = new DefaultFactHandle(1, list); rete.assertObject(h2, pctxFactory.createPropagationContext(0, PropagationContext.Type.INSERTION, null, null, null), ksession); ksession.fireAllRules(); final List asserted = sink1.getAsserted(); assertLength(1, asserted); final Object[] results = (Object[]) asserted.get(0); assertSame(list, ((DefaultFactHandle) results[0]).getObject()); }
public void assertObject(final InternalFactHandle factHandle, final PropagationContext context, final InternalWorkingMemory workingMemory) { EntryPointId entryPoint = context.getEntryPoint(); EntryPointNode node = this.entryPoints.get( entryPoint ); ObjectTypeConf typeConf = ((WorkingMemoryEntryPoint) workingMemory.getWorkingMemoryEntryPoint( entryPoint.getEntryPointId() )).getObjectTypeConfigurationRegistry().getObjectTypeConf( entryPoint, factHandle.getObject() ); node.assertObject( factHandle, context, typeConf, workingMemory ); }
Rete extends ObjectSource implements
    Externalizable,
    ObjectSink { public void assertObject(final InternalFactHandle factHandle, final PropagationContext context, final InternalWorkingMemory workingMemory) { EntryPointId entryPoint = context.getEntryPoint(); EntryPointNode node = this.entryPoints.get( entryPoint ); ObjectTypeConf typeConf = ((WorkingMemoryEntryPoint) workingMemory.getWorkingMemoryEntryPoint( entryPoint.getEntryPointId() )).getObjectTypeConfigurationRegistry().getObjectTypeConf( entryPoint, factHandle.getObject() ); node.assertObject( factHandle, context, typeConf, workingMemory ); } }
Rete extends ObjectSource implements
    Externalizable,
    ObjectSink { public void assertObject(final InternalFactHandle factHandle, final PropagationContext context, final InternalWorkingMemory workingMemory) { EntryPointId entryPoint = context.getEntryPoint(); EntryPointNode node = this.entryPoints.get( entryPoint ); ObjectTypeConf typeConf = ((WorkingMemoryEntryPoint) workingMemory.getWorkingMemoryEntryPoint( entryPoint.getEntryPointId() )).getObjectTypeConfigurationRegistry().getObjectTypeConf( entryPoint, factHandle.getObject() ); node.assertObject( factHandle, context, typeConf, workingMemory ); } Rete();  Rete(InternalKnowledgeBase kBase); }
Rete extends ObjectSource implements
    Externalizable,
    ObjectSink { public void assertObject(final InternalFactHandle factHandle, final PropagationContext context, final InternalWorkingMemory workingMemory) { EntryPointId entryPoint = context.getEntryPoint(); EntryPointNode node = this.entryPoints.get( entryPoint ); ObjectTypeConf typeConf = ((WorkingMemoryEntryPoint) workingMemory.getWorkingMemoryEntryPoint( entryPoint.getEntryPointId() )).getObjectTypeConfigurationRegistry().getObjectTypeConf( entryPoint, factHandle.getObject() ); node.assertObject( factHandle, context, typeConf, workingMemory ); } Rete();  Rete(InternalKnowledgeBase kBase); short getType(); void assertObject(final InternalFactHandle factHandle,
                             final PropagationContext context,
                             final InternalWorkingMemory workingMemory); void retractObject(final InternalFactHandle handle,
                              final PropagationContext context,
                              final InternalWorkingMemory workingMemory); void modifyObject(final InternalFactHandle factHandle,
                             final ModifyPreviousTuples modifyPreviousTuples,
                             final PropagationContext context,
                             final InternalWorkingMemory workingMemory); void addObjectSink(final ObjectSink objectSink); void removeObjectSink(final ObjectSink objectSink); void attach( BuildContext context ); void networkUpdated(UpdateContext updateContext); EntryPointNode getEntryPointNode(final EntryPointId entryPoint); List<ObjectTypeNode> getObjectTypeNodes(); Map<ObjectType, ObjectTypeNode> getObjectTypeNodes(EntryPointId entryPoint); @Override InternalKnowledgeBase getKnowledgeBase(); @Override boolean equals(final Object object); void updateSink(final ObjectSink sink,
                           final PropagationContext context,
                           final InternalWorkingMemory workingMemory); void writeExternal(ObjectOutput out); @SuppressWarnings("unchecked") void readExternal(ObjectInput in); Map<EntryPointId,EntryPointNode> getEntryPointNodes(); void byPassModifyToBetaNode(InternalFactHandle factHandle,
                                       ModifyPreviousTuples modifyPreviousTuples,
                                       PropagationContext context,
                                       InternalWorkingMemory workingMemory); @Override BitMask calculateDeclaredMask(Class modifiedClass, List<String> settableProperties); }
Rete extends ObjectSource implements
    Externalizable,
    ObjectSink { public void assertObject(final InternalFactHandle factHandle, final PropagationContext context, final InternalWorkingMemory workingMemory) { EntryPointId entryPoint = context.getEntryPoint(); EntryPointNode node = this.entryPoints.get( entryPoint ); ObjectTypeConf typeConf = ((WorkingMemoryEntryPoint) workingMemory.getWorkingMemoryEntryPoint( entryPoint.getEntryPointId() )).getObjectTypeConfigurationRegistry().getObjectTypeConf( entryPoint, factHandle.getObject() ); node.assertObject( factHandle, context, typeConf, workingMemory ); } Rete();  Rete(InternalKnowledgeBase kBase); short getType(); void assertObject(final InternalFactHandle factHandle,
                             final PropagationContext context,
                             final InternalWorkingMemory workingMemory); void retractObject(final InternalFactHandle handle,
                              final PropagationContext context,
                              final InternalWorkingMemory workingMemory); void modifyObject(final InternalFactHandle factHandle,
                             final ModifyPreviousTuples modifyPreviousTuples,
                             final PropagationContext context,
                             final InternalWorkingMemory workingMemory); void addObjectSink(final ObjectSink objectSink); void removeObjectSink(final ObjectSink objectSink); void attach( BuildContext context ); void networkUpdated(UpdateContext updateContext); EntryPointNode getEntryPointNode(final EntryPointId entryPoint); List<ObjectTypeNode> getObjectTypeNodes(); Map<ObjectType, ObjectTypeNode> getObjectTypeNodes(EntryPointId entryPoint); @Override InternalKnowledgeBase getKnowledgeBase(); @Override boolean equals(final Object object); void updateSink(final ObjectSink sink,
                           final PropagationContext context,
                           final InternalWorkingMemory workingMemory); void writeExternal(ObjectOutput out); @SuppressWarnings("unchecked") void readExternal(ObjectInput in); Map<EntryPointId,EntryPointNode> getEntryPointNodes(); void byPassModifyToBetaNode(InternalFactHandle factHandle,
                                       ModifyPreviousTuples modifyPreviousTuples,
                                       PropagationContext context,
                                       InternalWorkingMemory workingMemory); @Override BitMask calculateDeclaredMask(Class modifiedClass, List<String> settableProperties);  }