Page 329 -
P. 329

11  The Worklet Service                                         325
                              This implementation uses the open-source, service-oriented architecture of
                           YAWL to develop a service for flexibility and dynamic exception handling com-
                           pletely independent to the core engine. Thus, the implementation may be viewed
                           as a successful case study in service-oriented computing. As such, the approach
                           and resultant software can also be used in the context of other process engines
                           (e.g., BPEL based systems, classical workflow systems, and the Windows Workflow
                           Foundation).
                              For a demonstration of the use of worklets in a real-world scenario, see Chap. 21.


                           Exercises

                           Exercise 1. Using the Editor, create a process specification for a treatment plan at a
                           generic hospital casualty department. The process should contain tasks to examine
                           the patient and collect medical data, to diagnose the problem, to refer the patient
                           to the appropriate department, and then to discharge the patient. Then, start the
                           Rules Editor and create a new, properly constructed rule set for the specification,
                           using the rule set described in Chap. 4, Exercise 5. Worklets for each new rule can
                           be created by triggering the Editor from within the Rules Editor. Go back to the
                           original specification and enable the appropriate task(s) so that they are associated
                           with the Worklet Service. Execute an instance of the process in the Engine, taking
                           care to monitor the results. Devise at least three scenarios where an addition to the
                           rule set is required, and add the new rule and worklet.

                           Exercise 2. Using the process specification created in Exercise 1, imagine ways
                           in which exceptions may be raised during an instance of the process. Devise at
                           least two scenarios for three different exception types. Add rules to capture those
                           exceptions to the rule set, and for each define an exlet to handle the exception.
                           Extend the rule tree for one particular exception type by adding two additional rules,
                           so that an exception may be handled in different ways depending on its context. Run
                           as many instances of the process in the Engine as required, taking care to watch for
                           the invocation of exlets at the appropriate time(s) and their effect on the parent
                           process (based, of course, on how you defined them).



                           Chapter Notes


                           The Worklet Service was originally implemented in two phases: the Selection
                           subservice was implemented first, in part to ensure proof of concept and also to con-
                           struct the framework for the overall approach, and was first deployed as a member
                           component of the YAWL Beta 7 release. The Exception subservice was then added
                           as an extension to the Selection Service and was first deployed as a component
                           member of the YAWL Beta 8 release. See [23,25–27] for more details.
   324   325   326   327   328   329   330   331   332   333   334