/// <summary> /// Method will Get the deftemplate's parent and do a lookup /// </summary> /// <param name="fact">The fact.</param> /// <param name="template">The template.</param> /// <param name="engine">The engine.</param> /// <param name="mem">The mem.</param> public virtual void assertObjectParent(IFact fact, ITemplate template, Rete engine, IWorkingMemory mem) { lock (this) { ObjectTypeNode otn = (ObjectTypeNode)inputNodes.Get(template); if (otn != null) { otn.assertFact(fact, engine, mem); } if (template.Parent != null) { assertObjectParent(fact, template.Parent, engine, mem); } } }
/// <summary> /// assertObject begins the pattern matching /// </summary> /// <param name="fact">The fact.</param> /// <param name="engine">The engine.</param> /// <param name="mem">The mem.</param> public virtual void assertObject(IFact fact, Rete engine, IWorkingMemory mem) { lock (this) { // we assume Rete has already checked to see if the object // has been added to the working memory, so we just assert. // we need to lookup the defclass and deftemplate to assert // the object to the network ObjectTypeNode otn = (ObjectTypeNode)inputNodes.Get(fact.Deftemplate); if (otn != null) { otn.assertFact(fact, engine, mem); } if (fact.Deftemplate.Parent != null) { assertObjectParent(fact, fact.Deftemplate.Parent, engine, mem); } } }