The Rules Engine in OptimiDoc allows administrators to automate document workflow decisions by defining conditions and actions that are evaluated in real time. This guide walks through the complete process of creating a new rule, from selecting the context to configuring conditions and actions.
Screenshot: Rule editor — General tab
Prerequisites
Before creating a rule, ensure that:
-
You are logged in as an Administrator — the Rules Engine is available to administrators only.
-
You have a clear understanding of the workflow you wish to automate (e.g. restricting colour printing, redirecting jobs, sending notifications).
-
Any entities you plan to reference in conditions or actions (users, groups, departments, devices) already exist in OptimiDoc.
Step 1 -- Navigate to the Rules Page
-
Open the OptimiDoc web administration interface.
-
In the left sidebar, click Rules. The page opens at
/ruleswith the title Rules Engine. -
Existing rules are grouped under one tab per context: Login, Accept Job, Before Print, and Release Job. Each tab shows a badge with the number of rules it contains.
Step 2 -- Start Creating a New Rule
-
Click the Create Rule button in the top-right corner of the page.
-
A rule editor dialogue opens with three tabs: General, Conditions, and Actions.
Step 3 -- Configure General Settings
On the General tab:
-
Enter a descriptive Name for the rule (e.g. "Block colour prints over 50 pages").
-
Select the Context that determines when this rule is evaluated:
-
Login -- evaluated when a user logs in to a device.
-
Accept Job -- evaluated when a job is received from a device.
-
Before Print -- evaluated just before a job is sent to the printer.
-
Release Job -- evaluated when a user releases a job for printing.
-
-
Set the Active toggle to enable or disable the rule immediately.
Note that the dialog has no priority field. A new rule is simply added to its context; you set its position in the evaluation order afterwards with Reorder (see Managing Existing Rules), where a lower number is evaluated first.
Step 4 -- Add Conditions
Switch to the Conditions tab. Conditions define when the rule should fire. All conditions must be satisfied (logical AND) for the rule to trigger.
-
Click Add Condition.
-
Select a Field from the dropdown. Available fields depend on the chosen context:
-
User -- matches a specific user or set of users.
-
User's Group -- matches users belonging to a particular group.
-
Department -- matches users in a specific department.
-
Device -- matches the device where the user logs in or the job is released.
-
Device tags -- matches when the device carries any of the selected tags. Available from the release following 26.07; in 26.07 and earlier the editor did not offer it.
-
Login / Job Title / Queue -- text fields matching the login name, the document name, or the print queue name.
-
Job Type -- matches Copy, Print, or Scan.
-
Number of Pages -- matches the page count, optionally filtered by paper format (A4, A3, Letter, Legal) and colour mode (Colour, Black & White).
-
Current Consumption -- matches the user's accumulated consumption for the selected property (Total, Print, Copy or Scan).
-
Job Consumption Estimate -- matches the estimated cost of the current job.
-
Date -- matches a calendar date; use Greater Than / Less Than to match jobs before or after a given date.
-
-
Select an Operator: Is, Is Not, Contains, Starts With, Matches (Regex), Greater Than, Less Than, or Equal. The available operators depend on the field type.
-
Enter or select the Value. For entity fields (User, Group, Department, Device, Device tags), use the search-and-select picker to choose one or more entities.
-
Repeat to add additional conditions as needed.
Step 5 -- Add Actions
Switch to the Actions tab. Actions define what happens when all conditions are met.
-
Click Add Action.
-
Select an action type from the dropdown:
-
Reject Operation -- denies the job or login attempt.
-
Force Black & White -- converts a colour job to monochrome.
-
Force Duplex -- forces double-sided (long-edge) printing.
-
Print All Jobs -- releases all pending jobs for the user (Login only).
-
Redirect to User -- reassigns the job to a different user.
-
Redirect to Device -- sends the job to a different printer.
-
Save Job Preview -- stores a preview image of the job.
-
Send Email Notification -- sends an e-mail to the job owner with a custom subject and body.
-
Send Email To -- sends an e-mail to a specified address.
-
Add Watermark -- overlays watermark text on the printed document (PostScript jobs only).
-
Run Script -- executes a script or programme on the server with optional arguments.
-
-
Configure any parameters required by the selected action (e.g. select a target device for redirection, or enter watermark text). E-mail actions use the global mail server configured under Settings → Mail.
-
Add additional actions if the rule should perform multiple operations.
Step 6 -- Save the Rule
-
Review your settings across all three tabs. A rule requires a name, at least one condition, and at least one action.
-
Click Create (for a new rule) or Save (when editing). Saving validates the rule's structure only — there is no dry-run or test mode.
-
The rule appears in the list under its context tab. If it is active, it takes effect immediately.
Rules do not stop at the first match. Within a context, every active rule whose conditions are satisfied applies its actions, in priority order. Plan priorities deliberately when several rules could act on the same job — for instance, ensure a "reject" rule sits above rules that would otherwise modify the same job.
Managing Existing Rules
After a rule is created, you can perform the following operations from the rule list:
|
Action |
How |
|---|---|
|
Enable / Disable |
Toggle the Active switch directly in the rule row. Inactive rules are skipped during evaluation. |
|
Edit |
Click the three-dot menu and select Edit. |
|
Duplicate |
Click the three-dot menu and select Duplicate to create an editable copy of the rule; the copy is added inactive so you can adjust it before enabling. |
|
Reorder |
Click Reorder, drag the rules within the active context into the desired order, then click Save Order. Priorities are renumbered sequentially from 1. |
|
Delete |
Click the three-dot menu and select Delete, then confirm. |
Tips and Best Practices
-
Start with rules disabled. Because there is no dry-run mode, create and review a rule before enabling it to avoid unintended disruptions.
-
Use descriptive names. A name like "Finance Dept - Force Duplex" is far more maintainable than "Rule 1".
-
Test with a single user first. Add a User condition to restrict the rule to yourself, verify it works as expected, then broaden the scope.
-
Check the Activity Log. After enabling a rule, review the Activity Log and job history to confirm it is triggering as expected.
Related articles