1. Configuration

Approval rules

OrderCloud's approval rules system uses a rules engine to enable flexible, condition-based workflows. This system provides:

  • Order and return integrity validation
  • Manual approval checkpoints
  • Policy enforcement capabilities
  • Custom business rule implementation

Rule structure

Both buyer and seller approval rules contain:

  1. RuleExpression:

    • Defines approval conditions
    • Uses domain-specific language
    • Powered by rules engine
    • Evaluates order and return data
    • Enables workflow references
  2. Approving group:

    • Designates review responsibility
    • Specifies approval authority

For detailed engine information, see rules engine documentation.

Rule types

Buyer approval rules

Purpose: Pre-submission order validation

Features:

  • Buyer user group routing
  • Spending limit enforcement
  • Department oversight
  • Policy compliance verification

Example implementation:

  • Manager approval for orders over $1,000
  • Department review for specific products
  • Budget validation checks

Seller approval rules

Purpose: Return process validation

Features:

  • Seller user group routing
  • Return value verification
  • Condition assessment
  • Policy enforcement

Example implementations:

  • Warehouse manager approval for high-value returns
  • Inspection requirements for damaged items
  • Restocking fee policy enforcement

Note: Currently limited to return processes, with potential order support in future updates.

Expression implementation

RuleExpression configuration:

  • Determines approval requirements
  • Uses rules engine syntax
  • 400 character limit
  • Supports complex logic:
    • Chained conditions
    • Comparison operations
    • Conditional operators

Multi-step workflow configuration

Complex approval processes can implement multiple steps:

  1. Sequential approvals:

    • Chain rules together
    • Use order.approved() method
    • Create dependency hierarchies
  2. Example workflow:

ManagerApproval rule:

javascript
order.total > 1000

FinanceApproval rule:

javascript
order.total > 5000 && order.approved("ManagerApproval")

Workflow execution:

  1. Orders over $1,000 require manager approval
  2. Orders over $5,000 require:
    • Initial manager approval
    • Subsequent finance approval

This structure enables:

  • Organizational hierarchy reflection
  • Policy-based routing
  • Sequential approval processes
  • Complex workflow automation

Implementation benefits

The approval rules system provides:

  1. Process control:

    • Automated validation
    • Policy enforcement
    • Workflow management
  2. Business logic integration:

    • Custom rule creation
    • Policy implementation
    • Process automation
  3. Workflow flexibility:

    • Multi-step processes
    • Conditional routing
    • Policy-based decisions
If you have suggestions for improving this article, let us know!