NXBRE-Execution

2.3.1. Execution

NxBRE uses a context object that is used to carry information about its execution environment, which are:

• the available operators,
• the loaded rules,
• the user's business objects and the generated results,

• and a stack trace.

NxBRE使用一个context对象来保持它执行环境的信息,这些信息包括:可用的运算符、已经装载的规则、用户的业务对象以及生成的结果和一个堆栈跟踪。

When parsing the rule file at initialization time, the engine loads all the rule objects in the context. At execution time, the engine follows the execution flow defined by tests andloops.

在初始化时,当分析业务文件的时候,该引擎会加载context厘面所有的业务对象。在执行时,该引擎遵循由检查(我的理解是比较,比较检查某个数字是否位于某一区间)和循环定义的执行流程。

When it reaches a rule element, it gets the corresponding object by its id and calls the ExecuteRule method on it.

当它 到达一个规则元素时,它根据id获取响应的对象,并在该对象上执行ExecuteRule方法。

It then stores the result of this call in the context result.

然后存储方法的执行结果到context结果中。

The ExecuteRule method provides the callee with the NxBRE's context, a map of the optional additional parameters that could have been provided in the XML file and a third parameter (Step) which can also be defined in the XML file.

ExecuteRule方法提供被调用者NxBRE的上下文、由xml文件提供的可选的附加参数对照表以及同样可以有xml文件定义的第三个参数(Setp)。

User's business objects are placed before execution in the context result pool where they are accessible to the engine.After execution, these objects might have been modified,new ones might have been created in the result context (asserted) and some might have been removed from there (retracted).

 用户业务对象在执行之前被放置到context结果池中,这样他们可以被引擎使用。执行之后,这些对象有可能被修改,可能在结果中生成一些新的对象,也可能结果中的一些对象被移除。

posted on 2008-11-13 17:39  recx  阅读(374)  评论(0编辑  收藏  举报