public virtual void resolveTemplates(Rete.Rete engine) { ICondition[] cnds = Conditions; for (int idx = 0; idx < cnds.Length; idx++) { ICondition cnd = cnds[idx]; if (cnd is ObjectCondition) { ObjectCondition oc = (ObjectCondition)cnd; Deftemplate dft = (Deftemplate)engine.findTemplate(oc.TemplateName); if (dft != null) { oc.Deftemplate = dft; } } else if (cnd is ExistCondition) { ExistCondition exc = (ExistCondition)cnd; Deftemplate dft = (Deftemplate)engine.findTemplate(exc.TemplateName); if (dft != null) { exc.Deftemplate = dft; } } else if (cnd is TemporalCondition) { TemporalCondition tempc = (TemporalCondition)cnd; Deftemplate dft = (Deftemplate)engine.findTemplate(tempc.TemplateName); if (dft != null) { tempc.Deftemplate = dft; } } } }
public static ExistCondition newExistCondition(ObjectCondition cond) { ExistCondition exc = new ExistCondition(); exc.constraints = cond.constraints; exc.negated = cond.negated; exc.nodes = cond.nodes; exc.template = cond.template; exc.templateName = cond.templateName; return(exc); }