Page 313 -
P. 313

11  The Worklet Service                                         309
                           available to the Exception Service – thus the values of any case variables may be
                           queried in the Ripple-Down Rule tree sets for any constraint type rule. When the
                           work item is completed, a PostItemConstraint event is generated by the engine.
                              In this example, the Arrange Pickup Appointment work item does have a pre-
                           item constraint rule tree, and so when it becomes enabled, the rule tree is queried.
                           One particular rule in the pre-item constraint rule tree for the task checks that valid
                           values have been supplied for the Pickup Instructions and Pickup Spot fields of
                           the PickupInstruction variable. If the values are empty or invalid, the Get Pickup
                           Instructions exlet is invoked, which will first suspend the process instance, then run
                           a compensatory worklet to get the pickup instructions from a user, then continue
                           the case. Note that since exlet compensations are always worklet executions, the
                           pickup instruction data gathered by the worklet is automatically mapped back to the
                           corresponding variables of the task on which the exception was raised, so that the
                           case can continue with the required data inserted in the appropriate place.
                              The actions taken by the exlet are also reflected in the worklist. The Arrange
                           Pickup Appointment work item is marked with a status of “Suspended” and thus is
                           unable to be selected for starting, while the compensatoryworklet has been launched
                           and its first work item would be found in the Offered queue of the appropriate
                           participants. The compensatory worklet is treated by the exception service as just
                           another case, and so the service receives notifications from the engine for pre-case
                           and pre-item constraint events of the worklet also.
                              When the last work item of the worklet has completed, the engine completes
                           the worklet case and notifies the Exception Service of the completion, at which
                           time the service completes the third and final part of the exlet, that is, continuing
                           (unsuspending) the Arrange Pickup Appointment work item so that the parent case
                           can continue. On the worklist, that work item will now be able to be checked out,
                           with the relevant data values entered in the worklet’s work items mapped back to its
                           variables.



                           11.7.2 External Trigger Example


                           It has been stated previously that almost every case instance involves some devia-
                           tion from the standard process model. Sometimes, events occur completely removed
                           from the actual process model itself, but affect the way the process instance pro-
                           ceeds. Typically, these kinds of events are handled “off-system,” and so there is no
                           record of them, or the way they were handled, kept for future executions of the
                           process specification.
                              The Exception Service allows for such events to be handled on-system by pro-
                           viding a means for exceptions to be raised by users externally to the process itself.
                           The Order Fulfillment specification will again be used to illustrate how an external
                           exception can be triggered by a user or an administrator.
                              A case-level external exception can be raised via extensions added to YAWL’s
                           Resource Service worklist handler. Figure 11.13 shows detail of the worklist’s Case
                           Management screen, and indicates that an instance of the Order Fulfillment spec-
   308   309   310   311   312   313   314   315   316   317   318