Page 318 -
P. 318

314                                                        M. Adams
                           sets need to be defined (i.e., rules defined within those tree sets). Of course, rules
                           for other event types can be added later if required. Figure 11.16 shows the Time-
                           out rule tree for the or Arrange Delivery Appointment task of the Payment subnet
                           (cf. Sect. 11.7.1).



                           11.9 Extending the Available Conditionals


                           The Worklet Service provides a discrete class that enables developers to extend the
                           set of functions available to be used as part of the conditional expressions of rule
                           sets. The class is called RdrConditionFunction, the source code for which currently
                           contains a small number of examples to give developers an indication of the kinds
                           of things that can be achieved with the class and how to create additional func-
                           tions. The class is freely extensible into any domain space, and thus data can be
                           drawn from diverse sources, such as process mining, resource logs, and external
                           databases, and queried through user-defined functions as part of the evaluation of
                           the conditional expressions of rule nodes. The ConditionEvaluator class has been
                           designed to call the RdrConditionFunction object to resolve function references in
                           conditional expressions to their evaluated values. As the interface between this class
                           and the rest of the service is very small, it can easily be extended and separately
                           recompiled, avoiding the overhead of rebuilding the entire service.
                              The class code is split into four sections:

                             Header: containing a listing of available functions and a method to test for the
                              existence of a function
                             Execute Method: a method called by the ConditionEvaluator object when evalu-
                              ating a condition containing a user-defined function
                             Function Definitions: the functions themselves
                             Implementation: where additional support methods may be created.

                              Once a function is added, it can be used in any rule’s conditional expression.
                           One example method of the class is isNotCompleted, which is designed to return a
                           boolean true value if a work item does not have a completed status.
                              The objective of the RdrConditionFunction class is to allow developers to easily
                           extend the capabilities of the Worklet Service by providing the means to test for
                           things in the conditional expressions of rule nodes other than the process instance’s
                           data attributes and values. This allows data from any source to be tested during
                           rule evaluations and also provides the service with ease-of-use capabilities when
                           formulating new conditions.
   313   314   315   316   317   318   319   320   321   322   323