Database Reference
In-Depth Information
The expression present in the Type field in the From section, realizing the lookup of the
error code via status text using DVM in our MDS, is as follows:
dvm:lookupValue("dvm/
StatusText_to_ErrorCode_Mapping_nested.dvm",
"StatusText",
$in.payload/ns7:CTUMessage/ns17:MessageTrackingData/
ns17:MessageTrackingRecord/ns17:StatusText,
"ErrorCode", $in.payload/ns7:CTUMessage/
ns17:MessageTrackingData/ns17:MessageTrackingRecord/
ns17:ErrorCode)
As demonstrated in the earlier screenshot, we perform three lookups for ErrorCode ,
ErrorMessage , and ErrorDetails , which we store in the MessageTracking
section of the message container, and our agnostic controller will use this value for dy-
namic compensation. As mentioned earlier, every task has a compensation pair, registered
as a sibling in the EP. In cases where there is a recognized error (recognized as a Rollback
flag even if it's not an actual rollback), this compensative task will be executed instead of
the next one in the sequence; the task counter will not be increased and further execution
will depend on the results of this compensation (again, provided via Mediator). The final
error resolution will be covered by a dedicated Error Handler, which is part of the conven-
tional BPEL compensation flow, and we will discuss it in detail in Chapter 8 , Taking Care
- Error Handling .
Tip
This simple but effective solution does not eliminate the necessity of full-grown error
handlers and compensation flows. We are just demonstrating how DVM can help with ba-
sic resolution actions and execution status tracking.
Of course, compensative branching logic in an agnostic controller must be strictly conduc-
ted as per the values you put in DVM. DVM can be modified at runtime, changing the
business logic brokered by an agnostic controller; however, if you misspell a word, the
situation can be unpredictable. (Another question is who would do that directly in produc-
tion? Sadly, we all know the answer.) Another issue that must be taken into consideration
is what if the business task does not (or could not) have a dynamic compensation routine?
For simplicity, we didn't show this scenario, but this situation can be anticipated. In most
Search WWH ::




Custom Search