Beispiel #1
0
		public IFlowEngine NewBRE(IRulesDriver rulesDriver) {
			BREImpl bre = new BREImpl();
			
			// Lets register the result handler
			if (resultHandler != null) bre.ResultHandlers += resultHandler;

			if (!bre.Init(rulesDriver)) return null;
			else return bre;
		}
Beispiel #2
0
 private IFlowEngine NewEngine()
 {
     IFlowEngine flowEngine = new BREImpl();
     if (flowEngine.Init(new XBusinessRulesFileDriver(ruleFilesFolder + "test-extra.xbre"))) {
         return flowEngine;
     }
     else {
         throw new Exception("Can not load: " + ruleFilesFolder + "test-extra.xbre");
     }
 }
Beispiel #3
0
        /// <summary> Performs a shallow copy of a pre-initialized BRE, i.e. returns a new BRE
        /// containing a shallow copied rule context, ready to fire!
        /// </summary>
        public object Clone()
        {
            if (!initialized)
            {
                throw new BREException("Clone in not available if BRE is not initialized.");
            }

            BREImpl newBRE = new BREImpl();

            // pass the result handler
            newBRE.ResultHandlers += GetResultHandlers();

            // pass a cloned context
            newBRE.RuleContext = (IBRERuleContext)ruleContext.Clone();

            // pass the loaded rule
            newBRE.Init(xmlDocument);

            return(newBRE);
        }
Beispiel #4
0
        /// <summary> Performs a shallow copy of a pre-initialized BRE, i.e. returns a new BRE
        /// containing a shallow copied rule context, ready to fire!
        /// </summary>
        public object Clone()
        {
            if (!initialized)
                throw new BREException("Clone in not available if BRE is not initialized.");

            BREImpl newBRE = new BREImpl();

            // pass the result handler
            newBRE.ResultHandlers += GetResultHandlers();

            // pass a cloned context
            newBRE.RuleContext = (IBRERuleContext)ruleContext.Clone();

            // pass the loaded rule
            newBRE.Init(xmlDocument);

            return newBRE;
        }