Page 301 -
P. 301

11  The Worklet Service                                         297
                                   ...
                                 </ruleNode>
                               </task>
                             </selection>
                             <constraints>
                               <case>
                                 <pre>
                                   <ruleNode>
                                      <id>0</id>
                                      <parent>-1</parent>
                                      <trueChild>1</trueChild>
                                      <falseChild>-1</falseChild>
                                      <condition>True</condition>
                                      <conclusion>null</conclusion>
                                      <cornerstone></cornerstone>
                                      <description>root level default node</description>
                                   </ruleNode>
                                   <ruleNode>
                                      <id>1</id>
                                      <parent>0</parent>
                                      <trueChild>-1</trueChild>
                                      <falseChild>-1</falseChild>
                                      <condition>paid = true</condition>
                                      <conclusion>
                                        <_1>
                                           <action>remove</action>
                                           <target>case</target>
                                        </_1>
                                      </conclusion>
                                  ...
                               </case>
                             </constraints>
                            </spec>
                           Listing 11.1 Excerpt of a rules file



                           to create and manage one or more CheckedOutChildItems, which hold information
                           about worklet selection, data associated with the work item, and the results of rules
                           searches.
                              The WorkletService object, for each work item that is checked out from the
                           engine, also loads from file the set of rules pertaining to the specification of which
                           the work item is a member into an RdrSet object. At any time, there may be a num-
                           ber of RdrSets loaded into the service, one for each specification for which a work
                           item has been checked out. Each RdrSet manages one or more RdrTree objects, each
                           tree representing the rule tree for a particular task within the specification, of which
                           this work item is an instance. In turn, each RdrTree owns a number of RdrNode
                           objects, which contain the actual rules, conclusions, and other data for each node of
                           theruletree.
                              When a rule tree is evaluated against the data set of a work item, each of the
                           associated nodes of that tree has its condition evaluated by the ConditionEvaluator
                           object, which returns the boolean result to the node, allowing it to traverse to its true
                           or false branch as necessary. Finally, the WorkletGateway object provides commu-
                           nications via a JSP/Servlet interface between the service, the various servlet pages,
                           and the Rules Editor (see Sect. 11.10.2 for more details).
   296   297   298   299   300   301   302   303   304   305   306