For the complete documentation index, see llms.txt. This page is also available as Markdown.

Business Rules

Create the Order validation rule that requires Company ID and Company Name before the document can leave Validation Errors.

Create the Mandatory fields must not be empty validation rule for Order. The rule blocks approval until the document has both a company ID and a company name.

For the general UI procedure, see Business Rules. The Order list, AI assistant, Parameters, and Test screens on that page are the same editors this walkthrough uses.

Prerequisites

Before you start, complete the Document Type. Confirm that header.company.id and header.company.name appear in field pickers.

1

Open Business Rules

In the Document Intake Cockpit, open Configuration → Business Rules. Select the Order tab, then New rule.

2

Set the Settings tab

Enter the values from Rule settings.

3

Generate the rule

Open AI assistant and enter:

Check that every field selected in a field-path-list parameter with key fieldsToCheck and label Mandatory Fields is present and is not null or an empty string. Return one validation error for each missing field.

Select Generate.

New business rule AI assistant with Describe the rule, sample prompts, and Generate
AI assistant generating the required-company rule
4

Review the generated rule

On Visual, confirm that the rule checks every field in Mandatory Fields for a present, non-empty value. On Code, confirm that fieldsToCheck is exposed as a Field path list parameter named Mandatory Fields. If the result differs, refine the prompt and regenerate before continuing.

5

Set the parameter values

On Parameters, add header.company.id and header.company.name.

6

Test the rule

On Test, generate an example. Run once with both company values filled and confirm the result succeeds. Clear either value, run again, and confirm the result contains a validation error for that field.

7

Save and deploy

Select Save, then Deploy. If you change generated code later, select Redeploy. Leave Active on. These settings make the rule eligible to run. In this walkthrough, Revalidate invokes business-rules-supervisor, which runs the rule.

Rule settings

Field
Value

Rule name

Mandatory fields must not be empty

Document type

Order

Applies to sub-types

Empty – the rule runs for every Order

Rule type

Validation

Execution order

10

Stop on validation failure

On

Active

On

Skippable

Off – a company is required before approval

Mandatory Fields

The Parameters tab lists the fields the rule checks. Paths are relative to the Order mixin.

Path
Label

header.company.id

ID

header.company.name

Name

The rule passes when both values are present and not empty. It fails if either is missing, null, or an empty string. Correct the company on the Form Layout, select Save, and run Revalidate.

Parameters tab with Mandatory Fields and Add field
Parameters with mandatory fields (this walkthrough adds Company ID and Company Name)

Checkpoint

Return to the Order rules list. Confirm that Mandatory fields must not be empty is Active and Deployed. Do not continue while it is Draft or Not deployed.

This rule validates the required company fields only. The next step adds a second validation rule that selects the approval matrix and first approver.

Next, configure Approval and Rejection.

Last updated

Was this helpful?