Page 310 -
P. 310
306 M. Adams
Fig. 11.10 The worklet repertoire members for the Process Payment task
those variables that the user will supply values for to be passed back to the parent
task when the worklet completes.
The definition of variables is not restricted to those defined in the parent task.
Any additional variables required for the operation of the worklet may also be
defined here; their values will not be passed back to the parent task when the
worklet completes.
Only those variables that have been defined with an identical name and data type
to variables in the parent task and with a Usage of “Input Only” or “Input &
Output” will have data passed into them from the corresponding variables of the
parent task by the Worklet Service when the worklet is launched.
Only those variables that have been defined with an identical name and data type
to variables in the parent task and with a Usage of “Output Only” or “Input &
Output” will have their data values mapped back to the corresponding variables
of the parent task by the Worklet Service when the worklet completes.
For this example (cf. Fig. 11.9), only the “RemittanceAdvice” variable is required
to be passed from the worklet back to the parent net.
The association of tasks with the Worklet Service is not restricted to top-level
specifications. Worklet specifications also may contain tasks that are associated with
the Worklet Service and so may have worklets substituted for them, so that a hier-
archy of executing worklets may sometimes exist. It is also possible to recursively
define worklet substitutions, that is, a worklet may contain a task that, while cer-
tain conditions hold true, is substituted by another instance of the same worklet
specification that contains the task.
Referring back to the worklet definition shown in Fig. 11.7, the Process Payment
task is also worklet-enabled, that is, it has its own worklet repertoire, which effec-
tively are “grand-children” or the original, parent Payment process. At runtime, the
appropriate worklet will be chosen for execution depending on the current value
held in the ShipmentPayment variable. Figure 11.10 shows the two trivial worklets
defined for the Process Payment task.
At runtime, if the order has been underpaid, the Issue Debit Adjustment worklet is
executed; if there has been an overpayment, the Issue Credit Adjustment worklet is
executed. Importantly, if the payment is correct (i.e., neither underpaid or overpaid),
an “empty” worklet will be returned by the rule set, which means no further action
is required in that instance.
11.7 Exlet Process Definition
This section discusses the definition of exlets, and describes each of the handling
primitives that may be used to form an exlet.