Contents

Chapter 1

Features

This chapter covers the core features and capabilities of Conditional Logic Engine.

Features

  • 15 comparison operators: equals, not_equals, greater_than, less_than, greater_equal, less_equal, contains, not_contains, starts_with, ends_with, is_empty, is_not_empty, matches (regex), in, not_in
  • 9 action types: show, hide, require, optional, skip, set_value, validate, disable, enable
  • JSON rule definitions: define all logic in a declarative JSON format
  • AND/OR logic groups: combine multiple conditions with boolean operators
  • Field-to-field references: conditions can reference other form field values
  • Evaluation engine: evaluate rules against live form data and return actions to execute
  • Python 3.10+ stdlib only — no pip installs required

Quick Start

bash
# Evaluate rules against form data
python src/conditional_logic_engine.py --rules examples/form_rules.json --data '{"country": "US", "age": "25"}'

# Run the built-in demo
python src/conditional_logic_engine.py --demo
Chapter 2

CLI Reference

Follow this guide to get Conditional Logic Engine up and running in your environment.

CLI Reference

FlagDescription
--rules FILEJSON file containing conditional logic rules
--data JSONForm data as a JSON string to evaluate against
--demoRun a built-in demo showing all operator/action types

Rules JSON Format

json
{
  "rules": [
    {
      "id": "show-company-field",
      "description": "Show company name when role is Business",
      "logic": "and",
      "conditions": [
        {
          "field": "role",
          "operator": "equals",
          "value": "business"
        }
      ],
      "actions": [
        {
          "type": "show",
          "target": "company_name"
        },
        {
          "type": "require",
          "target": "company_name"
        }
      ]
    },
    {
      "id": "skip-shipping-for-digital",
      "logic": "or",
      "conditions": [
        {
          "field": "product_type",
          "operator": "equals",
          "value": "digital"
        },
        {
          "field": "product_type",
          "operator": "equals",
          "value": "subscription"
        }
      ],
      "actions": [
        {
          "type": "skip",
          "target": "shipping_step"
        }
      ]
    }
  ]
}

Operators

OperatorDescriptionExample
equalsExact match (case-insensitive)country equals "US"
not_equalsDoes not matchstatus not_equals "cancelled"
greater_thanNumeric greater thanage greater_than 18
less_thanNumeric less thanquantity less_than 100
greater_equalNumeric >=total greater_equal 50
less_equalNumeric <=discount less_equal 25
containsSubstring matchemail contains "@acme"
not_containsNo substring matchname not_contains "test"
starts_withPrefix matchphone starts_with "+1"
ends_withSuffix matchemail ends_with ".edu"
is_emptyField is blanknotes is_empty
is_not_emptyField has valueemail is_not_empty
matchesRegex pattern matchzip matches "^\d{5}$"
inValue in listcountry in ["US","CA","UK"]
not_inValue not in listrole not_in ["admin","root"]

Actions

ActionDescription
showMake a field/section visible
hideHide a field/section
requireMake a field required
optionalMake a field optional
skipSkip a step/section
set_valueSet a field's value
validateApply a validation rule
disableDisable a field
enableEnable a field

Logic Modes

  • "logic": "and" — ALL conditions must be true (default)
  • "logic": "or" — ANY condition must be true
Chapter 3
🔒 Available in full product

Programmatic Usage

Chapter 4
🔒 Available in full product

License

You’ve reached the end of the free preview

Get the full Conditional Logic Engine and unlock everything.

All Chapters

Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.

Full Tool Suite

Access all interactive tools with complete data, all workload profiles, and the full scenario library.

Source Files

Downloadable source code, configuration files, and working examples from every chapter.

Lifetime Updates

Free updates for life. Every new chapter, tool, and improvement included.

Buy Now — $29 →
📦 Free sample included — download another copy for the full product.
Conditional Logic Engine v1.0.0 — Free Preview