The MSPro Boomi Collection
About
Good Practices & Patterns
Good Practices & Patterns
  • Markus' Boomi Integration
  • Implementation Patterns
    • The Cache Challenge
      • The Get-Or-Create Use-Case
      • PropCache Scripts
    • State Management
      • Example Scenario
      • State-Management in general
      • State-Management Functionality
      • Technical Solutions
        • Boomi File-System Implementation
          • saveState
          • readState & fetchStates
    • Exception Handling
      • Exception vs Error
      • Basic Rules
        • Aggregating Exceptions
      • Exception Handling Pattern
        • User-Defined Exception Messages
        • Catch Exceptions
      • The pattern in practice
        • API Error Handling
          • Single Record Strategy
            • Single Record RES
          • Many Records Strategy (Array)
            • Many Records RES
        • Pre-Condition Check
    • SQL Patterns
      • Script Header
      • General Rules
        • Check using RowCount
        • Check if record exists
        • Pagination and Sorting
        • Parameter - Best Practices
        • Use JSON as a complex parameter
    • Process Patterns
      • Process Route Implementation Pattern
      • Sub-Process or Process Route
    • DateTime
      • The Boomi datetime dilemma
      • Database and Flow
      • Groovy
      • Data Hub
      • Get Current Date
    • Groovy Script Patterns
      • Dynamic Document Properties
      • Dynamic Process Properties
      • Documents
    • Array Elements to Documents
  • MSPro Services
    • Intermediate Storage
      • Example Processes
        • Docs 01 - Update and Create
          • sub.SampleData.Invoice
        • 02 - Upsert and Get
    • Render Templates
  • Tips
Powered by GitBook
On this page
  1. Implementation Patterns
  2. Exception Handling
  3. The pattern in practice

Pre-Condition Check

Last updated 11 months ago

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.

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.

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