> **Source:** https://knowledge.leegality.com/document-execution/workflows/v4/rule-engine/rule-categories > **Site:** Leegality Knowledge Base — https://knowledge.leegality.com > **About:** Leegality is a document execution platform covering eSigning, stamps, NeSL, workflows, and REST API integration. > **Navigation:** Every article on this site has a plain-text version at `.txt` (this format). To get an index of all articles with their `.txt` links, read: https://knowledge.leegality.com/llms.txt > **AI Guide:** For instructions on how to navigate this knowledge base as an AI agent, read: https://knowledge.leegality.com/ai-readable.txt --- # Rule categories Every rule changes exactly **one of four field properties**. That gives you four rule categories — and for any requirement, your first question after [confirming it's a rule](https://knowledge.leegality.com/document-execution/workflows/v4/rule-engine/what-is-a-rule) is: *which property does this change?* Answering that tells you which category you're building, which examples to copy from, and how to fill in the [rule spec](https://knowledge.leegality.com/document-execution/workflows/v4/rule-engine/turn-a-requirement-into-a-rule). > **Note — Category shorthand** > > You'll sometimes see these referred to by letter — **A** Mandatory, **B** Visibility, **C** Editable, **D** Value. The letters and the property names mean the same thing. ## A · Mandatory rules Turn a field's **required flag** on or off based on another field's value. The workflow won't let the stage complete until a mandatory field is filled. | Requirement | Reading it as a rule | | --- | --- | | Make Reviewer mandatory IF Loan Amount > ₹10,00,000 | Big-ticket loans need a human check; small ones don't | | Make FATCA Declaration mandatory IF Customer Type = NRI | Regulatory field applies to one customer segment only | | Make Insurance Consent *non*-mandatory IF Insurance = No | Mandatory works in both directions — rules can also relax a requirement | → How-to: [Make a field mandatory with a rule](https://knowledge.leegality.com/document-execution/workflows/v4/rule-engine/how-to/make-a-field-mandatory) ## B · Visibility rules **Show or hide** a field — or an entire page — at runtime. Hidden fields don't just look optional; they're not part of the journey at all. | Requirement | Reading it as a rule | | --- | --- | | Hide the Co-applicant Name field IF Loan Type = Personal | Personal loans have no co-applicant — remove the noise | | Show the GST Number field IF Borrower Type = Business | Only businesses have one | | Show the Coordinate Placement page IF new invitees are added at runtime | Visibility rules can target a whole **page**, not just a field | ## C · Editable rules **Lock or unlock** a field. The field stays visible — the reader can see the value — but whether it can be changed depends on your condition. | Requirement | Reading it as a rule | | --- | --- | | Lock Branch Code IF Source = LOS API | System-supplied values shouldn't be hand-edited | | Lock Customer Name IF KYC Verified = true | Once identity is verified, the name is frozen | ## D · Value rules **Compute or assign a value.** This is the most powerful category, because the right-hand side of the rule isn't limited to a constant — it can be: - **A constant** — eSign Type = Aadhaar - **Arithmetic across fields** — Stamp Group Amount = Loan Amount × Stamp Duty % - **A lookup** — Stamp Duty = lookup(State, Loan Amount) - **A value from another part of the workflow** — Payment Collect Amount of Invitee 1 = Stamp Group Amount of Document 1 | Requirement | Reading it as a rule | | --- | --- | | Stamp Duty = lookup(State, Loan Amount) | Duty tables differ by state — the rule resolves the right rate | | eSign Type = Aadhaar IF Loan > ₹1,00,000, else Virtual Sign | A value rule can route the signing experience by tier | | Stamp Group Amount = Loan Amount × Stamp Duty % | Classic computed field — fires the moment its inputs are filled | → How-to: [Calculate a field's value with a rule](https://knowledge.leegality.com/document-execution/workflows/v4/rule-engine/how-to/calculate-a-field-value) ## Beyond the four: two special kinds Two kinds of rules dominate real deployments and sit slightly outside the A–D property model. They still pass the [three-question test](https://knowledge.leegality.com/document-execution/workflows/v4/rule-engine/what-is-a-rule) — they're rules — but they're worth recognising as their own shapes. ### Validation rules A validation rule checks a condition when the user clicks **Proceed** and, if the check fails, **blocks the stage with an error message**. This is how "make X mandatory" requirements often ship in practice: rather than flipping the mandatory flag, the rule verifies the field at Proceed time and explains exactly what's missing. > *Example:* IRN must follow the format `123-456789_ABC` with a valid sequence code. If any document's IRN is missing or malformed, Proceed is blocked and the error names the offending document. → How-to: [Validate fields before Proceed](https://knowledge.leegality.com/document-execution/workflows/v4/rule-engine/how-to/validate-before-proceed) ### Assignment rules An assignment rule applies **structural defaults** when something is added to the workflow — most commonly, auto-assigning documents to invitees, or applying a standard settings bundle to every newly added invitee. > *Example:* every newly added document is automatically assigned to all invitees, so the sender never has to wire assignments by hand. → How-to: [Auto-assign documents with a rule](https://knowledge.leegality.com/document-execution/workflows/v4/rule-engine/how-to/auto-assign-documents) ## Choosing the category: a 10-second habit When a requirement lands, ask in order: 1. Is the ask about a field being **required**? → Mandatory (A) 2. About a field **appearing or disappearing**? → Visibility (B) 3. About a field being **changeable or frozen**? → Editable (C) 4. About a field **getting a value** — computed, looked up, or copied? → Value (D) 5. About **stopping Proceed** with a message? → Validation 6. About **defaults applied when things are added**? → Assignment Then write it down — [Turn a requirement into a rule](https://knowledge.leegality.com/document-execution/workflows/v4/rule-engine/turn-a-requirement-into-a-rule) gives you the six-line format.