No Empty Orders Example

Requirement: No Empty Orders

Since it makes no business sense to place an order with no line items, the noEmptyOrder requirement is implemented using the following logic.

This example illustrates the following concepts:

  • Counts for existence checks. The itemCount indicates whether the order has any items.
  • Commit time logic. The validation is executed after item logic has adjusted the itemCount.
  • Constraint-derived result. Regular validations have the effect that all orders are rejected. Since commit validations run after all the rows are processed, the itemCount reflects the Lineitems (if any). The logic operates as intended.
For more information on Logic Execution and commit time processing, see Logic Execution.

For more information about these concepts, see Logic Patterns.