bpm-agent / docs /process-constraints.md
limonad's picture
Upload 24 files
1e49a59 verified

A newer version of the Gradio SDK is available: 6.14.0

Upgrade

Process Constraints (Normative)

This file contains the normative specifications and strict constraints that must always be adhered to during process execution. These constraints are expressed using Declare constraint patterns for the Purchase Order process.

Process Activities

The process involves two main activities:

  • Create Purchase Order Item: Creating a purchase order item in the system
  • Record Goods Receipt: Recording the receipt of goods

Existence Constraints

Existence1[Create Purchase Order Item]

A Purchase Order Item must be created at least once in every process instance.

Exactly1[Create Purchase Order Item]

A purchase order item must be created exactly once (no more, no less).

Existence1[Record Goods Receipt]

A goods receipt must be recorded at least once in every process instance.

Exactly1[Record Goods Receipt]

A goods receipt must be recorded exactly once (no more, no less).

Initialization Constraints

Init[Create Purchase Order Item]

Creating a purchase order item must happen before any related steps in the process. This is the starting activity.

Choice Constraints

Choice[Create Purchase Order Item, Record Goods Receipt]

At least one of these activities must occur: either a purchase order item is created OR a goods receipt is recorded (or both).

Choice[Record Goods Receipt, Create Purchase Order Item]

A choice must be made between recording a goods receipt and creating a purchase order item (at least one must occur).

Response Constraints

Responded Existence[Create Purchase Order Item, Record Goods Receipt]

Whenever a purchase order item is created, a goods receipt must eventually be recorded (at some point in the process).

Responded Existence[Record Goods Receipt, Create Purchase Order Item]

Whenever a goods receipt is recorded, a purchase order item must have been created (either before or after).

Response[Create Purchase Order Item, Record Goods Receipt]

Creating a purchase order item must be followed by recording the goods receipt at some point later in the process.

Alternate Response[Create Purchase Order Item, Record Goods Receipt]

After creating a purchase order item, the next occurrence of either activity must be recording a goods receipt (no repeated purchase order creation before goods receipt).

Precedence Constraints

Precedence[Create Purchase Order Item, Record Goods Receipt]

Recording a goods receipt is only allowed after a purchase order item has been created. The purchase order must exist before goods can be received.

Alternate Precedence[Create Purchase Order Item, Record Goods Receipt]

Every "Record Goods Receipt" must be preceded by a "Create Purchase Order Item", and between any two "Record Goods Receipt" activities, there must be a "Create Purchase Order Item".

Negative Constraints (Forbidden Patterns)

Not Response[Record Goods Receipt, Create Purchase Order Item]

After recording a goods receipt, you must NOT create another purchase order item as a response. The purchase order creation should not follow goods receipt.

Not Precedence[Record Goods Receipt, Create Purchase Order Item]

A purchase order item must NOT be created after a goods receipt has been recorded. The purchase order must come first.

Not Chain Response[Record Goods Receipt, Create Purchase Order Item]

Recording a goods receipt must NOT be immediately followed by creating a purchase order item. These activities should not occur in direct succession in this order.

Not Chain Precedence[Record Goods Receipt, Create Purchase Order Item]

Creating a purchase order item must NOT immediately follow recording a goods receipt. There must be other activities or separation between them if they occur in this order.

Summary of Key Rules

  1. Mandatory Activities: Both "Create Purchase Order Item" and "Record Goods Receipt" must occur exactly once
  2. Ordering: Purchase order creation must always precede goods receipt recording
  3. Initialization: The process must start with creating a purchase order item
  4. Forbidden Patterns:
    • Cannot create purchase order after goods receipt
    • Cannot have direct succession of goods receipt followed by purchase order creation
  5. Response Pattern: Creating a purchase order triggers the eventual recording of goods receipt

Note: These constraints are STRICT and the agent must never violate them. Any process execution must conform to these Declare specifications. The agent should guide users to follow these patterns and prevent any violations.