Pre-Condition Check

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.

Parent process using the "Pre-Condition Chekc" sub-process

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.

Pre-Condition Check with Business Rules

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)

<business_rule_failures>
    <business_rule_failure rule="Validate PLZ">Zip Code not set!</business_rule_failure>
</business_rule_failures>

into a readable string: Validate PLZ: Zip Code not set! to throw an exception with a good rootCause message.

Last updated