Page 175 -
P. 175
5 Exception Handling 165
Each exception type may have an associated RDR rule tree in the rule set for a
specification – that is, an RDR set for a specification may contain up to 11 rule trees,
one for each exception type and one for selections. So, depending on the exception
type that has occurred and the context of the case instance, an appropriate exlet can
be chosen and executed to handle the exception.
If there are no rules defined for a certain exception type in the rule set for a
specification, the exception event is simply ignored by the service. Thus rules are
needed only for those exception events that are desired to be handled for a particular
task and/or specification.
An invoked exlet may suspend its parent case instance when it is activated, but
there may be some occasions when the exlet can (or needs to) operate in parallel
to its parent. For example, it is undesirable to suspend an entire Travel Bookings
process when a request to upgrade a single room booking has been received – it is far
easier to handle the request as a (local) externally raised exception while allowing
the parent process to continue. Exlets may be defined to accommodate whatever
action is desired to be taken.
5.4.3.1 Exception Types
There are ten types of exception that are defined by the service for handling, as
detailed below.
Constraint Types
Constraints are rules that are applied to a work item or case immediately before and
after execution of that work item or case. Thus, there are four types of constraint
exception handled by the service:
CasePreConstraint – Case-level preconstraint rules are checked when each case
instance begins execution
ItemPreConstraint – Item-level preconstraint rules are checked when each work-
item in a case becomes enabled (i.e., ready to be checked out or executed)
ItemPostConstraint – Item-level postconstraint rules are checked when each
work item reaches a finalized status (e.g., completed, canceled, failed)
CasePostConstraint – Case-level postconstraint rules are checked when a case
completes
The service receives notification from the workflow engine when each of these
life-cycle events are reached within each case and work item instance, then checks
the rule set associated with the specification to determine, first, if there are any rules
of that exception type defined for the specification, and if so, if any of the rules
evaluate to true using the contextual data of the case or work item. If the rule set
finds a rule that evaluates to true for the exception type and data, an associated exlet
is selected and invoked.