When you add generatePDFOutput and generatePrintedOutput
operations to process diagrams, they include exception event throws.
However, in some cases, the operations do not throw exception events
when they fail. Instead, the returned Status Document includes information
about the failure. The Status Document is an XML document that summarizes
the results of the operation.
To handle all failure scenarios, include the following configurations
in your process diagrams:
To handle failures that are indicated in the Status Document,
draw routes from the operation and add conditions to the route.
The conditions evaluate the Status Document to see whether an exception
has occurred.
To handle failures that throw exception events, draw routes
from the exception event throws. (See Handling event catches.)
The Status Document includes a status element:
If the operation was successful, the status element contains
a zero (0).
If an exception occurred, the status element contains any
text other than a zero (0).
The XPath expression that retrieves the text in the status element
is /process_data/[XML variable name]/printResult/status,
where [XML variable name] is the name of the variable that
stores the status document.
Use routing conditions to evaluate the returned status document
and determine whether an exception occurred. For example, the Status
Document property of a generatePDFOutput operation is set to an
XML variable named XMLvar. The following condition
is true when an exception has occurred:
/process_data/XMLvar/printResult/status != 0
Handle exceptions that are indicated in the Status Document:
Configure the generatePDFOutput or generatePrintedOutput
operation so that the Status Document property is set to an XML
variable. The returned document value will be automatically coerced
from a document value (binary) to an XML value (text).
Draw a route from the generatePDFOutput or generatePrintedOutput operation
to the operation that you want to execute when the exception occurs.
Add a condition to the route that compares the text in the
status element to zero (0).