Pre-Condition Check
Last updated
Last updated
The following example illustrates how to implement a pre-condition check that is performed before the logic starts (happy path). The pre-condition check throws a controlled exception (ApplicationException) in case pre-conditions are not met.
The sub.PreConditionCheck has no return value! When the check fails the logic cannot continue! If checks are ok the green path logic in branch 2 is executed.
If you use a Business Rule shape to perform pre-condition checks, you may want to use the psg.BRResultToString
script to serialize a business rule result message (XML)
into a readable string: Validate PLZ: Zip Code not set!
to throw an exception with a good rootCause
message.