/// <summary> /// Adds the object to the internal list of business objects. /// </summary> /// <param name="obj">The obj.</param> public void AddObject(IFactProvider obj) { if (obj != null) { _initialFacts.AddRange(obj.GenerateFactsForRootObject()); } }
/// <summary> /// Generates the set of facts for this object as relation to a parent object. /// </summary> /// <param name="parent">The parent path.</param> /// <param name="parentObject">The parent object.</param> /// <returns>An IList of facts.</returns> public virtual IList <WME> GenerateFactsForRelatedObject(string parent, IFactProvider parentObject) { List <WME> list = new List <WME>(); list.Add(new WME(new EntityObjectTerm(this), parent, new EntityObjectTerm(this))); MakeFacts(list, parent); return(list); }
/// <summary> /// Invokes the specified fact. /// </summary> /// <param name="fact">The fact.</param> private void Invoke(WME fact) { IFactProvider eo = fact.Identifier.Value as IFactProvider; if (eo == null) { return; } try { eo.InvokeMethod(fact.Attribute.Value.ToString(), fact.Value.Value); _actionsTaken.Add(fact); } catch { _actionsSkipped.Add(fact); } }
public void SetProvider(IFactProvider provider) { this.generator = provider; }
/// <summary> /// Generates the set of facts for this object as relation to a parent object. /// </summary> /// <param name="parent">The parent path.</param> /// <param name="parentObject">The parent object.</param> /// <returns>An IList of facts.</returns> public virtual IList<WME> GenerateFactsForRelatedObject(string parent, IFactProvider parentObject) { List<WME> list = new List<WME>(); list.Add(new WME(new EntityObjectTerm(this), parent, new EntityObjectTerm(this))); MakeFacts(list, parent); return list; }
/// <summary> /// Initializes a new instance of the <see cref="EntityObjectTerm"/> class. /// </summary> /// <param name="entityObject">The entity object.</param> public EntityObjectTerm(IFactProvider entityObject) : base(entityObject) { _termType = TermType.EntityObject; }
/// <summary> /// Generates the set of facts for this object as relation to a parent object. /// </summary> /// <param name="parent">The parent path.</param> /// <param name="parentObject">The parent object.</param> /// <returns>An IList of facts.</returns> public IList <WME> GenerateFactsForRelatedObject(string parent, IFactProvider parentObject) { throw new Exception("The method or operation is not implemented."); }
/// <summary> /// Generates the set of facts for this object as relation to a parent object. /// </summary> /// <param name="parent">The parent path.</param> /// <param name="parentObject">The parent object.</param> /// <returns>An IList of facts.</returns> public IList<WME> GenerateFactsForRelatedObject(string parent, IFactProvider parentObject) { throw new Exception("The method or operation is not implemented."); }