From 378e3651915e3d03f0febb6972a889b91f31ac19 Mon Sep 17 00:00:00 2001 From: abdoruzaqi <245876665+abdoruzaqi@users.noreply.github.com> Date: Sun, 5 Jul 2026 02:38:33 +0000 Subject: [PATCH] docs: comprehensive user-first overhaul and reorganization --- content/en/action-types/assignment.md | 71 ---------------- content/en/action-types/condition.md | 68 ---------------- content/en/action-types/entry-action.md | 19 ----- content/en/action-types/loop.md | 27 ------- content/en/action-types/notify/_index.md | 74 ----------------- content/en/action-types/notify/email.md | 32 -------- .../en/action-types/query-records/_index.md | 70 ---------------- .../action-types/query-records/query-doc.md | 25 ------ .../action-types/query-records/query-list.md | 22 ----- .../en/action-types/update-record/_index.md | 80 ------------------- .../action-types/update-record/create-new.md | 27 ------- .../update-record/update-existing.md | 24 ------ content/en/advanced-reference/_index.md | 9 +++ .../advanced-concepts/_index.md | 0 .../advanced-concepts/ai-features.md | 6 +- .../advanced-concepts/architecture/_index.md | 0 .../architecture/actions/_index.md | 0 .../architecture/actions/condition.md | 4 +- .../architecture/actions/document-action.md | 0 .../architecture/actions/entry.md | 2 +- .../architecture/actions/loop.md | 0 .../architecture/actions/notify.md | 4 +- .../architecture/actions/query-records.md | 4 +- .../architecture/actions/stop.md | 4 +- .../architecture/contracts/_index.md | 0 .../architecture/engine/_index.md | 0 .../engine/action-implementation.md | 0 .../architecture/engine/condition-system.md | 2 +- .../architecture/engine/execution-engine.md | 6 +- .../architecture/engine/orchestration.md | 0 .../architecture/internals/_index.md | 0 .../architecture/overview.md | 6 +- .../architecture/resolver/_index.md | 0 .../resolver/resolver-patterns.md | 0 .../architecture/runtime/_index.md | 0 .../architecture/runtime/execution-context.md | 0 .../runtime/graph-orchestration.md | 0 .../architecture/runtime/overview.md | 0 .../architecture/ui/_index.md | 0 .../architecture/ui/action-config-panels.md | 0 .../architecture/ui/component-registry.md | 0 .../architecture/ui/controls.md | 0 .../architecture/ui/dynamic-forms.md | 0 .../architecture/ui/overview.md | 0 .../data-manipulation/_index.md | 0 .../normalization-value-resolver.md | 4 +- .../advanced-concepts/decision-trees.md | 6 +- .../advanced-concepts/reference/_index.md | 0 .../advanced-concepts/reference/ai/_index.md | 0 .../reference/ai/action-metadata-schema.md | 0 .../advanced-concepts/reference/doctypes.md | 8 +- .../reference/execution/_index.md | 0 .../reference/execution/condition.md | 6 +- .../reference/execution/document-action.md | 0 .../reference/execution/entry.md | 0 .../reference/execution/loop.md | 2 +- .../reference/execution/notify.md | 4 +- .../reference/execution/query-records.md | 4 +- .../reference/execution/stop.md | 6 +- .../advanced-concepts/reference/glossary.md | 6 +- .../reference/localized/_index.md | 0 .../reference/localized/arabic-overview.md | 0 .../reference/query-filters/index.md | 2 +- .../reference/terminology.md | 0 .../reference/timespan-keywords/index.md | 0 .../advanced-concepts/registry-contracts.md | 0 .../advanced-concepts/roadmap/_index.md | 0 .../roadmap/assignment-action-improvements.md | 0 .../roadmap/documentation-standardization.md | 0 .../roadmap/event-driven-architecture.md | 0 .../roadmap/platform-potential.md | 0 .../roadmap/runtime-optimization.md | 0 ...ule-entry-condition-vs-condition-action.md | 6 +- .../advanced-concepts/system-philosophy.md | 0 .../advanced-concepts/triggers/_index.md | 2 +- .../triggers/callable-triggers.md | 0 .../triggers/context-reference.md | 0 .../triggers/engine-details.md | 0 .../triggers/event-triggers.md | 0 .../triggers/scheduler-triggers.md | 0 .../api-reference/_index.md | 0 .../api-reference/contracts.md | 0 .../api-reference/hooks.md | 0 .../api-reference/public-apis.md | 0 .../developer-guide/_index.md | 0 .../performance/_index.md | 0 .../performance/architecture.md | 0 .../performance/optimization.md | 0 .../{ => advanced-reference}/setup/_index.md | 0 .../setup/initial-configuration.md | 0 .../setup/installation.md | 0 .../setup/permissions.md | 0 .../setup/settings.md | 0 .../setup/troubleshooting.md | 0 .../troubleshooting/_index.md | 0 .../troubleshooting/faq.md | 0 .../troubleshooting/troubleshooting.md | 0 .../{action-types => core-actions}/_index.md | 0 content/en/core-actions/check.md | 49 ++++++++++++ content/en/core-actions/notify-action.md | 52 ++++++++++++ .../{action-types => core-actions}/process.md | 0 content/en/core-actions/query-records.md | 50 ++++++++++++ content/en/core-actions/repeat.md | 36 +++++++++ content/en/core-actions/set-value.md | 53 ++++++++++++ content/en/core-actions/start.md | 31 +++++++ .../stop-error.md | 0 .../sub-rule.md | 0 .../{action-types => core-actions}/switch.md | 0 content/en/core-actions/update-record.md | 51 ++++++++++++ .../en/{action-types => core-actions}/wait.md | 0 content/en/getting-started/_index.md | 22 ++++- .../architecture.md | 0 .../better-than-hard-coded.md | 0 .../core-concepts.md | 0 .../do-i-need-flexirule.md | 0 .../erpnext-need.md | 0 content/en/getting-started/introduction.md | 28 +++++++ .../key-capabilities.md | 0 .../performance.md | 0 .../why-flexirule.md | 0 content/en/introduction/_index.md | 21 ----- content/en/introduction/what-is-flexirule.md | 34 -------- content/en/rule-builder/_index.md | 5 -- .../rule-builder/adding-managing-actions.md | 38 --------- content/en/rule-builder/canvas-navigation.md | 47 ----------- content/en/using-the-builder/_index.md | 9 +++ .../adding-managing-actions.md | 38 +++++++++ .../en/using-the-builder/canvas-navigation.md | 40 ++++++++++ .../lifecycle-execution.md | 0 .../tutorials/_index.md | 0 .../tutorials/automatic-assignment.md | 0 .../tutorials/manager-approval.md | 0 .../tutorials/send-email-sales-order.md | 0 133 files changed, 512 insertions(+), 734 deletions(-) delete mode 100644 content/en/action-types/assignment.md delete mode 100644 content/en/action-types/condition.md delete mode 100644 content/en/action-types/entry-action.md delete mode 100644 content/en/action-types/loop.md delete mode 100644 content/en/action-types/notify/_index.md delete mode 100644 content/en/action-types/notify/email.md delete mode 100644 content/en/action-types/query-records/_index.md delete mode 100644 content/en/action-types/query-records/query-doc.md delete mode 100644 content/en/action-types/query-records/query-list.md delete mode 100644 content/en/action-types/update-record/_index.md delete mode 100644 content/en/action-types/update-record/create-new.md delete mode 100644 content/en/action-types/update-record/update-existing.md create mode 100644 content/en/advanced-reference/_index.md rename content/en/{ => advanced-reference}/advanced-concepts/_index.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/ai-features.md (91%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/_index.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/actions/_index.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/actions/condition.md (95%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/actions/document-action.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/actions/entry.md (96%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/actions/loop.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/actions/notify.md (96%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/actions/query-records.md (96%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/actions/stop.md (88%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/contracts/_index.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/engine/_index.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/engine/action-implementation.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/engine/condition-system.md (99%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/engine/execution-engine.md (92%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/engine/orchestration.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/internals/_index.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/overview.md (89%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/resolver/_index.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/resolver/resolver-patterns.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/runtime/_index.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/runtime/execution-context.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/runtime/graph-orchestration.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/runtime/overview.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/ui/_index.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/ui/action-config-panels.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/ui/component-registry.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/ui/controls.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/ui/dynamic-forms.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/architecture/ui/overview.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/data-manipulation/_index.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/data-manipulation/normalization-value-resolver.md (97%) rename content/en/{ => advanced-reference}/advanced-concepts/decision-trees.md (92%) rename content/en/{ => advanced-reference}/advanced-concepts/reference/_index.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/reference/ai/_index.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/reference/ai/action-metadata-schema.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/reference/doctypes.md (85%) rename content/en/{ => advanced-reference}/advanced-concepts/reference/execution/_index.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/reference/execution/condition.md (94%) rename content/en/{ => advanced-reference}/advanced-concepts/reference/execution/document-action.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/reference/execution/entry.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/reference/execution/loop.md (96%) rename content/en/{ => advanced-reference}/advanced-concepts/reference/execution/notify.md (95%) rename content/en/{ => advanced-reference}/advanced-concepts/reference/execution/query-records.md (94%) rename content/en/{ => advanced-reference}/advanced-concepts/reference/execution/stop.md (88%) rename content/en/{ => advanced-reference}/advanced-concepts/reference/glossary.md (88%) rename content/en/{ => advanced-reference}/advanced-concepts/reference/localized/_index.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/reference/localized/arabic-overview.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/reference/query-filters/index.md (94%) rename content/en/{ => advanced-reference}/advanced-concepts/reference/terminology.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/reference/timespan-keywords/index.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/registry-contracts.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/roadmap/_index.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/roadmap/assignment-action-improvements.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/roadmap/documentation-standardization.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/roadmap/event-driven-architecture.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/roadmap/platform-potential.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/roadmap/runtime-optimization.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/rule-entry-condition-vs-condition-action.md (96%) rename content/en/{ => advanced-reference}/advanced-concepts/system-philosophy.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/triggers/_index.md (92%) rename content/en/{ => advanced-reference}/advanced-concepts/triggers/callable-triggers.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/triggers/context-reference.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/triggers/engine-details.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/triggers/event-triggers.md (100%) rename content/en/{ => advanced-reference}/advanced-concepts/triggers/scheduler-triggers.md (100%) rename content/en/{ => advanced-reference}/api-reference/_index.md (100%) rename content/en/{ => advanced-reference}/api-reference/contracts.md (100%) rename content/en/{ => advanced-reference}/api-reference/hooks.md (100%) rename content/en/{ => advanced-reference}/api-reference/public-apis.md (100%) rename content/en/{ => advanced-reference}/developer-guide/_index.md (100%) rename content/en/{ => advanced-reference}/performance/_index.md (100%) rename content/en/{ => advanced-reference}/performance/architecture.md (100%) rename content/en/{ => advanced-reference}/performance/optimization.md (100%) rename content/en/{ => advanced-reference}/setup/_index.md (100%) rename content/en/{ => advanced-reference}/setup/initial-configuration.md (100%) rename content/en/{ => advanced-reference}/setup/installation.md (100%) rename content/en/{ => advanced-reference}/setup/permissions.md (100%) rename content/en/{ => advanced-reference}/setup/settings.md (100%) rename content/en/{ => advanced-reference}/setup/troubleshooting.md (100%) rename content/en/{ => advanced-reference}/troubleshooting/_index.md (100%) rename content/en/{ => advanced-reference}/troubleshooting/faq.md (100%) rename content/en/{ => advanced-reference}/troubleshooting/troubleshooting.md (100%) rename content/en/{action-types => core-actions}/_index.md (100%) create mode 100644 content/en/core-actions/check.md create mode 100644 content/en/core-actions/notify-action.md rename content/en/{action-types => core-actions}/process.md (100%) create mode 100644 content/en/core-actions/query-records.md create mode 100644 content/en/core-actions/repeat.md create mode 100644 content/en/core-actions/set-value.md create mode 100644 content/en/core-actions/start.md rename content/en/{action-types => core-actions}/stop-error.md (100%) rename content/en/{action-types => core-actions}/sub-rule.md (100%) rename content/en/{action-types => core-actions}/switch.md (100%) create mode 100644 content/en/core-actions/update-record.md rename content/en/{action-types => core-actions}/wait.md (100%) rename content/en/{introduction => getting-started}/architecture.md (100%) rename content/en/{introduction => getting-started}/better-than-hard-coded.md (100%) rename content/en/{introduction => getting-started}/core-concepts.md (100%) rename content/en/{introduction => getting-started}/do-i-need-flexirule.md (100%) rename content/en/{introduction => getting-started}/erpnext-need.md (100%) create mode 100644 content/en/getting-started/introduction.md rename content/en/{introduction => getting-started}/key-capabilities.md (100%) rename content/en/{introduction => getting-started}/performance.md (100%) rename content/en/{introduction => getting-started}/why-flexirule.md (100%) delete mode 100644 content/en/introduction/_index.md delete mode 100644 content/en/introduction/what-is-flexirule.md delete mode 100644 content/en/rule-builder/_index.md delete mode 100644 content/en/rule-builder/adding-managing-actions.md delete mode 100644 content/en/rule-builder/canvas-navigation.md create mode 100644 content/en/using-the-builder/_index.md create mode 100644 content/en/using-the-builder/adding-managing-actions.md create mode 100644 content/en/using-the-builder/canvas-navigation.md rename content/en/{rule-builder => using-the-builder}/lifecycle-execution.md (100%) rename content/en/{ => using-the-builder}/tutorials/_index.md (100%) rename content/en/{ => using-the-builder}/tutorials/automatic-assignment.md (100%) rename content/en/{ => using-the-builder}/tutorials/manager-approval.md (100%) rename content/en/{ => using-the-builder}/tutorials/send-email-sales-order.md (100%) diff --git a/content/en/action-types/assignment.md b/content/en/action-types/assignment.md deleted file mode 100644 index 8ee46a9..0000000 --- a/content/en/action-types/assignment.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: Assignment -description: Perform sequential batch state mutations on document fields and context variables. -weight: 50 -entity_kind: action_operation -category: data-operations -mutation: true -targets: ["Frappe DocType", "Context Variable"] ---- - -# Assignment Action - -The **Assignment** action (formerly *Set Value*) is the primary mechanism for state mutation in FlexiRule. It allows you to define a sequence of mutations—**Batch Assignments**—that are executed in order to update document fields or manage internal rule state. - -## Purpose - -Use the Assignment action when you need to: -- Update fields on the triggering document (e.g., change `status` to "Approved"). -- Initialize or update context variables (`vars`) to store intermediate calculation results. -- Perform mathematical operations (Increment, Decrement) on numeric fields. -- Manage collections (Append to lists, Merge dictionaries). - -## Action Capabilities - -| Capability | Support | Notes | -| :--- | :--- | :--- | -| **Batch Execution** | ✅ Yes | Execute multiple assignments in a single node. | -| **Conditional Rows** | ✅ Yes | Each assignment row can have its own `when` condition. | -| **Multi-Operator** | ✅ Yes | Supports Set, Clear, Increment, Decrement, Append, Merge, and Toggle. | -| **Data Normalization**| ✅ Yes | Integrated pipelines for cleaning and transforming data. | -| **Value Resolution** | ✅ Yes | Unified resolver for static values, formulas, and complex lookups. | - -## Configuration - -The Assignment action uses a grid-based interface where each row represents one mutation. - -### 1. Target Path -Defines where the value will be stored. -- `doc.field_name`: Updates a field on the current document. -- `vars.variable_name`: Sets a temporary variable available for the rest of the rule execution. - -### 2. Operator -Defines *how* the value is applied: -- **Set**: Replaces the current value with the new value. -- **Clear**: Removes the value (sets to `None` or empty). -- **Increment / Decrement**: Adds or subtracts from the current numeric value. -- **Append**: Adds a value to the end of a list/array. -- **Merge**: Merges a dictionary into the target dictionary. -- **Toggle**: Swaps a boolean value between `true` and `false`. - -### 3. Value -The new value or operand. This can be: -- **Static Value**: A hardcoded string, number, or date. -- **Variable Path**: A reference to another field (e.g., `doc.base_amount`). -- **Formula**: A Python-based expression for calculations. -- **Data Pipeline**: A sequence of normalization steps (e.g., Trim → Uppercase). - -### 4. Condition (When) -An optional expression that must evaluate to `true` for this specific assignment to run. This allows for complex "If-Else" logic within a single Assignment block. - -## Best Practices - -- **Use Variables for Clarity**: Instead of repeating a complex formula in multiple nodes, calculate it once and store it in a `vars.total_price` variable. -- **Sequential Logic**: Remember that assignments run from top to bottom. If row 2 depends on the result of row 1, it will work correctly. -- **Event Awareness**: FlexiRule prevents you from mutating `doc.*` fields during "After Save" or "On Submit" events to prevent database inconsistencies. Use "Before Save" for field updates. - -## Common Mistakes - -- **Incorrect Path**: Forgetting the `doc.` or `vars.` prefix. `status` will fail; `doc.status` will succeed. -- **Type Mismatch**: Trying to `Increment` a text field or `Append` to a number. -- **Infinite Loops**: Setting a field that triggers the same rule again (though FlexiRule has built-in cycle detection to catch this). diff --git a/content/en/action-types/condition.md b/content/en/action-types/condition.md deleted file mode 100644 index 23aa98b..0000000 --- a/content/en/action-types/condition.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: Condition -description: Evaluate complex logic gates to determine the execution path. -weight: 40 -entity_kind: action_operation -category: logic-control -mutation: false -targets: ["Frappe DocType", "Context Variable"] ---- - -# Condition Action (Check) - -The **Condition** action (referred to as **Check** in user-first documentation) is the primary decision-making node in FlexiRule. it evaluates one or more logical expressions and directs the flow to either the **True** (Success) or **False** (Failure) branch. - -## Purpose - -Use the Condition action to: -- Validate data before proceeding (e.g., "Is the Sales Order date in the future?"). -- Branch logic based on field values (e.g., "If Category is 'Electronics', go to Step A, else go to Step B"). -- Evaluate complex business rules involving multiple fields and child tables. - -## Action Capabilities - -| Capability | Support | Notes | -| :--- | :--- | :--- | -| **Nested Groups** | ✅ Yes | Support for recursive AND/OR logic groups. | -| **Collection Logic**| ✅ Yes | Check if **Any**, **All**, or **None** of the rows in a child table meet a criteria. | -| **Fast Execution** | ✅ Yes | Conditions are pre-compiled into optimized Python strings. | -| **Cross-Context** | ✅ Yes | Compare `doc` fields against `vars`, `session` user, or global constants. | - -## Configuration - -### 1. Condition Groups -Conditions are organized into groups. Each group has a logical operator: -- **ALL (AND)**: Every condition in the group must be true. -- **ANY (OR)**: At least one condition in the group must be true. -- **NONE (NOT)**: No conditions in the group can be true. - -### 2. Simple Conditions -A simple condition consists of: -- **Field/Subject**: The value being checked (e.g., `doc.status`). -- **Operator**: The comparison logic (e.g., `Equals`, `Contains`, `Is Set`, `Matches Regex`). -- **Value/Object**: The criteria to check against. - -### 3. Collection Evaluations (New in V2) -You can now evaluate child tables (collections) directly: -- **Target**: A child table field (e.g., `doc.items`). -- **Evaluation**: "At least one row matches", "Every row matches", "No rows match". -- **Criteria**: A nested set of conditions applied to each row in the collection. - -## Execution Semantics - -1. **Evaluation**: The engine evaluates the compiled expression against the current context. -2. **Branching**: - - If `True`: The engine follows the connection labeled **True** (next_step_if_true). - - If `False`: The engine follows the connection labeled **False** (next_step_if_false). -3. **Default Behavior**: If a branch is not connected, the rule execution finishes successfully at that node. - -## Best Practices - -- **Flatten Logic**: While FlexiRule supports deeply nested groups, keeping conditions shallow makes them easier for others to read. -- **Check for "Set"**: Before comparing a field value, use the "Is Set" operator if the field might be empty, to avoid unexpected results. -- **Visual Feedback**: During a Test Run, FlexiRule highlights the path taken, allowing you to see exactly why a condition evaluated the way it did. - -## Common Mistakes - -- **Comparing Strings and Numbers**: Ensure the types match. Comparing a string "100" to a number 100 might fail depending on the operator. -- **Empty Groups**: An empty "ALL" group typically evaluates to `True`, while an empty "ANY" group evaluates to `False`. diff --git a/content/en/action-types/entry-action.md b/content/en/action-types/entry-action.md deleted file mode 100644 index 6a78668..0000000 --- a/content/en/action-types/entry-action.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: Entry Action -description: The starting point of every business rule. -weight: 5 -aliases: - - /docs/actions/entry/ ---- - -# Entry Action - -Every business rule starts with an **Entry Action**. This node represents the document and data that triggered the rule. - -## What is the Entry Action? -Think of the Entry Action as the "input" for your logic. It contains the `doc` (the record that triggered the rule) and makes it available to all following steps. - -## Rule Entry Conditions -You can configure "Entry Conditions" directly on the Rule header. These act as a gatekeeper: if the condition isn't met, the rule won't even start. - -**Note**: For branching logic *after* the rule has already started, use the [Condition Action]({{< relref "condition" >}}). diff --git a/content/en/action-types/loop.md b/content/en/action-types/loop.md deleted file mode 100644 index e71cbff..0000000 --- a/content/en/action-types/loop.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: Loop -description: Repeat a sequence of actions for each item in a list. -weight: 60 -aliases: - - /docs/actions/loop/ ---- - -# Loop Action - -The **Loop** action allows you to repeat a series of steps for multiple items. This is essential when you have a list of records (like those from a **Query Records** action) and need to perform the same task for each one. - -## How it Works - -1. **Input List**: Select the list of items you want to process. -2. **Loop Flow**: Any actions connected to the loop's output will be executed once for every item in the list. -3. **Current Item**: Inside the loop, you can access the specific item currently being processed. - -## Example -**Scenario**: Send a notification for every overdue invoice found. -1. **Query Records**: Find all "Invoices" where `status` is "Overdue". -2. **Loop**: Connect the results to a Loop node. -3. **Notify**: Inside the loop, use the **Notify** action. It will run for each individual invoice. - -## Best Practices -- **Efficiency**: Only loop over the items you need. Use filters in your query to keep the list small. -- **Complexity**: If your loop logic gets too complex, consider using a **Sub-rule**. diff --git a/content/en/action-types/notify/_index.md b/content/en/action-types/notify/_index.md deleted file mode 100644 index 2277f81..0000000 --- a/content/en/action-types/notify/_index.md +++ /dev/null @@ -1,74 +0,0 @@ ---- -title: Notify -description: Communication engine for emails, system alerts, and real-time UI messaging. -weight: 20 -entity_kind: action_operation -category: communication -mutation: false -targets: ["User", "Email", "System Notification"] ---- - -# Notify Action - -The **Notify** action is FlexiRule's multi-channel communication node. It allows you to send information to users via various protocols, from simple browser alerts to formatted HTML emails and external service providers. - -## Purpose - -Use the Notify action to: -- Alert users of important events (e.g., "High-value order submitted"). -- Send automated confirmations to customers. -- Create internal "ToDo" style notifications in the Frappe Desk. -- Provide real-time feedback to the user currently interacting with the system. - -## Action Capabilities - -| Capability | Support | Notes | -| :--- | :--- | :--- | -| **Multi-Channel** | ✅ Yes | Email, System Notification, Toast, Real-time, and custom Providers. | -| **Jinja Templates** | ✅ Yes | Full support for Jinja2 in messages, subjects, and recipient fields. | -| **Dynamic Attachments**| ✅ Yes | Automatically attach a PDF version of the triggering document. | -| **Custom Providers** | ✅ Yes | Extendable via hooks for SMS, Slack, WhatsApp, etc. | - -## Notification Modes - -### 1. Email -Sends a standard email via Frappe's email queue. -- **Recipients**: Can be a list of emails or dynamic paths (e.g., `doc.contact_email`). -- **Subject/Message**: Supports Jinja templates with access to `doc` and `vars`. -- **Attach PDF**: Generates and attaches the PDF version of the triggering document. - -### 2. System Notification -Creates a record in the **Notification Log** Doctype. -- These appear in the notification bell icon in the Frappe Desk. -- Best for internal alerts that require a permanent record. - -### 3. UI Toast -Displays a temporary "alert" popup in the user's browser. -- **Note**: This only works for synchronous rules triggered by user actions. It has no effect for background jobs or scheduled rules. - -### 4. Real-time (System) -Publishes a message to the user's current session via Socket.io. -- Useful for non-intrusive background updates while the user is working. - -### 5. Provider -Dispatches the notification to a custom-defined provider (e.g., a Slack integration). -- Providers are registered via the `flexirule_notification_providers` hook in custom apps. - -## Configuration - -The Notify action configuration changes based on the selected **Mode**. - -- **Subject**: (Email/System) The title of the notification. -- **Message**: The body of the notification. Supports HTML and Jinja. -- **Recipients/For User**: Who receives the message. Supports logic expressions. - -## Best Practices - -- **Avoid Spam**: Use **Condition** nodes before Notify actions to ensure notifications only go out when truly necessary. -- **Traceability**: FlexiRule automatically appends a link to the "Source Rule" at the bottom of notifications to help administrators find the logic responsible for the message. -- **Use Variables**: If you need to include calculated data, use an **Assignment** node to store it in a variable first, then reference it in your message via `{{ vars.my_variable }}`. - -## Common Mistakes - -- **Invalid Recipients**: Ensure the recipient field evaluates to a valid email address or user ID. -- **Jinja Syntax Errors**: A typo in `{{ doc.field_name }}` will cause the notification to fail. Use the **Test Run** feature to verify your templates. diff --git a/content/en/action-types/notify/email.md b/content/en/action-types/notify/email.md deleted file mode 100644 index 3f62841..0000000 --- a/content/en/action-types/notify/email.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: Email -description: Sending automated emails with attachments and dynamic templates. -weight: 10 ---- - -# Email Notification - -The **Email** mode of the Notify action is the most common way to send information to customers and external stakeholders. - -## Configuration - -### 1. Recipients -You can specify recipients in three ways: -- **Static**: Enter a single email or a comma-separated list. -- **Dynamic Variable**: Use `{{ doc.contact_email }}` or `{{ vars.manager_email }}`. -- **User Link**: Select a User Link field from your DocType. - -### 2. Subject and Message -Both fields support **Jinja2** templates. -- **Example Subject**: `Order Confirmation: {{ doc.name }}` -- **Example Message**: - ```html - Dear {{ doc.customer }},
- Your order placed on {{ doc.posting_date }} has been received. - ``` - -### 3. Attachments -- **Attach PDF**: Generates a PDF of the triggering document using its default print format and attaches it to the email. - -## Execution Behavior -Emails are added to the **Email Queue** in Frappe. They are not sent instantly by the web server but are picked up by the background worker (usually every minute). diff --git a/content/en/action-types/query-records/_index.md b/content/en/action-types/query-records/_index.md deleted file mode 100644 index 825b33e..0000000 --- a/content/en/action-types/query-records/_index.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: Query Records -description: Retrieve data from the system using filters and aggregations. -weight: 10 -entity_kind: action_operation -category: data-operations -mutation: false -targets: ["Frappe DocType"] ---- - -# Query Records Action - -The **Query Records** action is the data retrieval engine of FlexiRule. It allows you to fetch information from any DocType in the database, enabling logic that depends on records other than the one currently being processed. - -## Purpose - -Use the Query Records action when you need to: -- **Validate**: Check if a duplicate record exists before allowing a save. -- **Enrich**: Fetch a Customer's credit limit or a Supplier's lead time to use in calculations. -- **Aggregate**: Calculate the total value of all unpaid invoices for a specific customer. -- **Automate**: Find all overdue tasks and loop through them to send reminders. - -## Action Capabilities - -| Capability | Support | Notes | -| :--- | :--- | :--- | -| **Multi-Mode** | ✅ Yes | Query List, Query Doc, Count, Sum, Average, Min, Max, Exist. | -| **Dynamic Filters** | ✅ Yes | Filter data using fields from the current context (`doc`, `vars`). | -| **Date Formulas** | ✅ Yes | Built-in support for "Last 30 Days", "Current Month", etc. | -| **Schema Refresh** | ✅ Yes | Automatically detects and maps resulting fields for use in later nodes. | -| **Cached Lookups** | ✅ Yes | Support for `use_cached_doc` to improve performance. | - -## Query Modes - -### 1. Query Doc -Retrieves a single record based on filters. Returns an **Object (Dictionary)**. -- **Best For**: Getting the full details of a specific master record (e.g., Sales Person info). - -### 2. Query List -Retrieves multiple records. Returns a **List of Objects**. -- **Best For**: Finding all child records or multiple related documents to use in a **Loop**. - -### 3. Aggregations (Count, Sum, Avg, etc.) -Performs a calculation on the database side and returns a **Number**. -- **Example**: `Sum` of `base_grand_total` where `customer = doc.customer`. - -### 4. Exist Record -A lightweight check that returns **True** if at least one matching record exists, otherwise **False**. - -## Configuration - -### Filters -Filters are the heart of the query. You can combine multiple criteria using AND/OR logic: -- **Field Comparison**: `status` Equals `Open`. -- **Dynamic Context**: `customer` Equals `{{ doc.customer }}`. -- **Date Range**: `posting_date` is `Within` `Last 30 Days`. - -### Field Selection -To optimize performance, you can specify exactly which fields you want to retrieve instead of fetching the whole document. - -## Best Practices - -- **Limit Your Results**: If you only need one record, use `Query Doc` or set a `Limit` of 1 in `Query List`. -- **Use "Exist" for Speed**: If you only need to know if a record is there (e.g., checking for duplicates), `Exist Record` is much faster than `Query List`. -- **Refresh Schema**: Always click **Refresh Schema** after updating your query. This tells the Rule Builder which fields are available so you can select them from the autocomplete in later steps. - -## Common Mistakes - -- **Heavy Queries**: Querying a large DocType (like Stock Ledger) without enough filters can slow down your system. -- **Mode Confusion**: Using `Query List` but expecting an Object. Remember that a list requires a **Loop** node to access individual field values. diff --git a/content/en/action-types/query-records/query-doc.md b/content/en/action-types/query-records/query-doc.md deleted file mode 100644 index 263e539..0000000 --- a/content/en/action-types/query-records/query-doc.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: Query Doc -description: Retrieving a single record for data enrichment. -weight: 10 ---- - -# Query Doc - -Use **Query Doc** when you need to fetch specific details from a single record in the system. - -## How it Works -1. **Filters**: You provide filters to identify the unique record (e.g., `name` = `doc.customer`). -2. **Result**: FlexiRule fetches the record and returns it as a single **Object**. -3. **Availability**: All fields of that record are now available in the `vars` of your rule (if you assigned a return variable). - -## Example -**Scenario**: You want to get the "Credit Limit" of a Customer while saving a Sales Order. -- **DocType**: `Customer` -- **Filters**: `name` Equals `{{ doc.customer }}` -- **Return Variable**: `customer_info` - -In the next node, you can use `{{ vars.customer_info.credit_limit }}` in a calculation or condition. - -## Performance Note -If you only need one or two fields, it is more efficient to specify those fields in the "Fields" configuration rather than fetching the whole document. diff --git a/content/en/action-types/query-records/query-list.md b/content/en/action-types/query-records/query-list.md deleted file mode 100644 index 42c2f70..0000000 --- a/content/en/action-types/query-records/query-list.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: Query List -description: Finding multiple records for bulk processing or loops. -weight: 20 ---- - -# Query List - -**Query List** is used when you expect to find multiple records. - -## How it Works -1. **Filters**: Define criteria to find a set of records. -2. **Result**: Returns a **List (Array)** of objects. -3. **Looping**: Because the result is a list, you typically connect this node to a **Loop** node to perform actions on each individual record found. - -## Example -**Scenario**: Find all "Overdue" Tasks for a Project. -- **DocType**: `Task` -- **Filters**: `project` = `doc.name` AND `status` = `Overdue`. -- **Return Variable**: `overdue_tasks`. - -You can then loop over `vars.overdue_tasks` to send a reminder for each one. diff --git a/content/en/action-types/update-record/_index.md b/content/en/action-types/update-record/_index.md deleted file mode 100644 index af156a0..0000000 --- a/content/en/action-types/update-record/_index.md +++ /dev/null @@ -1,80 +0,0 @@ ---- -title: Update Record -description: Create, Update, or Delete documents in ERPNext and custom Frappe apps. -weight: 30 -entity_kind: action_operation -category: data-operations -mutation: true -targets: ["Frappe DocType"] ---- - -# Update Record Action - -The **Update Record** action (internally known as **Document Action**) is used to perform CRUD operations on any DocType in the system. It is the bridge between rule logic and persistent data changes. - -## Purpose - -Use the Update Record action when you need to: -- **Create New**: Generate a new document (e.g., Create a *Sales Order* from a *Quotation*). -- **Update Existing**: Modify a specific record (e.g., Update a *Project* status when a *Task* is completed). -- **Delete Record**: Remove a document from the system. -- **Add Comment**: Post a message to the document timeline. -- **Create ToDo**: Assign a task to a user based on rule logic. - -## Action Capabilities - -| Capability | Support | Notes | -| :--- | :--- | :--- | -| **Field Mapping** | ✅ Yes | Map values from the current rule context to the target document. | -| **Table Mapping** | ✅ Yes | Bulk-populate child tables from source collections. | -| **Same-Field Copy** | ✅ Yes | Automatically copy fields with matching names (Frappe Mapper style). | -| **Async Support** | ✅ Yes | Offload document creation to background workers. | -| **Permission Bypass**| ✅ Yes | Option to `ignore_permissions` with mandatory audit reason. | - -## Configuration Modes - -### 1. Create New -Generates a fresh document. -- **Reference DocType**: The type of document to create. -- **Field Mappings**: Define which fields to populate. -- **Static Values**: Fixed values that never change. -- **Table Mappings**: Logic for copying child table rows (e.g., Quotation Items to Sales Order Items). - -### 2. Update Existing -Modifies an existing record. -- **Document Name**: Can be a fixed name or a dynamic expression (e.g., `doc.customer_project`). -- **Mappings**: Only the mapped fields will be updated; others remain unchanged. - -### 3. Delete Record -Removes a record based on name and DocType. Requires explicit permission or an audit-logged bypass. - -### 4. Specialized Modes -- **Create ToDo**: Simplified UI for assigning Frappe ToDos. -- **Add Comment**: Appends a comment to the timeline of the triggering document. - -## Field and Table Mapping - -Mappings are the heart of the Update Record action. They define the data flow: - -**Field Mapping Example:** -- Target: `customer` ← Source: `doc.customer_name` -- Target: `status` ← Source: `"Open"` (Static) - -**Table Mapping Example:** -- Target Table: `items` -- Source Collection: `doc.items` -- Condition: `item.qty > 0` -- Row Mapping: - - `item_code` ← `item.item_code` - - `qty` ← `item.qty` - -## Best Practices - -- **Use Async for Heavy Tasks**: If creating a document involves complex controller logic or many child rows, enable **Run Asynchronously** to keep the user interface responsive. -- **Transactional Safety**: Document actions are part of the rule transaction. If the rule fails later, the document creation/update will be rolled back (unless executed asynchronously). -- **Audit Reasons**: Always provide a clear reason when using "Skip Permissions" for compliance and debugging. - -## Common Mistakes - -- **Circular Updates**: Updating the *same* document that triggered the rule in an "On Save" event. This can cause recursion. Use **Assignment** for updates to the triggering document instead. -- **Missing Required Fields**: Ensure all mandatory fields of the target DocType are either mapped or have default values. diff --git a/content/en/action-types/update-record/create-new.md b/content/en/action-types/update-record/create-new.md deleted file mode 100644 index 33f05b3..0000000 --- a/content/en/action-types/update-record/create-new.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: Create New -description: Generating new documents automatically via rule logic. -weight: 10 ---- - -# Create New Record - -This mode allows FlexiRule to generate brand-new records in any DocType. - -## Field Mappings -You define how the new document's fields should be populated: -- **Source**: Where the data comes from (`doc.field`, `vars.variable`, or a static `'String'`). -- **Target**: The fieldname on the *new* document. - -## Table Mappings (Child Tables) -You can also populate child tables (like Items in a Sales Order). -- **Source Collection**: A list of items (e.g., `doc.items`). -- **Row Mapping**: Define how each row in the source list maps to a row in the new document's child table. - -## Example -**Scenario**: Automatically create a "Project" when a "Sales Order" is submitted. -1. **Target DocType**: `Project`. -2. **Field Mapping**: - - `project_name` ← `doc.name` - - `customer` ← `doc.customer` -3. **Condition**: Only if `doc.order_type` is "Project-Based". diff --git a/content/en/action-types/update-record/update-existing.md b/content/en/action-types/update-record/update-existing.md deleted file mode 100644 index 571357c..0000000 --- a/content/en/action-types/update-record/update-existing.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: Update Existing -description: Modifying specific records in the system. -weight: 20 ---- - -# Update Existing Record - -Use this mode to change fields on a document that already exists in the database. - -## Identifying the Document -You must tell FlexiRule *which* record to update: -- **Document Name**: A fixed name (e.g., `PROJ-001`). -- **Dynamic Expression**: A path to the name (e.g., `doc.linked_project`). - -## Partial Updates -Unlike "Create New", you only need to map the fields you want to **change**. All other fields on the existing record will remain exactly as they are. - -## Example -**Scenario**: When a "Task" is completed, update its parent "Project" status. -1. **Target DocType**: `Project`. -2. **Document Name**: `doc.project`. -3. **Field Mapping**: - - `status` ← `'In Progress'` diff --git a/content/en/advanced-reference/_index.md b/content/en/advanced-reference/_index.md new file mode 100644 index 0000000..cfc740b --- /dev/null +++ b/content/en/advanced-reference/_index.md @@ -0,0 +1,9 @@ +--- +title: Advanced Reference +description: Technical architecture, API references, and deep-dive system details. +weight: 100 +--- + +# Advanced Reference + +This section contains technical documentation intended for developers and system administrators. diff --git a/content/en/advanced-concepts/_index.md b/content/en/advanced-reference/advanced-concepts/_index.md similarity index 100% rename from content/en/advanced-concepts/_index.md rename to content/en/advanced-reference/advanced-concepts/_index.md diff --git a/content/en/advanced-concepts/ai-features.md b/content/en/advanced-reference/advanced-concepts/ai-features.md similarity index 91% rename from content/en/advanced-concepts/ai-features.md rename to content/en/advanced-reference/advanced-concepts/ai-features.md index 0320b8d..c66aadd 100644 --- a/content/en/advanced-concepts/ai-features.md +++ b/content/en/advanced-reference/advanced-concepts/ai-features.md @@ -93,6 +93,6 @@ sequenceDiagram ## Related Topics -- [Execution Engine]({{< relref "advanced-concepts/architecture/engine/execution-engine.md" >}}) -- [Variables]({{< relref "action-types/assignment#context-variables-vars" >}}) -- [Condition Builder]({{< relref "action-types/condition.md" >}}) +- [Execution Engine]({{< relref "advanced-reference/advanced-concepts/architecture/engine/execution-engine.md" >}}) +- [Variables]({{< relref "core-actions/set-value.md#context-variables-vars" >}}) +- [Condition Builder]({{< relref "core-actions/check.md" >}}) diff --git a/content/en/advanced-concepts/architecture/_index.md b/content/en/advanced-reference/advanced-concepts/architecture/_index.md similarity index 100% rename from content/en/advanced-concepts/architecture/_index.md rename to content/en/advanced-reference/advanced-concepts/architecture/_index.md diff --git a/content/en/advanced-concepts/architecture/actions/_index.md b/content/en/advanced-reference/advanced-concepts/architecture/actions/_index.md similarity index 100% rename from content/en/advanced-concepts/architecture/actions/_index.md rename to content/en/advanced-reference/advanced-concepts/architecture/actions/_index.md diff --git a/content/en/advanced-concepts/architecture/actions/condition.md b/content/en/advanced-reference/advanced-concepts/architecture/actions/condition.md similarity index 95% rename from content/en/advanced-concepts/architecture/actions/condition.md rename to content/en/advanced-reference/advanced-concepts/architecture/actions/condition.md index ec5337c..dc95737 100644 --- a/content/en/advanced-concepts/architecture/actions/condition.md +++ b/content/en/advanced-reference/advanced-concepts/architecture/actions/condition.md @@ -70,5 +70,5 @@ New operators can be added to the frontend `SimpleCondition.vue` component. Sinc - **Field Resolver**: `flexirule/ruleflow/utils/field_resolver.py` (Handles nested dot-notation) ## Related Topics -- [Action Documentation]({{< relref "action-types/condition.md" >}}) -- [Execution Semantics]({{< relref "advanced-concepts/reference/execution/condition.md" >}}) +- [Action Documentation]({{< relref "core-actions/check.md" >}}) +- [Execution Semantics]({{< relref "advanced-reference/advanced-concepts/reference/execution/condition.md" >}}) diff --git a/content/en/advanced-concepts/architecture/actions/document-action.md b/content/en/advanced-reference/advanced-concepts/architecture/actions/document-action.md similarity index 100% rename from content/en/advanced-concepts/architecture/actions/document-action.md rename to content/en/advanced-reference/advanced-concepts/architecture/actions/document-action.md diff --git a/content/en/advanced-concepts/architecture/actions/entry.md b/content/en/advanced-reference/advanced-concepts/architecture/actions/entry.md similarity index 96% rename from content/en/advanced-concepts/architecture/actions/entry.md rename to content/en/advanced-reference/advanced-concepts/architecture/actions/entry.md index 476c89d..4aa9b10 100644 --- a/content/en/advanced-concepts/architecture/actions/entry.md +++ b/content/en/advanced-reference/advanced-concepts/architecture/actions/entry.md @@ -47,7 +47,7 @@ The Entry Action uses **Implicit Initialization**. It does not perform explicit ## Extension Points The Entry Action is considered a "Closed Core" component. Developers should not override the `EntryActionHandler` as it would break the fundamental graph-traversal guarantees of the engine. -If customization is needed for "initialization" logic, it is recommended to use an [Assignment]({{< relref "action-types/assignment" >}}) node immediately following the Entry Action. +If customization is needed for "initialization" logic, it is recommended to use an [Assignment]({{< relref "core-actions/set-value.md" >}}) node immediately following the Entry Action. ## Internal Events - **`rule_execution_start`**: Fired by the `RuleEngine` immediately before the Entry Action is processed. diff --git a/content/en/advanced-concepts/architecture/actions/loop.md b/content/en/advanced-reference/advanced-concepts/architecture/actions/loop.md similarity index 100% rename from content/en/advanced-concepts/architecture/actions/loop.md rename to content/en/advanced-reference/advanced-concepts/architecture/actions/loop.md diff --git a/content/en/advanced-concepts/architecture/actions/notify.md b/content/en/advanced-reference/advanced-concepts/architecture/actions/notify.md similarity index 96% rename from content/en/advanced-concepts/architecture/actions/notify.md rename to content/en/advanced-reference/advanced-concepts/architecture/actions/notify.md index cb93fa5..f8b36bf 100644 --- a/content/en/advanced-concepts/architecture/actions/notify.md +++ b/content/en/advanced-reference/advanced-concepts/architecture/actions/notify.md @@ -87,8 +87,8 @@ The Notify action is strictly **Read-Only** regarding the Rule Context. It does - **Action Metadata**: `flexirule/ruleflow/core/contracts.py` ## Related Topics -- [Action Documentation]({{< relref "action-types/notify/" >}}) -- [Execution Semantics]({{< relref "advanced-concepts/reference/execution/notify.md" >}}) +- [Action Documentation]({{< relref "core-actions/notify-action.md" >}}) +- [Execution Semantics]({{< relref "advanced-reference/advanced-concepts/reference/execution/notify.md" >}}) ## Performance Considerations - **Synchronous vs. Asynchronous**: While the rule engine executes synchronously, modes like `Email` are effectively asynchronous as they rely on the Frappe Email Queue. diff --git a/content/en/advanced-concepts/architecture/actions/query-records.md b/content/en/advanced-reference/advanced-concepts/architecture/actions/query-records.md similarity index 96% rename from content/en/advanced-concepts/architecture/actions/query-records.md rename to content/en/advanced-reference/advanced-concepts/architecture/actions/query-records.md index 3ea0089..d89b36c 100644 --- a/content/en/advanced-concepts/architecture/actions/query-records.md +++ b/content/en/advanced-reference/advanced-concepts/architecture/actions/query-records.md @@ -33,8 +33,8 @@ The **Query Records** action is implemented as a core Action Handler within the The handler translates UI-level filter definitions into the tuple format expected by `frappe.get_list`. Detailed operator mappings and natural language keyword resolution are shared across the system. -- **Operator Mappings**: See [Query Filters Reference]({{< relref "advanced-concepts/reference/query-filters" >}}). -- **Timespan Resolution**: Handled via `_resolve_timespan_range()`, using the logic defined in [Timespan Keywords]({{< relref "advanced-concepts/reference/timespan-keywords" >}}). +- **Operator Mappings**: See [Query Filters Reference]({{< relref "advanced-reference/advanced-concepts/reference/query-filters" >}}). +- **Timespan Resolution**: Handled via `_resolve_timespan_range()`, using the logic defined in [Timespan Keywords]({{< relref "advanced-reference/advanced-concepts/reference/timespan-keywords" >}}). ### Nested Field Support The architecture supports "dot-notation" for filtering on child table fields and linked documents. The `_doctype_has_field` method recursively validates these references against the DocType metadata at validation time. diff --git a/content/en/advanced-concepts/architecture/actions/stop.md b/content/en/advanced-reference/advanced-concepts/architecture/actions/stop.md similarity index 88% rename from content/en/advanced-concepts/architecture/actions/stop.md rename to content/en/advanced-reference/advanced-concepts/architecture/actions/stop.md index df36c9a..676e5e3 100644 --- a/content/en/advanced-concepts/architecture/actions/stop.md +++ b/content/en/advanced-reference/advanced-concepts/architecture/actions/stop.md @@ -41,5 +41,5 @@ The Stop action is **Read-Only**. It never modifies the context. However, in `Er - **Contract**: `flexirule/ruleflow/core/contracts.py` ## Related Topics -- [Action Documentation]({{< relref "advanced-concepts/architecture/actions/stop.md" >}}) -- [Execution Semantics]({{< relref "advanced-concepts/reference/execution/stop.md" >}}) +- [Action Documentation]({{< relref "advanced-reference/advanced-concepts/architecture/actions/stop.md" >}}) +- [Execution Semantics]({{< relref "advanced-reference/advanced-concepts/reference/execution/stop.md" >}}) diff --git a/content/en/advanced-concepts/architecture/contracts/_index.md b/content/en/advanced-reference/advanced-concepts/architecture/contracts/_index.md similarity index 100% rename from content/en/advanced-concepts/architecture/contracts/_index.md rename to content/en/advanced-reference/advanced-concepts/architecture/contracts/_index.md diff --git a/content/en/advanced-concepts/architecture/engine/_index.md b/content/en/advanced-reference/advanced-concepts/architecture/engine/_index.md similarity index 100% rename from content/en/advanced-concepts/architecture/engine/_index.md rename to content/en/advanced-reference/advanced-concepts/architecture/engine/_index.md diff --git a/content/en/advanced-concepts/architecture/engine/action-implementation.md b/content/en/advanced-reference/advanced-concepts/architecture/engine/action-implementation.md similarity index 100% rename from content/en/advanced-concepts/architecture/engine/action-implementation.md rename to content/en/advanced-reference/advanced-concepts/architecture/engine/action-implementation.md diff --git a/content/en/advanced-concepts/architecture/engine/condition-system.md b/content/en/advanced-reference/advanced-concepts/architecture/engine/condition-system.md similarity index 99% rename from content/en/advanced-concepts/architecture/engine/condition-system.md rename to content/en/advanced-reference/advanced-concepts/architecture/engine/condition-system.md index aa82314..05e693f 100644 --- a/content/en/advanced-concepts/architecture/engine/condition-system.md +++ b/content/en/advanced-reference/advanced-concepts/architecture/engine/condition-system.md @@ -32,7 +32,7 @@ The **Condition Builder** is a recursive Vue 3 interface that allows users to co - **Input**: User interactions (drag-and-drop, field selection, operator picking). - **Output**: A standardized **JSON AST (Abstract Syntax Tree)**. - **Key Files**: `ConditionBuilder.vue`, `ConditionNode.vue`, `SimpleCondition.vue`. -- **Detailed Guide**: [Condition Builder Frontend]({{< relref "action-types/condition.md" >}}) +- **Detailed Guide**: [Condition Builder Frontend]({{< relref "core-actions/check.md" >}}) ### 2. The Condition Compiler (Backend - Save-Time) diff --git a/content/en/advanced-concepts/architecture/engine/execution-engine.md b/content/en/advanced-reference/advanced-concepts/architecture/engine/execution-engine.md similarity index 92% rename from content/en/advanced-concepts/architecture/engine/execution-engine.md rename to content/en/advanced-reference/advanced-concepts/architecture/engine/execution-engine.md index 81c3f3e..ff4052b 100644 --- a/content/en/advanced-concepts/architecture/engine/execution-engine.md +++ b/content/en/advanced-reference/advanced-concepts/architecture/engine/execution-engine.md @@ -105,6 +105,6 @@ Rule conditions and templates are evaluated using `SafeFrappeAPI`, preventing un ## Related Topics -- [Rule Building]({{< relref "rule-builder/canvas-navigation.md" >}}) -- [Glossary]({{< relref "advanced-concepts/reference/glossary.md" >}}) -- [API Reference]({{< relref "api-reference/public-apis.md" >}}) +- [Rule Building]({{< relref "using-the-builder/canvas-navigation.md" >}}) +- [Glossary]({{< relref "advanced-reference/advanced-concepts/reference/glossary.md" >}}) +- [API Reference]({{< relref "advanced-reference/api-reference/public-apis.md" >}}) diff --git a/content/en/advanced-concepts/architecture/engine/orchestration.md b/content/en/advanced-reference/advanced-concepts/architecture/engine/orchestration.md similarity index 100% rename from content/en/advanced-concepts/architecture/engine/orchestration.md rename to content/en/advanced-reference/advanced-concepts/architecture/engine/orchestration.md diff --git a/content/en/advanced-concepts/architecture/internals/_index.md b/content/en/advanced-reference/advanced-concepts/architecture/internals/_index.md similarity index 100% rename from content/en/advanced-concepts/architecture/internals/_index.md rename to content/en/advanced-reference/advanced-concepts/architecture/internals/_index.md diff --git a/content/en/advanced-concepts/architecture/overview.md b/content/en/advanced-reference/advanced-concepts/architecture/overview.md similarity index 89% rename from content/en/advanced-concepts/architecture/overview.md rename to content/en/advanced-reference/advanced-concepts/architecture/overview.md index fcbb036..a242b0a 100644 --- a/content/en/advanced-concepts/architecture/overview.md +++ b/content/en/advanced-reference/advanced-concepts/architecture/overview.md @@ -89,6 +89,6 @@ The system includes a built-in technical audit mechanism to ensure rule integrit ## Related Topics -- [Execution Engine]({{< relref "advanced-concepts/architecture/engine/execution-engine.md" >}}) -- [API Reference]({{< relref "api-reference/public-apis.md" >}}) -- [DocType Reference]({{< relref "advanced-concepts/reference/doctypes.md" >}}) +- [Execution Engine]({{< relref "advanced-reference/advanced-concepts/architecture/engine/execution-engine.md" >}}) +- [API Reference]({{< relref "advanced-reference/api-reference/public-apis.md" >}}) +- [DocType Reference]({{< relref "advanced-reference/advanced-concepts/reference/doctypes.md" >}}) diff --git a/content/en/advanced-concepts/architecture/resolver/_index.md b/content/en/advanced-reference/advanced-concepts/architecture/resolver/_index.md similarity index 100% rename from content/en/advanced-concepts/architecture/resolver/_index.md rename to content/en/advanced-reference/advanced-concepts/architecture/resolver/_index.md diff --git a/content/en/advanced-concepts/architecture/resolver/resolver-patterns.md b/content/en/advanced-reference/advanced-concepts/architecture/resolver/resolver-patterns.md similarity index 100% rename from content/en/advanced-concepts/architecture/resolver/resolver-patterns.md rename to content/en/advanced-reference/advanced-concepts/architecture/resolver/resolver-patterns.md diff --git a/content/en/advanced-concepts/architecture/runtime/_index.md b/content/en/advanced-reference/advanced-concepts/architecture/runtime/_index.md similarity index 100% rename from content/en/advanced-concepts/architecture/runtime/_index.md rename to content/en/advanced-reference/advanced-concepts/architecture/runtime/_index.md diff --git a/content/en/advanced-concepts/architecture/runtime/execution-context.md b/content/en/advanced-reference/advanced-concepts/architecture/runtime/execution-context.md similarity index 100% rename from content/en/advanced-concepts/architecture/runtime/execution-context.md rename to content/en/advanced-reference/advanced-concepts/architecture/runtime/execution-context.md diff --git a/content/en/advanced-concepts/architecture/runtime/graph-orchestration.md b/content/en/advanced-reference/advanced-concepts/architecture/runtime/graph-orchestration.md similarity index 100% rename from content/en/advanced-concepts/architecture/runtime/graph-orchestration.md rename to content/en/advanced-reference/advanced-concepts/architecture/runtime/graph-orchestration.md diff --git a/content/en/advanced-concepts/architecture/runtime/overview.md b/content/en/advanced-reference/advanced-concepts/architecture/runtime/overview.md similarity index 100% rename from content/en/advanced-concepts/architecture/runtime/overview.md rename to content/en/advanced-reference/advanced-concepts/architecture/runtime/overview.md diff --git a/content/en/advanced-concepts/architecture/ui/_index.md b/content/en/advanced-reference/advanced-concepts/architecture/ui/_index.md similarity index 100% rename from content/en/advanced-concepts/architecture/ui/_index.md rename to content/en/advanced-reference/advanced-concepts/architecture/ui/_index.md diff --git a/content/en/advanced-concepts/architecture/ui/action-config-panels.md b/content/en/advanced-reference/advanced-concepts/architecture/ui/action-config-panels.md similarity index 100% rename from content/en/advanced-concepts/architecture/ui/action-config-panels.md rename to content/en/advanced-reference/advanced-concepts/architecture/ui/action-config-panels.md diff --git a/content/en/advanced-concepts/architecture/ui/component-registry.md b/content/en/advanced-reference/advanced-concepts/architecture/ui/component-registry.md similarity index 100% rename from content/en/advanced-concepts/architecture/ui/component-registry.md rename to content/en/advanced-reference/advanced-concepts/architecture/ui/component-registry.md diff --git a/content/en/advanced-concepts/architecture/ui/controls.md b/content/en/advanced-reference/advanced-concepts/architecture/ui/controls.md similarity index 100% rename from content/en/advanced-concepts/architecture/ui/controls.md rename to content/en/advanced-reference/advanced-concepts/architecture/ui/controls.md diff --git a/content/en/advanced-concepts/architecture/ui/dynamic-forms.md b/content/en/advanced-reference/advanced-concepts/architecture/ui/dynamic-forms.md similarity index 100% rename from content/en/advanced-concepts/architecture/ui/dynamic-forms.md rename to content/en/advanced-reference/advanced-concepts/architecture/ui/dynamic-forms.md diff --git a/content/en/advanced-concepts/architecture/ui/overview.md b/content/en/advanced-reference/advanced-concepts/architecture/ui/overview.md similarity index 100% rename from content/en/advanced-concepts/architecture/ui/overview.md rename to content/en/advanced-reference/advanced-concepts/architecture/ui/overview.md diff --git a/content/en/advanced-concepts/data-manipulation/_index.md b/content/en/advanced-reference/advanced-concepts/data-manipulation/_index.md similarity index 100% rename from content/en/advanced-concepts/data-manipulation/_index.md rename to content/en/advanced-reference/advanced-concepts/data-manipulation/_index.md diff --git a/content/en/advanced-concepts/data-manipulation/normalization-value-resolver.md b/content/en/advanced-reference/advanced-concepts/data-manipulation/normalization-value-resolver.md similarity index 97% rename from content/en/advanced-concepts/data-manipulation/normalization-value-resolver.md rename to content/en/advanced-reference/advanced-concepts/data-manipulation/normalization-value-resolver.md index 49cf63b..54a32ef 100644 --- a/content/en/advanced-concepts/data-manipulation/normalization-value-resolver.md +++ b/content/en/advanced-reference/advanced-concepts/data-manipulation/normalization-value-resolver.md @@ -83,6 +83,6 @@ By using the Normalization Value Resolver, business users can: ## Where to find it? The Normalization Value Resolver is integrated into: -- [Assignment Action]({{< relref "action-types/assignment/" >}}) -- [Condition Nodes]({{< relref "action-types/condition/" >}}) +- [Assignment Action]({{< relref "core-actions/set-value.md/" >}}) +- [Condition Nodes]({{< relref "core-actions/check.md/" >}}) - Any configuration panel requiring data mapping. diff --git a/content/en/advanced-concepts/decision-trees.md b/content/en/advanced-reference/advanced-concepts/decision-trees.md similarity index 92% rename from content/en/advanced-concepts/decision-trees.md rename to content/en/advanced-reference/advanced-concepts/decision-trees.md index 9f1b80b..91b9e03 100644 --- a/content/en/advanced-concepts/decision-trees.md +++ b/content/en/advanced-reference/advanced-concepts/decision-trees.md @@ -83,6 +83,6 @@ Need to process a collection? ## Related Topics -- [Glossary]({{< relref "advanced-concepts/reference/glossary.md" >}}) -- [Rule Builder]({{< relref "rule-builder/canvas-navigation.md" >}}) -- [Action Zone]({{< relref "action-types/" >}}) +- [Glossary]({{< relref "advanced-reference/advanced-concepts/reference/glossary.md" >}}) +- [Rule Builder]({{< relref "using-the-builder/canvas-navigation.md" >}}) +- [Action Zone]({{< relref "core-actions/" >}}) diff --git a/content/en/advanced-concepts/reference/_index.md b/content/en/advanced-reference/advanced-concepts/reference/_index.md similarity index 100% rename from content/en/advanced-concepts/reference/_index.md rename to content/en/advanced-reference/advanced-concepts/reference/_index.md diff --git a/content/en/advanced-concepts/reference/ai/_index.md b/content/en/advanced-reference/advanced-concepts/reference/ai/_index.md similarity index 100% rename from content/en/advanced-concepts/reference/ai/_index.md rename to content/en/advanced-reference/advanced-concepts/reference/ai/_index.md diff --git a/content/en/advanced-concepts/reference/ai/action-metadata-schema.md b/content/en/advanced-reference/advanced-concepts/reference/ai/action-metadata-schema.md similarity index 100% rename from content/en/advanced-concepts/reference/ai/action-metadata-schema.md rename to content/en/advanced-reference/advanced-concepts/reference/ai/action-metadata-schema.md diff --git a/content/en/advanced-concepts/reference/doctypes.md b/content/en/advanced-reference/advanced-concepts/reference/doctypes.md similarity index 85% rename from content/en/advanced-concepts/reference/doctypes.md rename to content/en/advanced-reference/advanced-concepts/reference/doctypes.md index 3bf783f..ae902f4 100644 --- a/content/en/advanced-concepts/reference/doctypes.md +++ b/content/en/advanced-reference/advanced-concepts/reference/doctypes.md @@ -54,7 +54,7 @@ The primary container for an automation flow. It defines **when** logic starts a Represents a single executable node (Step) within a Rule's graph. ### When to Use -- Rule Actions are managed via the [Rule Builder]({{< relref "rule-builder/canvas-navigation.md" >}}), which handles the creation of these child records automatically. +- Rule Actions are managed via the [Rule Builder]({{< relref "using-the-builder/canvas-navigation.md" >}}), which handles the creation of these child records automatically. | Field | Type | Description | | :--- | :--- | :--- | @@ -93,6 +93,6 @@ Audit trail for every rule execution. ## Related Topics -- [Execution Engine]({{< relref "advanced-concepts/architecture/engine/execution-engine.md" >}}) -- [Rule Builder]({{< relref "rule-builder/canvas-navigation.md" >}}) -- [API Reference]({{< relref "api-reference/public-apis.md" >}}) +- [Execution Engine]({{< relref "advanced-reference/advanced-concepts/architecture/engine/execution-engine.md" >}}) +- [Rule Builder]({{< relref "using-the-builder/canvas-navigation.md" >}}) +- [API Reference]({{< relref "advanced-reference/api-reference/public-apis.md" >}}) diff --git a/content/en/advanced-concepts/reference/execution/_index.md b/content/en/advanced-reference/advanced-concepts/reference/execution/_index.md similarity index 100% rename from content/en/advanced-concepts/reference/execution/_index.md rename to content/en/advanced-reference/advanced-concepts/reference/execution/_index.md diff --git a/content/en/advanced-concepts/reference/execution/condition.md b/content/en/advanced-reference/advanced-concepts/reference/execution/condition.md similarity index 94% rename from content/en/advanced-concepts/reference/execution/condition.md rename to content/en/advanced-reference/advanced-concepts/reference/execution/condition.md index 84ac705..3a5499e 100644 --- a/content/en/advanced-concepts/reference/execution/condition.md +++ b/content/en/advanced-reference/advanced-concepts/reference/execution/condition.md @@ -61,6 +61,6 @@ Since the action is read-only and operates on the local execution context, it is - **Memory**: The action has a negligible memory footprint as it does not store large datasets. ## Related Topics -- [Action Documentation]({{< relref "action-types/condition.md" >}}) -- [Architecture Reference]({{< relref "advanced-concepts/architecture/actions/condition.md" >}}) -- [Condition Builder Guide]({{< relref "action-types/condition.md" >}}) +- [Action Documentation]({{< relref "core-actions/check.md" >}}) +- [Architecture Reference]({{< relref "advanced-reference/advanced-concepts/architecture/actions/condition.md" >}}) +- [Condition Builder Guide]({{< relref "core-actions/check.md" >}}) diff --git a/content/en/advanced-concepts/reference/execution/document-action.md b/content/en/advanced-reference/advanced-concepts/reference/execution/document-action.md similarity index 100% rename from content/en/advanced-concepts/reference/execution/document-action.md rename to content/en/advanced-reference/advanced-concepts/reference/execution/document-action.md diff --git a/content/en/advanced-concepts/reference/execution/entry.md b/content/en/advanced-reference/advanced-concepts/reference/execution/entry.md similarity index 100% rename from content/en/advanced-concepts/reference/execution/entry.md rename to content/en/advanced-reference/advanced-concepts/reference/execution/entry.md diff --git a/content/en/advanced-concepts/reference/execution/loop.md b/content/en/advanced-reference/advanced-concepts/reference/execution/loop.md similarity index 96% rename from content/en/advanced-concepts/reference/execution/loop.md rename to content/en/advanced-reference/advanced-concepts/reference/execution/loop.md index db5b720..f120d8e 100644 --- a/content/en/advanced-concepts/reference/execution/loop.md +++ b/content/en/advanced-reference/advanced-concepts/reference/execution/loop.md @@ -63,4 +63,4 @@ The Loop action itself is **not inherently idempotent** if it modifies document - **Collection Size**: Large collections (e.g., thousands of items) significantly increase execution time and memory consumption as the entire collection is resolved at every iteration check. - **Graph Depth**: Deeply nested loops increase the complexity of the execution trace and context memory. -- **Recommendation**: For processing very large datasets, offload logic to a [Process]({{< relref "advanced-concepts/architecture/overview.md" >}}) or use background jobs via the Rule configuration. +- **Recommendation**: For processing very large datasets, offload logic to a [Process]({{< relref "advanced-reference/advanced-concepts/architecture/overview.md" >}}) or use background jobs via the Rule configuration. diff --git a/content/en/advanced-concepts/reference/execution/notify.md b/content/en/advanced-reference/advanced-concepts/reference/execution/notify.md similarity index 95% rename from content/en/advanced-concepts/reference/execution/notify.md rename to content/en/advanced-reference/advanced-concepts/reference/execution/notify.md index 0bdea8f..660366f 100644 --- a/content/en/advanced-concepts/reference/execution/notify.md +++ b/content/en/advanced-reference/advanced-concepts/reference/execution/notify.md @@ -52,8 +52,8 @@ The Notify action interacts with transactions differently depending on the mode: The Notify action is **not idempotent**. Executing the same Notify action multiple times will result in multiple emails being sent or multiple notifications being created. Use conditional logic (`Run If`) to prevent redundant notifications in re-entrant rules. ## Related Topics -- [Action Documentation]({{< relref "action-types/notify/" >}}) -- [Architecture Reference]({{< relref "advanced-concepts/architecture/actions/notify.md" >}}) +- [Action Documentation]({{< relref "core-actions/notify-action.md" >}}) +- [Architecture Reference]({{< relref "advanced-reference/advanced-concepts/architecture/actions/notify.md" >}}) ## Performance Notes - **Email Overhead**: While `frappe.sendmail` is generally fast (queuing), generating complex PDF attachments can be resource-intensive. diff --git a/content/en/advanced-concepts/reference/execution/query-records.md b/content/en/advanced-reference/advanced-concepts/reference/execution/query-records.md similarity index 94% rename from content/en/advanced-concepts/reference/execution/query-records.md rename to content/en/advanced-reference/advanced-concepts/reference/execution/query-records.md index aff9313..63263fe 100644 --- a/content/en/advanced-concepts/reference/execution/query-records.md +++ b/content/en/advanced-reference/advanced-concepts/reference/execution/query-records.md @@ -23,7 +23,7 @@ When a Query Records action is executed, the engine follows this strict sequence 3. **Filter Resolution**: - Configuration filters are recursively traversed. - Expressions (e.g., `{{doc.name}}`) are resolved via the `ValueResolver`. - - Natural language date keywords are resolved into static date ranges (See [Timespan Keywords]({{< relref "advanced-concepts/reference/timespan-keywords" >}})). + - Natural language date keywords are resolved into static date ranges (See [Timespan Keywords]({{< relref "advanced-reference/advanced-concepts/reference/timespan-keywords" >}})). 4. **Database Dispatch**: The query is dispatched to the database layer based on the selected **Mode**. 5. **Output Mutation**: The results are injected into the specified context variable (e.g., `vars.result`). @@ -50,7 +50,7 @@ Modes like **Count**, **Sum**, **Avg**, **Min**, and **Max** return a primitive ### Complex Outputs - **Group By**: Returns a list of dictionaries with the keys `[group_field, "value"]`. -- **Query Report**: Returns an object containing `columns` and `result`. See the [Query Report Detail]({{< relref "action-types/query-records.md" >}}) for usage examples. +- **Query Report**: Returns an object containing `columns` and `result`. See the [Query Report Detail]({{< relref "core-actions/query-records.md" >}}) for usage examples. --- diff --git a/content/en/advanced-concepts/reference/execution/stop.md b/content/en/advanced-reference/advanced-concepts/reference/execution/stop.md similarity index 88% rename from content/en/advanced-concepts/reference/execution/stop.md rename to content/en/advanced-reference/advanced-concepts/reference/execution/stop.md index 943d041..52ecd18 100644 --- a/content/en/advanced-concepts/reference/execution/stop.md +++ b/content/en/advanced-reference/advanced-concepts/reference/execution/stop.md @@ -31,7 +31,7 @@ The Stop action has read-only access to: The transaction behavior of the Stop action depends entirely on its mode: - **Success**: The action has no impact on the current database transaction. The transaction continues as normal and will commit when the overall rule execution (and any other triggered rules) finishes successfully. -- **Error**: Raising a `frappe.ValidationError` triggers a standard database **Rollback**. Any changes made by previous nodes in the same rule flow (e.g., [Assignment]({{< relref "action-types/assignment" >}}) updates to `doc`) will be reverted. +- **Error**: Raising a `frappe.ValidationError` triggers a standard database **Rollback**. Any changes made by previous nodes in the same rule flow (e.g., [Assignment]({{< relref "core-actions/set-value.md" >}}) updates to `doc`) will be reverted. ## Failure Behavior If the Jinja template in the error message fails to render, the engine will raise a secondary rendering error. However, since the intent was already to stop with an error, the result is still a termination of the flow and a rollback of the transaction. @@ -43,5 +43,5 @@ The Stop action is inherently idempotent in **Success** mode. In **Error** mode, The Stop action is extremely lightweight. In `Success` mode, it involves a simple return statement. In `Error` mode, it involves a single Jinja rendering and a standard Python exception. ## Related Topics -- [Action Documentation]({{< relref "advanced-concepts/architecture/actions/stop.md" >}}) -- [Architecture Reference]({{< relref "advanced-concepts/architecture/actions/stop.md" >}}) +- [Action Documentation]({{< relref "advanced-reference/advanced-concepts/architecture/actions/stop.md" >}}) +- [Architecture Reference]({{< relref "advanced-reference/advanced-concepts/architecture/actions/stop.md" >}}) diff --git a/content/en/advanced-concepts/reference/glossary.md b/content/en/advanced-reference/advanced-concepts/reference/glossary.md similarity index 88% rename from content/en/advanced-concepts/reference/glossary.md rename to content/en/advanced-reference/advanced-concepts/reference/glossary.md index d80c12d..34c1995 100644 --- a/content/en/advanced-concepts/reference/glossary.md +++ b/content/en/advanced-reference/advanced-concepts/reference/glossary.md @@ -46,6 +46,6 @@ Common terminology and core concepts used throughout the FlexiRule documentation ## Related Topics -- [System Architecture]({{< relref "advanced-concepts/architecture/" >}}) -- [Execution Engine]({{< relref "advanced-concepts/architecture/engine/execution-engine.md" >}}) -- [Rule Building]({{< relref "rule-builder/canvas-navigation.md" >}}) +- [System Architecture]({{< relref "advanced-reference/advanced-concepts/architecture/" >}}) +- [Execution Engine]({{< relref "advanced-reference/advanced-concepts/architecture/engine/execution-engine.md" >}}) +- [Rule Building]({{< relref "using-the-builder/canvas-navigation.md" >}}) diff --git a/content/en/advanced-concepts/reference/localized/_index.md b/content/en/advanced-reference/advanced-concepts/reference/localized/_index.md similarity index 100% rename from content/en/advanced-concepts/reference/localized/_index.md rename to content/en/advanced-reference/advanced-concepts/reference/localized/_index.md diff --git a/content/en/advanced-concepts/reference/localized/arabic-overview.md b/content/en/advanced-reference/advanced-concepts/reference/localized/arabic-overview.md similarity index 100% rename from content/en/advanced-concepts/reference/localized/arabic-overview.md rename to content/en/advanced-reference/advanced-concepts/reference/localized/arabic-overview.md diff --git a/content/en/advanced-concepts/reference/query-filters/index.md b/content/en/advanced-reference/advanced-concepts/reference/query-filters/index.md similarity index 94% rename from content/en/advanced-concepts/reference/query-filters/index.md rename to content/en/advanced-reference/advanced-concepts/reference/query-filters/index.md index 281f17f..08e1d06 100644 --- a/content/en/advanced-concepts/reference/query-filters/index.md +++ b/content/en/advanced-reference/advanced-concepts/reference/query-filters/index.md @@ -69,4 +69,4 @@ Instead of typing a fixed value, you can use the **Value Resolver** to pull data - `{{vars.target_date}}`: Resolves to a variable calculated in a previous node. - `{{Today - 7 days}}`: Resolves to a calculated date. -*See the [Value Resolver]({{< relref "advanced-concepts/architecture/resolver/_index.md" >}}) for full expression syntax.* +*See the [Value Resolver]({{< relref "advanced-reference/advanced-concepts/architecture/resolver/_index.md" >}}) for full expression syntax.* diff --git a/content/en/advanced-concepts/reference/terminology.md b/content/en/advanced-reference/advanced-concepts/reference/terminology.md similarity index 100% rename from content/en/advanced-concepts/reference/terminology.md rename to content/en/advanced-reference/advanced-concepts/reference/terminology.md diff --git a/content/en/advanced-concepts/reference/timespan-keywords/index.md b/content/en/advanced-reference/advanced-concepts/reference/timespan-keywords/index.md similarity index 100% rename from content/en/advanced-concepts/reference/timespan-keywords/index.md rename to content/en/advanced-reference/advanced-concepts/reference/timespan-keywords/index.md diff --git a/content/en/advanced-concepts/registry-contracts.md b/content/en/advanced-reference/advanced-concepts/registry-contracts.md similarity index 100% rename from content/en/advanced-concepts/registry-contracts.md rename to content/en/advanced-reference/advanced-concepts/registry-contracts.md diff --git a/content/en/advanced-concepts/roadmap/_index.md b/content/en/advanced-reference/advanced-concepts/roadmap/_index.md similarity index 100% rename from content/en/advanced-concepts/roadmap/_index.md rename to content/en/advanced-reference/advanced-concepts/roadmap/_index.md diff --git a/content/en/advanced-concepts/roadmap/assignment-action-improvements.md b/content/en/advanced-reference/advanced-concepts/roadmap/assignment-action-improvements.md similarity index 100% rename from content/en/advanced-concepts/roadmap/assignment-action-improvements.md rename to content/en/advanced-reference/advanced-concepts/roadmap/assignment-action-improvements.md diff --git a/content/en/advanced-concepts/roadmap/documentation-standardization.md b/content/en/advanced-reference/advanced-concepts/roadmap/documentation-standardization.md similarity index 100% rename from content/en/advanced-concepts/roadmap/documentation-standardization.md rename to content/en/advanced-reference/advanced-concepts/roadmap/documentation-standardization.md diff --git a/content/en/advanced-concepts/roadmap/event-driven-architecture.md b/content/en/advanced-reference/advanced-concepts/roadmap/event-driven-architecture.md similarity index 100% rename from content/en/advanced-concepts/roadmap/event-driven-architecture.md rename to content/en/advanced-reference/advanced-concepts/roadmap/event-driven-architecture.md diff --git a/content/en/advanced-concepts/roadmap/platform-potential.md b/content/en/advanced-reference/advanced-concepts/roadmap/platform-potential.md similarity index 100% rename from content/en/advanced-concepts/roadmap/platform-potential.md rename to content/en/advanced-reference/advanced-concepts/roadmap/platform-potential.md diff --git a/content/en/advanced-concepts/roadmap/runtime-optimization.md b/content/en/advanced-reference/advanced-concepts/roadmap/runtime-optimization.md similarity index 100% rename from content/en/advanced-concepts/roadmap/runtime-optimization.md rename to content/en/advanced-reference/advanced-concepts/roadmap/runtime-optimization.md diff --git a/content/en/advanced-concepts/rule-entry-condition-vs-condition-action.md b/content/en/advanced-reference/advanced-concepts/rule-entry-condition-vs-condition-action.md similarity index 96% rename from content/en/advanced-concepts/rule-entry-condition-vs-condition-action.md rename to content/en/advanced-reference/advanced-concepts/rule-entry-condition-vs-condition-action.md index 081e47c..3cc8615 100644 --- a/content/en/advanced-concepts/rule-entry-condition-vs-condition-action.md +++ b/content/en/advanced-reference/advanced-concepts/rule-entry-condition-vs-condition-action.md @@ -21,7 +21,7 @@ However, they serve very different purposes. ## Quick Summary -| Use Case | Rule Entry Condition | [Condition Action]({{< relref "action-types/condition.md" >}}) | +| Use Case | Rule Entry Condition | [Condition Action]({{< relref "core-actions/check.md" >}}) | | :--- | :---: | :---: | | Decide whether the rule should run at all | ✅ Yes | ❌ No | | Create branching logic inside a rule | ❌ No | ✅ Yes | @@ -34,7 +34,7 @@ However, they serve very different purposes. ## What is a Rule Entry Condition? -A **Rule Entry Condition** acts as a gatekeeper for the entire rule. It is configured as part of the [Rule Trigger Configuration]({{< relref "advanced-concepts/triggers/_index.md" >}}). +A **Rule Entry Condition** acts as a gatekeeper for the entire rule. It is configured as part of the [Rule Trigger Configuration]({{< relref "advanced-reference/advanced-concepts/triggers/_index.md" >}}). {{< info >}} While the UI uses the term **Rule Entry Condition**, it is best understood as the **Trigger Condition** or **Trigger Filter**. @@ -108,7 +108,7 @@ Condition: Customer is VIP? ### Recommended Uses -Use a [Condition Action]({{< relref "action-types/condition.md" >}}) when you need: +Use a [Condition Action]({{< relref "core-actions/check.md" >}}) when you need: - **If / Else logic**: Branching into different paths. - **Guarded Sequences**: Executing specific actions only under certain conditions within a larger flow. - **Decision Trees**: Handling complex business logic after the rule has been triggered. diff --git a/content/en/advanced-concepts/system-philosophy.md b/content/en/advanced-reference/advanced-concepts/system-philosophy.md similarity index 100% rename from content/en/advanced-concepts/system-philosophy.md rename to content/en/advanced-reference/advanced-concepts/system-philosophy.md diff --git a/content/en/advanced-concepts/triggers/_index.md b/content/en/advanced-reference/advanced-concepts/triggers/_index.md similarity index 92% rename from content/en/advanced-concepts/triggers/_index.md rename to content/en/advanced-reference/advanced-concepts/triggers/_index.md index 1480bca..a3cb222 100644 --- a/content/en/advanced-concepts/triggers/_index.md +++ b/content/en/advanced-reference/advanced-concepts/triggers/_index.md @@ -28,4 +28,4 @@ Triggers act as the entry point for all business logic in FlexiRule. They determ --- ## Technical Details -For implementation details on the dispatcher, see **[Rule Coordinator]({{< relref "advanced-concepts/architecture/runtime/overview.md" >}})**. +For implementation details on the dispatcher, see **[Rule Coordinator]({{< relref "advanced-reference/advanced-concepts/architecture/runtime/overview.md" >}})**. diff --git a/content/en/advanced-concepts/triggers/callable-triggers.md b/content/en/advanced-reference/advanced-concepts/triggers/callable-triggers.md similarity index 100% rename from content/en/advanced-concepts/triggers/callable-triggers.md rename to content/en/advanced-reference/advanced-concepts/triggers/callable-triggers.md diff --git a/content/en/advanced-concepts/triggers/context-reference.md b/content/en/advanced-reference/advanced-concepts/triggers/context-reference.md similarity index 100% rename from content/en/advanced-concepts/triggers/context-reference.md rename to content/en/advanced-reference/advanced-concepts/triggers/context-reference.md diff --git a/content/en/advanced-concepts/triggers/engine-details.md b/content/en/advanced-reference/advanced-concepts/triggers/engine-details.md similarity index 100% rename from content/en/advanced-concepts/triggers/engine-details.md rename to content/en/advanced-reference/advanced-concepts/triggers/engine-details.md diff --git a/content/en/advanced-concepts/triggers/event-triggers.md b/content/en/advanced-reference/advanced-concepts/triggers/event-triggers.md similarity index 100% rename from content/en/advanced-concepts/triggers/event-triggers.md rename to content/en/advanced-reference/advanced-concepts/triggers/event-triggers.md diff --git a/content/en/advanced-concepts/triggers/scheduler-triggers.md b/content/en/advanced-reference/advanced-concepts/triggers/scheduler-triggers.md similarity index 100% rename from content/en/advanced-concepts/triggers/scheduler-triggers.md rename to content/en/advanced-reference/advanced-concepts/triggers/scheduler-triggers.md diff --git a/content/en/api-reference/_index.md b/content/en/advanced-reference/api-reference/_index.md similarity index 100% rename from content/en/api-reference/_index.md rename to content/en/advanced-reference/api-reference/_index.md diff --git a/content/en/api-reference/contracts.md b/content/en/advanced-reference/api-reference/contracts.md similarity index 100% rename from content/en/api-reference/contracts.md rename to content/en/advanced-reference/api-reference/contracts.md diff --git a/content/en/api-reference/hooks.md b/content/en/advanced-reference/api-reference/hooks.md similarity index 100% rename from content/en/api-reference/hooks.md rename to content/en/advanced-reference/api-reference/hooks.md diff --git a/content/en/api-reference/public-apis.md b/content/en/advanced-reference/api-reference/public-apis.md similarity index 100% rename from content/en/api-reference/public-apis.md rename to content/en/advanced-reference/api-reference/public-apis.md diff --git a/content/en/developer-guide/_index.md b/content/en/advanced-reference/developer-guide/_index.md similarity index 100% rename from content/en/developer-guide/_index.md rename to content/en/advanced-reference/developer-guide/_index.md diff --git a/content/en/performance/_index.md b/content/en/advanced-reference/performance/_index.md similarity index 100% rename from content/en/performance/_index.md rename to content/en/advanced-reference/performance/_index.md diff --git a/content/en/performance/architecture.md b/content/en/advanced-reference/performance/architecture.md similarity index 100% rename from content/en/performance/architecture.md rename to content/en/advanced-reference/performance/architecture.md diff --git a/content/en/performance/optimization.md b/content/en/advanced-reference/performance/optimization.md similarity index 100% rename from content/en/performance/optimization.md rename to content/en/advanced-reference/performance/optimization.md diff --git a/content/en/setup/_index.md b/content/en/advanced-reference/setup/_index.md similarity index 100% rename from content/en/setup/_index.md rename to content/en/advanced-reference/setup/_index.md diff --git a/content/en/setup/initial-configuration.md b/content/en/advanced-reference/setup/initial-configuration.md similarity index 100% rename from content/en/setup/initial-configuration.md rename to content/en/advanced-reference/setup/initial-configuration.md diff --git a/content/en/setup/installation.md b/content/en/advanced-reference/setup/installation.md similarity index 100% rename from content/en/setup/installation.md rename to content/en/advanced-reference/setup/installation.md diff --git a/content/en/setup/permissions.md b/content/en/advanced-reference/setup/permissions.md similarity index 100% rename from content/en/setup/permissions.md rename to content/en/advanced-reference/setup/permissions.md diff --git a/content/en/setup/settings.md b/content/en/advanced-reference/setup/settings.md similarity index 100% rename from content/en/setup/settings.md rename to content/en/advanced-reference/setup/settings.md diff --git a/content/en/setup/troubleshooting.md b/content/en/advanced-reference/setup/troubleshooting.md similarity index 100% rename from content/en/setup/troubleshooting.md rename to content/en/advanced-reference/setup/troubleshooting.md diff --git a/content/en/troubleshooting/_index.md b/content/en/advanced-reference/troubleshooting/_index.md similarity index 100% rename from content/en/troubleshooting/_index.md rename to content/en/advanced-reference/troubleshooting/_index.md diff --git a/content/en/troubleshooting/faq.md b/content/en/advanced-reference/troubleshooting/faq.md similarity index 100% rename from content/en/troubleshooting/faq.md rename to content/en/advanced-reference/troubleshooting/faq.md diff --git a/content/en/troubleshooting/troubleshooting.md b/content/en/advanced-reference/troubleshooting/troubleshooting.md similarity index 100% rename from content/en/troubleshooting/troubleshooting.md rename to content/en/advanced-reference/troubleshooting/troubleshooting.md diff --git a/content/en/action-types/_index.md b/content/en/core-actions/_index.md similarity index 100% rename from content/en/action-types/_index.md rename to content/en/core-actions/_index.md diff --git a/content/en/core-actions/check.md b/content/en/core-actions/check.md new file mode 100644 index 0000000..66b6ac6 --- /dev/null +++ b/content/en/core-actions/check.md @@ -0,0 +1,49 @@ +--- +title: Check +description: Evaluate conditions to decide which path the rule should follow. +weight: 40 +--- + +# Check + +The **Check** block is how FlexiRule makes decisions. It looks at the information in your document and decides which path to follow: the **True** (Yes) path or the **False** (No) path. + +## Purpose + +Use the Check block to: +- **Validate Data**: Make sure a field has the right information before continuing. +- **Branch Your Flow**: Send the process down different paths based on choices (e.g., "Is this an Urgent order?"). +- **Inspect Lists**: Check if items in a table meet certain criteria (e.g., "Are any items out of stock?"). + +## How to Configure + +### 1. Logical Groups +You can combine multiple checks together: +- **ALL**: All checks must be true to follow the "True" path. +- **ANY**: Only one check needs to be true to follow the "True" path. +- **NONE**: The "True" path is followed only if none of the checks are true. + +### 2. Simple Checks +Each check consists of three parts: +- **Field**: What are you looking at? (e.g., `doc.total_amount`) +- **Operator**: How are you comparing it? (e.g., "is greater than", "equals", "is set") +- **Value**: What are you comparing it against? (e.g., `1000`) + +### 3. Checking Tables (Lists) +If you need to check rows in a table (like items in an order), you can use "Collection" mode: +- You can check if **Any row**, **All rows**, or **No rows** match your criteria. + +## How it Works on the Canvas + +When the rule reaches a Check block: +1. It evaluates the conditions you defined. +2. If the conditions are met, it follows the green **True** connection. +3. If the conditions are not met, it follows the red **False** connection. + +If you don't connect a path, the rule will simply stop there if it reaches that outcome. + +## Tips for Success + +- **Start Simple**: Try to keep your checks easy to read. If you have a very complex decision, it's often better to use two Check blocks in a row. +- **Check for Empty Fields**: Use the "Is Set" operator to make sure a field has a value before trying to compare it to something else. +- **Visual Testing**: When you test your rule, you'll see exactly which path was taken, which helps you understand why a decision was made. diff --git a/content/en/core-actions/notify-action.md b/content/en/core-actions/notify-action.md new file mode 100644 index 0000000..5199370 --- /dev/null +++ b/content/en/core-actions/notify-action.md @@ -0,0 +1,52 @@ +--- +title: Notify +description: Send emails, system alerts, or messages to users and customers. +weight: 80 +--- + +# Notify + +The **Notify** block allows your rule to communicate with people. You can use it to send automated emails, post system alerts, or trigger messages to keep everyone informed about what is happening in your business process. + +## Purpose + +Use the Notify block when you need to: +- **Send Emails**: Automatically email customers or staff (e.g., "Send an Order Confirmation"). +- **System Alerts**: Create notifications that appear inside the ERPNext notification center. +- **Assign Tasks**: Let a specific user know they need to take action. + +## How to Configure + +### 1. Delivery Method +Choose how you want to send the message: +- **Email**: Send a standard email using your system's email settings. +- **System Notification**: Create an internal alert for a specific user. + +### 2. Recipients (To) +Specify who should receive the message. You can: +- Type a specific email address. +- Select a user field from your document (e.g., `doc.owner` or `doc.contact_email`). +- Choose a specific ERPNext User or Role. + +### 3. Subject and Message +Craft your message. You can use fields from your document directly in the text to make it personal. +- *Example*: "Hi `doc.customer_name`, your order `doc.name` has been shipped!" + +### 4. Templates +If you have already created **Email Templates** in ERPNext, you can select them here to ensure your emails look professional and consistent. + +## Example: Approval Alert +**Scenario**: You want to notify a manager when a large order is placed. +1. **Check**: Is the `doc.total` greater than 5000? +2. **True Path**: Connect to a **Notify** block. +3. **Notify Settings**: + - **Method**: Email + - **To**: `manager@example.com` + - **Subject**: Action Required: Large Order `doc.name` + - **Message**: Please review the new order from `doc.customer`. + +## Tips for Success + +- **Dynamic Content**: Use the curly braces or field picker to insert real data from your document into your messages. +- **Check Recipients**: Make sure the field you use for the email address actually contains a valid email before the rule runs. +- **Test First**: Send a test notification to yourself during setup to make sure the formatting and links look exactly how you want. diff --git a/content/en/action-types/process.md b/content/en/core-actions/process.md similarity index 100% rename from content/en/action-types/process.md rename to content/en/core-actions/process.md diff --git a/content/en/core-actions/query-records.md b/content/en/core-actions/query-records.md new file mode 100644 index 0000000..e862b85 --- /dev/null +++ b/content/en/core-actions/query-records.md @@ -0,0 +1,50 @@ +--- +title: Query Records +description: Find and retrieve information from other records in your system. +weight: 70 +--- + +# Query Records + +The **Query Records** block allows you to look up information from anywhere in your system. Whether you need to find a single specific record (like a Customer's profile) or a list of records (like all overdue Invoices), this block helps you gather the data you need for your rule. + +## Purpose + +Use Query Records when you need to: +- **Fetch Details**: Get information from a related document (e.g., "Find the Sales Manager for this Customer"). +- **Gather a List**: Find all records that match certain criteria (e.g., "Find all open Tasks for this Project"). +- **Perform Checks**: See if a record exists before taking an action. + +## How to Configure + +### 1. What to look for (DocType) +Select the type of record you want to find (e.g., "Invoice", "Item", "Employee"). + +### 2. How to find it (Filters) +Set up filters to narrow down your search. You can compare fields in the records you are searching against values in your current document. +- *Example*: Find **Invoices** where the `customer` matches `doc.customer`. + +### 3. One or Many? (Query Mode) +- **Single Record**: Use this when you only need one result (e.g., a specific configuration setting). +- **List of Records**: Use this when you want to find everything that matches (e.g., all items currently on backorder). + +### 4. Where to store the result (Return Variable) +Give a name to the information you found (e.g., `vars.found_invoices`). You can then use this name in later blocks to access the data. + +## Working with the Results + +- **If you found a Single Record**: You can access its fields directly, like `vars.my_record.status`. +- **If you found a List**: You will typically connect a **Repeat** block next to process each item in that list one by one. + +## Example: Overdue Reminder +**Scenario**: You want to find all overdue invoices for a customer and notify them. +1. **Query Records**: Search for "Invoice" where `status` is "Overdue" and `customer` is `doc.customer`. +2. **Store as**: `vars.overdue_list`. +3. **Repeat**: Use the Repeat block to go through `vars.overdue_list`. +4. **Notify**: Inside the repeat cycle, send an email for each invoice found. + +## Tips for Success + +- **Be Specific**: Use as many filters as possible to make sure you only find exactly what you need. This keeps the rule fast and accurate. +- **Check for Results**: After a query, you can use a **Check** block to see if anything was actually found before trying to use the data. +- **Accessing Fields**: When you look at a found record, make sure you use the correct field names from that DocType. diff --git a/content/en/core-actions/repeat.md b/content/en/core-actions/repeat.md new file mode 100644 index 0000000..1b9ab09 --- /dev/null +++ b/content/en/core-actions/repeat.md @@ -0,0 +1,36 @@ +--- +title: Repeat +description: Perform a sequence of actions for every item in a list. +weight: 60 +--- + +# Repeat + +The **Repeat** block (also known as a Loop) allows you to perform the same set of actions multiple times—once for every item in a list. This is useful when you have a collection of items, like rows in a table or a list of records found in a search. + +## Purpose + +Use the Repeat block when you need to: +- **Process Tables**: Run logic for every row in a child table (e.g., "Check every item in this Sales Order"). +- **Handle Search Results**: Perform an action for every record found by a **Query Records** block. +- **Bulk Updates**: Update multiple related records at once. + +## How it Works + +1. **The List**: You choose the list of items you want to process (e.g., `doc.items`). +2. **The Cycle**: Any blocks connected to the **Loop** output will run repeatedly, once for each item in that list. +3. **The Current Item**: While the cycle is running, you can access the specific item being processed using the `item` reference. +4. **Completion**: Once every item has been processed, the rule continues from the **Completed** output of the Repeat block. + +## Example: Stock Check +**Scenario**: You want to check the stock for every item in a Sales Order. +1. **Repeat**: Select `doc.items` as the list. +2. **Check**: Connect a Check block to the Repeat block to see if the `item.qty` is available in stock. +3. **Set Value**: If stock is low, update `item.status` to "Pending". +4. **Finish**: Once all items are checked, the rule moves on to the next major step (like notifying the manager). + +## Tips for Success + +- **Keep it Focused**: Only include the steps that actually need to repeat inside the loop. +- **Accessing Data**: Use `item.field_name` to get information from the specific row currently being processed. +- **Performance**: If you are processing thousands of items, consider if there is a way to filter the list first to keep the rule fast. diff --git a/content/en/core-actions/set-value.md b/content/en/core-actions/set-value.md new file mode 100644 index 0000000..ba0d295 --- /dev/null +++ b/content/en/core-actions/set-value.md @@ -0,0 +1,53 @@ +--- +title: Set Value +description: Update fields on your document or store information for later use. +weight: 50 +--- + +# Set Value + +The **Set Value** block is the most common action in FlexiRule. It allows you to change information on your document (like updating a status) or store temporary information to use later in your rule. + +## Purpose + +Use the Set Value block when you need to: +- **Update Fields**: Change a field on your document (e.g., set "Status" to "Processing"). +- **Do Math**: Add or subtract from a numeric field (e.g., increment a "Retry Count"). +- **Store Info**: Save a value into a temporary variable to use in a later step. +- **Clear Fields**: Remove the current value from a field. + +## How to Configure + +The Set Value block uses a simple list where you can add one or more updates. + +### 1. Where to update (Target) +Choose where you want the new information to go: +- `doc.field_name`: Use this to update a field on the document that triggered the rule. +- `vars.variable_name`: Use this to store information for the duration of the rule execution. + +### 2. How to update (Operator) +Choose how you want to apply the change: +- **Set**: Replace the current information with something new. +- **Clear**: Empty the field. +- **Add / Subtract**: Increase or decrease a number. +- **Append**: Add a value to the end of a list. + +### 3. The New Value +Specify what the new information should be. You can type a value directly, refer to another field, or use a simple formula for calculations. + +### 4. Only if... (Condition) +You can optionally set a condition so that an update only happens if certain criteria are met (e.g., only update "Priority" if "Amount" is greater than 1000). + +## Examples + +| Target | Operator | Value | Purpose | +| :--- | :--- | :--- | :--- | +| `doc.status` | Set | "Approved" | Updates the document status. | +| `doc.total_weight` | Add | `doc.item_weight` | Calculates a running total. | +| `vars.is_vip` | Set | `doc.customer_score > 50` | Stores a check result for later use. | + +## Tips for Success + +- **Top to Bottom**: Updates happen in the order they appear in the list. +- **Precise Paths**: Always start with `doc.` for document fields or `vars.` for temporary variables. +- **Keep it Simple**: Use temporary variables (`vars.`) to break down complex calculations into smaller, easier-to-read steps. diff --git a/content/en/core-actions/start.md b/content/en/core-actions/start.md new file mode 100644 index 0000000..19b97d0 --- /dev/null +++ b/content/en/core-actions/start.md @@ -0,0 +1,31 @@ +--- +title: Start +description: The starting point of every business rule. +weight: 5 +--- + +# Start + +Every business rule begins with a **Start** block. This block represents the moment the rule is triggered and provides the initial information (the document) to the rest of the flow. + +## What is the Start Block? + +The Start block is the entry point for your logic. When a rule is triggered—for example, when a Sales Order is saved—FlexiRule creates a Start block that holds all the information from that Sales Order. + +## How it Works + +- **The Trigger**: The rule starts based on the event you defined in the Rule Settings (like "Before Save" or "On Submit"). +- **Available Data**: Everything inside the document that triggered the rule (referred to as `doc`) is available to every other block connected after the Start block. +- **Entry Conditions**: You can set "Entry Conditions" on the rule itself. If these conditions aren't met, the rule won't start at all, saving system resources. + +## Example + +Imagine a rule that runs when a **Customer** is created. +1. The **Start** block captures the new Customer record. +2. You connect a **Check** block to see if the customer is from a specific region. +3. You then connect a **Notify** block to alert the regional sales manager. + +## Tips for Success + +- **One Start per Rule**: Every rule has exactly one Start block. You cannot delete it or add a second one. +- **Filter Early**: Use Entry Conditions on the rule to make sure it only runs when necessary. For example, if your rule only applies to "International" customers, set that as an Entry Condition so the rule doesn't run for local ones. diff --git a/content/en/action-types/stop-error.md b/content/en/core-actions/stop-error.md similarity index 100% rename from content/en/action-types/stop-error.md rename to content/en/core-actions/stop-error.md diff --git a/content/en/action-types/sub-rule.md b/content/en/core-actions/sub-rule.md similarity index 100% rename from content/en/action-types/sub-rule.md rename to content/en/core-actions/sub-rule.md diff --git a/content/en/action-types/switch.md b/content/en/core-actions/switch.md similarity index 100% rename from content/en/action-types/switch.md rename to content/en/core-actions/switch.md diff --git a/content/en/core-actions/update-record.md b/content/en/core-actions/update-record.md new file mode 100644 index 0000000..1e4babb --- /dev/null +++ b/content/en/core-actions/update-record.md @@ -0,0 +1,51 @@ +--- +title: Update Record +description: Modify other records in your system or create new ones. +weight: 90 +--- + +# Update Record + +The **Update Record** block allows your rule to make changes to documents other than the one that triggered the rule. You can also use it to create entirely new records automatically. + +## Purpose + +Use Update Record when you need to: +- **Change Related Data**: Update a field on a different document (e.g., "Mark the related Project as Completed"). +- **Create New Records**: Automatically generate a new document (e.g., "Create a new Quality Inspection when a Receipt is saved"). +- **Sync Information**: Keep related records in sync without manual entry. + +## How to Configure + +### 1. Action Type +Choose what you want to do: +- **Update Existing**: Change information on a record that already exists. +- **Create New**: Build a brand new record from scratch. + +### 2. Which Record? (For Update Existing) +Specify which record you want to change. You can refer to a record found in a previous **Query Records** block or use a field from your current document (like `doc.project`). + +### 3. Field Mappings +Define which fields should be updated and what their new values should be. +- *Example*: Set `status` to "Closed" on the related Task. + +### 4. Create Settings (For Create New) +When creating a new record, you specify the **DocType** (e.g., "Task") and fill in all the required fields. FlexiRule will then create the record and save it automatically. + +## Example: Auto-Task Creation +**Scenario**: You want to create a "Follow-up Task" every time a Sales Order over $10,000 is submitted. +1. **Check**: Is `doc.grand_total` > 10000? +2. **True Path**: Connect to an **Update Record** block. +3. **Settings**: + - **Action**: Create New + - **DocType**: Task + - **Mappings**: + - `subject`: "Follow up on Large Order `doc.name`" + - `description`: "Check in with the customer regarding their recent purchase." + - `priority`: "High" + +## Tips for Success + +- **Verify First**: Before updating an existing record, it's a good idea to use a **Query Records** block to make sure the record actually exists. +- **Required Fields**: When creating a new record, make sure you provide values for all "Mandatory" fields in that DocType, or the creation will fail. +- **Avoid Loops**: Be careful not to create a record that triggers another rule which then updates the original record—this can cause a "loop." FlexiRule has built-in protection, but it's best to design your rules to avoid this. diff --git a/content/en/action-types/wait.md b/content/en/core-actions/wait.md similarity index 100% rename from content/en/action-types/wait.md rename to content/en/core-actions/wait.md diff --git a/content/en/getting-started/_index.md b/content/en/getting-started/_index.md index eb49b32..3c1e97b 100644 --- a/content/en/getting-started/_index.md +++ b/content/en/getting-started/_index.md @@ -1,5 +1,21 @@ --- -title: Getting Started -weight: 20 -description: A step-by-step guide for non-technical users to build their first automation. +title: Introduction +weight: 10 +description: Welcome to FlexiRule. Learn about the core philosophy and why it is the preferred solution for Frappe automation. --- + +Welcome to the FlexiRule documentation. This section provides a comprehensive overview of the platform's vision, architecture, and core capabilities. + +Whether you are a functional consultant looking to automate business processes or a developer seeking to reduce technical debt, these pages will provide the foundation you need to succeed with FlexiRule. + +### Start Your Journey + +1. **{{< relref "introduction.md" >}}**: Understand the fundamental purpose of FlexiRule and the problems it solves. +2. **{{< relref "why-flexirule.md" >}}**: Explore the business value and agility provided by visual orchestration. +3. **{{< relref "erpnext-need.md" >}}**: Learn how FlexiRule complements standard ERPNext features. +4. **{{< relref "do-i-need-flexirule.md" >}}**: Determine if FlexiRule is the right fit for your organization. +5. **{{< relref "better-than-hard-coded.md" >}}**: A detailed comparison with traditional hard-coded customizations. +6. **{{< relref "performance.md" >}}**: Deep dive into the architectural optimizations powering the engine. +7. **{{< relref "core-concepts.md" >}}**: Master the fundamental building blocks of the ecosystem. +8. **{{< relref "architecture.md" >}}**: A technical overview of the system stack and execution pipeline. +9. **{{< relref "key-capabilities.md" >}}**: Functional highlights and major features of the platform. diff --git a/content/en/introduction/architecture.md b/content/en/getting-started/architecture.md similarity index 100% rename from content/en/introduction/architecture.md rename to content/en/getting-started/architecture.md diff --git a/content/en/introduction/better-than-hard-coded.md b/content/en/getting-started/better-than-hard-coded.md similarity index 100% rename from content/en/introduction/better-than-hard-coded.md rename to content/en/getting-started/better-than-hard-coded.md diff --git a/content/en/introduction/core-concepts.md b/content/en/getting-started/core-concepts.md similarity index 100% rename from content/en/introduction/core-concepts.md rename to content/en/getting-started/core-concepts.md diff --git a/content/en/introduction/do-i-need-flexirule.md b/content/en/getting-started/do-i-need-flexirule.md similarity index 100% rename from content/en/introduction/do-i-need-flexirule.md rename to content/en/getting-started/do-i-need-flexirule.md diff --git a/content/en/introduction/erpnext-need.md b/content/en/getting-started/erpnext-need.md similarity index 100% rename from content/en/introduction/erpnext-need.md rename to content/en/getting-started/erpnext-need.md diff --git a/content/en/getting-started/introduction.md b/content/en/getting-started/introduction.md new file mode 100644 index 0000000..7a2c03c --- /dev/null +++ b/content/en/getting-started/introduction.md @@ -0,0 +1,28 @@ +--- +title: Introduction +weight: 10 +description: A high-level overview of FlexiRule and how it helps you manage business logic. +--- + +# Introduction to FlexiRule + +FlexiRule is a visual tool for Frappe and ERPNext that lets you design and manage business processes without writing code. It centralizes your business logic into a clear, visual canvas where you can see exactly how your system behaves. + +## Why use FlexiRule? + +In many systems, business rules are hidden in different places, making it hard to understand the "big picture." FlexiRule brings everything together into one visual map. + +- **Visual Clarity**: See your business flow at a glance. +- **Easy Changes**: Update your logic by moving blocks on a canvas instead of editing code files. +- **Traceability**: See exactly what happened during a process, making it easy to fix issues. +- **Built for Business**: Focus on the *outcome* of your process rather than the technical implementation. + +## How it Works + +Instead of writing scripts, you build **Rules** by connecting different **Blocks**. Each block performs a specific task, such as checking a condition, updating a record, or sending an email. + +1. **Trigger**: Something happens in the system (e.g., a Sales Order is saved). +2. **Execution**: FlexiRule follows the path you designed on the canvas. +3. **Outcome**: The system performs the actions you defined. + +FlexiRule works seamlessly with your existing ERPNext setup, giving you more control over your automations without adding complexity. diff --git a/content/en/introduction/key-capabilities.md b/content/en/getting-started/key-capabilities.md similarity index 100% rename from content/en/introduction/key-capabilities.md rename to content/en/getting-started/key-capabilities.md diff --git a/content/en/introduction/performance.md b/content/en/getting-started/performance.md similarity index 100% rename from content/en/introduction/performance.md rename to content/en/getting-started/performance.md diff --git a/content/en/introduction/why-flexirule.md b/content/en/getting-started/why-flexirule.md similarity index 100% rename from content/en/introduction/why-flexirule.md rename to content/en/getting-started/why-flexirule.md diff --git a/content/en/introduction/_index.md b/content/en/introduction/_index.md deleted file mode 100644 index 75b5a0c..0000000 --- a/content/en/introduction/_index.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: Introduction -weight: 10 -description: Welcome to FlexiRule. Learn about the core philosophy and why it is the preferred solution for Frappe automation. ---- - -Welcome to the FlexiRule documentation. This section provides a comprehensive overview of the platform's vision, architecture, and core capabilities. - -Whether you are a functional consultant looking to automate business processes or a developer seeking to reduce technical debt, these pages will provide the foundation you need to succeed with FlexiRule. - -### Start Your Journey - -1. **{{< relref "what-is-flexirule.md" >}}**: Understand the fundamental purpose of FlexiRule and the problems it solves. -2. **{{< relref "why-flexirule.md" >}}**: Explore the business value and agility provided by visual orchestration. -3. **{{< relref "erpnext-need.md" >}}**: Learn how FlexiRule complements standard ERPNext features. -4. **{{< relref "do-i-need-flexirule.md" >}}**: Determine if FlexiRule is the right fit for your organization. -5. **{{< relref "better-than-hard-coded.md" >}}**: A detailed comparison with traditional hard-coded customizations. -6. **{{< relref "performance.md" >}}**: Deep dive into the architectural optimizations powering the engine. -7. **{{< relref "core-concepts.md" >}}**: Master the fundamental building blocks of the ecosystem. -8. **{{< relref "architecture.md" >}}**: A technical overview of the system stack and execution pipeline. -9. **{{< relref "key-capabilities.md" >}}**: Functional highlights and major features of the platform. diff --git a/content/en/introduction/what-is-flexirule.md b/content/en/introduction/what-is-flexirule.md deleted file mode 100644 index b9d5b50..0000000 --- a/content/en/introduction/what-is-flexirule.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: What is FlexiRule? -weight: 10 -description: A high-level overview of FlexiRule and its role in the Frappe ecosystem. ---- - -# What is FlexiRule? - -FlexiRule is a **Visual Rule Engineering & Orchestration Engine** built specifically for the Frappe Framework and ERPNext. It provides a visual, graph-based layer that allows you to design, execute, and manage complex business logic without writing scattered Python code. - -In modern enterprise systems, business logic often evolves into a fragmented web of Python hooks, server scripts, and custom app overrides. This "technical debt" makes execution order difficult to track, debugging nearly impossible, and system upgrades risky. FlexiRule changes this paradigm by centralizing logic into a visual, auditable orchestration layer. - -## The Problem: "Hook Hell" - -As ERPNext implementations grow, developers typically resort to: -1. **Python Hooks**: Hidden in multiple custom apps. -2. **Server Scripts**: Hard to version control and test. -3. **Client Scripts**: Fragmented logic across the UI. - -This leads to **Hook Hell**, where it's unclear which logic runs first, why a document was modified, or how to change a process without breaking unrelated features. - -## The Solution: Visual Orchestration - -FlexiRule sits as a middle layer between the Frappe Framework and your business processes. Instead of writing code, you build **Rules** on a visual canvas. - -- **Deterministic**: You define the exact execution path. -- **Observable**: Every step is logged and traceable on the canvas. -- **Safe**: Built-in validation, cycle detection, and sandboxing prevent system instability. - -## Role in the Ecosystem - -FlexiRule is not a replacement for Frappe; it is an enhancement. It leverages standard Frappe features—like DocTypes, Events, and Permissions—while providing a superior way to organize the logic that connects them. - -Whether you are automating a simple notification or a multi-stage credit approval process, FlexiRule provides the tools to build it visually and manage it professionally. diff --git a/content/en/rule-builder/_index.md b/content/en/rule-builder/_index.md deleted file mode 100644 index e117765..0000000 --- a/content/en/rule-builder/_index.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Rule Builder Guide -weight: 40 -description: Deep dive into the Visual Rule Builder UI and configuration. ---- diff --git a/content/en/rule-builder/adding-managing-actions.md b/content/en/rule-builder/adding-managing-actions.md deleted file mode 100644 index 428a1a6..0000000 --- a/content/en/rule-builder/adding-managing-actions.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: Adding and Managing Actions -description: Learn how to use the Action Zone to build your rule logic. -weight: 20 ---- - -# Adding and Managing Actions - -Building logic in FlexiRule is centered around adding and connecting "Action" nodes. - -## The Action Zone - -The **Action Zone** is the primary way to add new logic. It provides a searchable menu of all available actions. - -{{< video src="/images/add-action-from-action-zone.webm" autoplay="true" loop="true" muted="true" >}} - -### How to Add an Action -1. **Hover**: Hover your mouse over any connection line or empty space on the canvas. -2. **Trigger**: Click the `+` icon that appears. -3. **Search & Select**: Browse categories or type to find the action you need (e.g., "Email" or "Update Record"). -4. **Insert**: The new node is automatically inserted and connected into your flow. - -## Managing Connections - -### Reconnecting Nodes -If you delete a node between two others, FlexiRule intelligently heals the connection to maintain your logic flow. - -{{< video src="/images/remove-a-node-will-dynamically-reconnet-nodes.webm" >}} - -### Manual Connections -You can also manually connect nodes by dragging from the output handle of one node to the input handle of another. - -## Intelligent Configuration - -When you select an action, a configuration panel opens on the right. - -- **Smart Pickers**: Field pickers only show variables that are actually available at that point in the rule. -- **Validation**: The builder alerts you if required fields are missing before you save. diff --git a/content/en/rule-builder/canvas-navigation.md b/content/en/rule-builder/canvas-navigation.md deleted file mode 100644 index bb87973..0000000 --- a/content/en/rule-builder/canvas-navigation.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: Canvas Navigation -description: Learn how to navigate and use the visual Rule Builder canvas. -weight: 10 -aliases: - - /docs/user-guide/rule-builder/ ---- - -# Canvas Navigation - -The Rule Builder is your visual workspace for designing business logic. It provides a drag-and-drop canvas where you can orchestrate workflows while maintaining full visibility into the execution flow. - -![Rule Builder Overview](/images/flexirule-canvas-view.png) - -## Core Canvas Interactions - -### Moving and Zooming -- **Pan**: Click and drag any empty space on the canvas to move around. -- **Zoom**: Use your mouse wheel or the zoom controls in the corner to adjust the view. - -### Working with Nodes -- **Select**: Click a node to select it and open its configuration panel. -- **Move**: Drag a node to reposition it. -- **Delete**: Select a node and press `Backspace` or `Delete`. The builder will automatically attempt to reconnect the remaining nodes. - -### Bulk Actions -You can select multiple nodes by holding `Shift` and dragging a selection box. This allows you to move or copy groups of logic at once. - -{{< video src="/images/shift-click-nodes-to-copy.webm" >}} - -## Debugging on the Canvas - -The Rule Builder includes built-in tools to test your rules in real-time. - -### Visual Execution Path -When you run a test, the builder highlights the exact path taken during execution, showing you exactly which nodes were triggered. - -{{< video src="/images/debug-rule-view-execution-path.webm" >}} - -### Inspecting Results -You can click on any node after a test run to see its specific results, including modified variables and return values. - -![Debug View Return Result](/images/debug-view-return-result.png) - -## Examples {#examples} - -For more information on how to build rules, see our [Quick Start Guide]({{< relref "getting-started/quick-start" >}}). diff --git a/content/en/using-the-builder/_index.md b/content/en/using-the-builder/_index.md new file mode 100644 index 0000000..7618ece --- /dev/null +++ b/content/en/using-the-builder/_index.md @@ -0,0 +1,9 @@ +--- +title: Using the Builder +description: Master the visual canvas and learn how to design complex business rules. +weight: 25 +--- + +# Using the Builder + +Learn how to navigate the FlexiRule canvas, add logic blocks, and manage your rules. diff --git a/content/en/using-the-builder/adding-managing-actions.md b/content/en/using-the-builder/adding-managing-actions.md new file mode 100644 index 0000000..26d40ff --- /dev/null +++ b/content/en/using-the-builder/adding-managing-actions.md @@ -0,0 +1,38 @@ +--- +title: Adding and Managing Blocks +description: Learn how to add new logic to your rule using the Action Zone. +weight: 20 +--- + +# Adding and Managing Blocks + +Building a rule is as simple as adding **Blocks** to your canvas and connecting them. Each block represents a specific task or decision. + +## Adding New Blocks + +The easiest way to add logic is using the **Action Zone**. + +1. **Find a Connection**: Hover your mouse over any line or empty space where you want to add a step. +2. **Click the Plus (+)**: A small plus button will appear. +3. **Choose your Block**: A menu will pop up with all the available tasks (like "Set Value", "Notify", or "Check"). You can search for what you need. +4. **Configure**: Once added, click the block to open its settings on the right side of the screen. + +## Managing Your Flow + +FlexiRule helps you keep your logic organized and connected. + +- **Automatic Reconnect**: If you delete a block that is in the middle of a line, FlexiRule will automatically connect the blocks before and after it so the flow isn't broken. +- **Manual Dragging**: You can change the path of your rule by clicking and dragging a connection line from one block to another. +- **Copy and Paste**: You can select a block (or a group of blocks) and copy them to use in another part of your rule or even in a different rule entirely. + +## Configuration Panel + +When you select a block, the configuration panel on the right helps you set it up correctly: + +- **Helpful Suggestions**: When choosing fields, FlexiRule only shows you information that is relevant to that specific step. +- **Error Checks**: If you miss a required setting, the builder will highlight it so you can fix it before saving your rule. + +## Tips for Success + +- **Label Your Blocks**: You can give each block a custom name (like "Check Credit Limit" instead of just "Check"). This makes your rule much easier to read for others. +- **Add Comments**: If a part of your rule is particularly important, use a comment block to explain *why* it works that way. diff --git a/content/en/using-the-builder/canvas-navigation.md b/content/en/using-the-builder/canvas-navigation.md new file mode 100644 index 0000000..8d2c3ef --- /dev/null +++ b/content/en/using-the-builder/canvas-navigation.md @@ -0,0 +1,40 @@ +--- +title: Navigating the Canvas +description: Learn how to use the visual workspace to design your business rules. +weight: 10 +--- + +# Navigating the Canvas + +The Rule Builder is a visual workspace where you design your business logic. Think of it as a digital whiteboard where you can map out exactly how your processes should work. + +## Moving Around + +- **Moving the View**: Click and drag on any empty space to pan around your workspace. +- **Zooming**: Use your mouse wheel to zoom in for detail or zoom out to see the entire process. + +## Managing Blocks + +Your rule is made up of **Blocks** connected by lines. +- **Select**: Click a block to see its settings. +- **Move**: Drag a block to change its position on the canvas. +- **Delete**: Click a block and press your `Delete` key to remove it. + +## Connecting the Flow + +Lines represent the path your rule follows. +- Most blocks have a "Next" output. +- Decision blocks (like **Check**) have "True" and "False" paths. +- To connect blocks, click and drag from one block's output point to another block's input point. + +## Seeing the Results + +One of the best features of the canvas is seeing your rule in action: +- **Highlighted Paths**: When you test a rule, the canvas highlights the exact path taken in green. +- **Inspect Outcomes**: You can click on any block after a test to see exactly what happened at that step (e.g., what value was set or which way a check went). + +## Tips for a Clean Canvas + +- **Organize Left to Right**: It's usually easiest to read rules that flow from left to right. +- **Use Comments**: You can add notes to your canvas to explain complex parts of your logic to other users. +- **Group Related Steps**: Keep blocks that perform a similar task close together to make the rule easier to understand. diff --git a/content/en/rule-builder/lifecycle-execution.md b/content/en/using-the-builder/lifecycle-execution.md similarity index 100% rename from content/en/rule-builder/lifecycle-execution.md rename to content/en/using-the-builder/lifecycle-execution.md diff --git a/content/en/tutorials/_index.md b/content/en/using-the-builder/tutorials/_index.md similarity index 100% rename from content/en/tutorials/_index.md rename to content/en/using-the-builder/tutorials/_index.md diff --git a/content/en/tutorials/automatic-assignment.md b/content/en/using-the-builder/tutorials/automatic-assignment.md similarity index 100% rename from content/en/tutorials/automatic-assignment.md rename to content/en/using-the-builder/tutorials/automatic-assignment.md diff --git a/content/en/tutorials/manager-approval.md b/content/en/using-the-builder/tutorials/manager-approval.md similarity index 100% rename from content/en/tutorials/manager-approval.md rename to content/en/using-the-builder/tutorials/manager-approval.md diff --git a/content/en/tutorials/send-email-sales-order.md b/content/en/using-the-builder/tutorials/send-email-sales-order.md similarity index 100% rename from content/en/tutorials/send-email-sales-order.md rename to content/en/using-the-builder/tutorials/send-email-sales-order.md