From 560ab8efd227ceb89bbecf50f44a3c70e60b6891 Mon Sep 17 00:00:00 2001 From: abdoruzaqi <245876665+abdoruzaqi@users.noreply.github.com> Date: Wed, 24 Jun 2026 01:41:57 +0000 Subject: [PATCH] feat: user-first documentation overhaul - Reorganized directory structure to match Hugo content organization. - Rewrote all core action guides with non-technical language and business-focused workflows. - Isolated technical implementation details to the advanced reference section. - Renamed "Document Action" to "Update Record" for UI consistency. - Ensured all internal links and front matter are correctly configured. --- content/en/_index.md | 16 ++--- .../architecture/actions/_index.md | 2 +- .../architecture/actions/assignment.md | 14 +++++ .../architecture/actions/process.md | 13 ++++ .../architecture/actions/sub-rule.md | 13 ++++ .../architecture/actions/switch.md | 13 ++++ .../{document-action.md => update-record.md} | 0 .../architecture/actions/wait.md | 13 ++++ .../reference/execution/_index.md | 2 +- .../{document-action.md => update-record.md} | 0 content/en/core-actions/assignment.md | 28 ++++----- content/en/core-actions/condition.md | 32 +++++----- content/en/core-actions/entry-action.md | 12 ++-- content/en/core-actions/loop.md | 26 ++++---- content/en/core-actions/notify-action.md | 34 +++++------ content/en/core-actions/process.md | 18 +++--- content/en/core-actions/query-records.md | 61 ++++++++----------- content/en/core-actions/stop-error.md | 18 +++--- content/en/core-actions/sub-rule.md | 16 ++--- content/en/core-actions/switch.md | 28 ++++----- content/en/core-actions/update-record.md | 38 ++++++------ content/en/core-actions/wait.md | 18 +++--- content/en/getting-started/introduction.md | 12 ++-- content/en/getting-started/quick-start.md | 40 ++++++------ .../adding-managing-actions.md | 30 ++++----- .../en/using-the-builder/canvas-navigation.md | 34 +++++------ 26 files changed, 294 insertions(+), 237 deletions(-) create mode 100644 content/en/advanced-reference/architecture/actions/assignment.md create mode 100644 content/en/advanced-reference/architecture/actions/process.md create mode 100644 content/en/advanced-reference/architecture/actions/sub-rule.md create mode 100644 content/en/advanced-reference/architecture/actions/switch.md rename content/en/advanced-reference/architecture/actions/{document-action.md => update-record.md} (100%) create mode 100644 content/en/advanced-reference/architecture/actions/wait.md rename content/en/advanced-reference/reference/execution/{document-action.md => update-record.md} (100%) diff --git a/content/en/_index.md b/content/en/_index.md index d258ce7..ec44fd4 100644 --- a/content/en/_index.md +++ b/content/en/_index.md @@ -4,21 +4,21 @@ title: "FlexiRule: The Visual Logic Platform" # Welcome to FlexiRule -FlexiRule is a high-performance, visual automation engine for the Frappe Framework. It allows you to design, execute, and manage complex business logic without writing boilerplate code. +FlexiRule is a visual automation platform that helps you build business logic without writing code. It transforms complex workflows into clear, manageable diagrams that anyone can understand. ![FlexiRule Logo](/landing-page/flexiRule.png) -## Design Your Logic Visually +## Build Your Logic Visually -With our intuitive drag-and-drop interface, you can build sophisticated workflows that are easy to understand and maintain. +With our simple drag-and-drop builder, you can create powerful automations that are easy to read and maintain. ![Rule Builder Canvas](/landing-page/rule_builder.png) -## Key Features +## Why you'll love it -- **Visual Rule Builder**: Create logic flows using a node-based interface. -- **No-Code Experience**: Empower business users to participate in logic design. -- **Native Frappe Integration**: Deeply integrated with DocTypes, Hooks, and the Frappe security model. -- **Enterprise-Grade**: Built for performance, auditability, and scale. +- **Drag-and-Drop**: Build processes visually using simple blocks. +- **No Coding Required**: Empower your entire team to design and manage logic. +- **Built-In Security**: Your data stays safe within your existing system. +- **Fast and Reliable**: Designed to handle even the most complex enterprise workflows. [Get Started with our Guide]({{< relref "getting-started" >}}) diff --git a/content/en/advanced-reference/architecture/actions/_index.md b/content/en/advanced-reference/architecture/actions/_index.md index 9322473..6df72ed 100644 --- a/content/en/advanced-reference/architecture/actions/_index.md +++ b/content/en/advanced-reference/architecture/actions/_index.md @@ -11,7 +11,7 @@ Welcome to the Actions section. This section contains detailed information about ## Sub-pages - **[Condition](condition.md)** -- **[Document Action](document-action.md)** +- **[Update Record](update-record.md)** - **[Entry](entry.md)** - **[Loop](loop.md)** - **[Notify](notify.md)** diff --git a/content/en/advanced-reference/architecture/actions/assignment.md b/content/en/advanced-reference/architecture/actions/assignment.md new file mode 100644 index 0000000..89cb783 --- /dev/null +++ b/content/en/advanced-reference/architecture/actions/assignment.md @@ -0,0 +1,14 @@ +--- +title: 'Assignment Action: Architecture' +description: Technical implementation of the value mutation engine. +weight: 50 +--- + +# Assignment Action Architecture + +The **Assignment** action is implemented via the `AssignmentActionHandler`. It handles the sequential execution of mutations on the execution context. + +## Core Implementation +- **Class**: `AssignmentActionHandler` in `flexirule/ruleflow/core/action_handlers/assignment.py`. +- **Logic**: Iterates through the `assignments` list and applies `frappe.set_value` or variable updates using the `ValueResolver`. +- **Normalization**: If a pipeline is defined, it passes the value through `NormalizationValueResolver` before assignment. diff --git a/content/en/advanced-reference/architecture/actions/process.md b/content/en/advanced-reference/architecture/actions/process.md new file mode 100644 index 0000000..a9ec900 --- /dev/null +++ b/content/en/advanced-reference/architecture/actions/process.md @@ -0,0 +1,13 @@ +--- +title: 'Process Action: Architecture' +description: Technical implementation of external process execution. +weight: 110 +--- + +# Process Action Architecture + +The **Process** action integrates with the `ProcessRegistry` to execute arbitrary Python or JavaScript logic. + +## Core Implementation +- **Class**: `ProcessActionHandler` in `flexirule/ruleflow/core/action_handlers/process.py`. +- **Logic**: Looks up the process definition by name. It then prepares the input arguments and executes the process either synchronously or via `frappe.enqueue`. diff --git a/content/en/advanced-reference/architecture/actions/sub-rule.md b/content/en/advanced-reference/architecture/actions/sub-rule.md new file mode 100644 index 0000000..32a18e4 --- /dev/null +++ b/content/en/advanced-reference/architecture/actions/sub-rule.md @@ -0,0 +1,13 @@ +--- +title: 'Sub-rule Action: Architecture' +description: Technical implementation of nested engine execution. +weight: 90 +--- + +# Sub-rule Action Architecture + +The **Sub-rule** action allows for recursive engine calls by spawning a child `RuleEngine` instance. + +## Core Implementation +- **Class**: `SubRuleActionHandler` in `flexirule/ruleflow/core/action_handlers/sub_rule.py`. +- **Context Handling**: Clones the current `ExecutionContext`, applies any input mappings for the child rule, and waits for the child execution to complete (unless configured as async). diff --git a/content/en/advanced-reference/architecture/actions/switch.md b/content/en/advanced-reference/architecture/actions/switch.md new file mode 100644 index 0000000..a89ee6e --- /dev/null +++ b/content/en/advanced-reference/architecture/actions/switch.md @@ -0,0 +1,13 @@ +--- +title: 'Switch Action: Architecture' +description: Technical implementation of multi-path branching. +weight: 70 +--- + +# Switch Action Architecture + +The **Switch** action uses the `SwitchActionHandler` to evaluate a single expression and match it against a map of target next steps. + +## Core Implementation +- **Class**: `SwitchActionHandler` in `flexirule/ruleflow/core/action_handlers/switch.py`. +- **Logic**: Evaluates the `switch_on` expression. It then looks up the result in the `cases` dictionary. If no match is found, it falls back to the `default_next_step`. diff --git a/content/en/advanced-reference/architecture/actions/document-action.md b/content/en/advanced-reference/architecture/actions/update-record.md similarity index 100% rename from content/en/advanced-reference/architecture/actions/document-action.md rename to content/en/advanced-reference/architecture/actions/update-record.md diff --git a/content/en/advanced-reference/architecture/actions/wait.md b/content/en/advanced-reference/architecture/actions/wait.md new file mode 100644 index 0000000..f31fb7d --- /dev/null +++ b/content/en/advanced-reference/architecture/actions/wait.md @@ -0,0 +1,13 @@ +--- +title: 'Wait Action: Architecture' +description: Technical implementation of execution suspension. +weight: 80 +--- + +# Wait Action Architecture + +The **Wait** action leverages Frappe's background job system and the `Scheduler` to suspend and resume rule execution. + +## Core Implementation +- **Class**: `WaitActionHandler` in `flexirule/ruleflow/core/action_handlers/simple_actions.py`. +- **Mechanism**: Calculates the resume timestamp. It then creates a `RuleSuspension` record and schedules a background job to re-trigger the engine at the appropriate time. diff --git a/content/en/advanced-reference/reference/execution/_index.md b/content/en/advanced-reference/reference/execution/_index.md index de7e654..15e57d5 100644 --- a/content/en/advanced-reference/reference/execution/_index.md +++ b/content/en/advanced-reference/reference/execution/_index.md @@ -11,7 +11,7 @@ Welcome to the Execution section. This section contains detailed information abo ## Sub-pages - **[Condition](condition.md)** -- **[Document Action](document-action.md)** +- **[Update Record](update-record.md)** - **[Entry](entry.md)** - **[Loop](loop.md)** - **[Notify](notify.md)** diff --git a/content/en/advanced-reference/reference/execution/document-action.md b/content/en/advanced-reference/reference/execution/update-record.md similarity index 100% rename from content/en/advanced-reference/reference/execution/document-action.md rename to content/en/advanced-reference/reference/execution/update-record.md diff --git a/content/en/core-actions/assignment.md b/content/en/core-actions/assignment.md index 47f2397..4f0cf38 100644 --- a/content/en/core-actions/assignment.md +++ b/content/en/core-actions/assignment.md @@ -6,23 +6,23 @@ aliases: - /docs/actions/assignment/ --- -# Assignment Action +# Assignment -The **Assignment** action is used to change values in your rule. This can include updating fields on the document currently being processed or setting temporary variables for use in later steps. +Use the **Assignment** block to set or change values while your rule is running. It's like taking a note or updating a field on your record. -## Types of Assignments +## Common Uses -### 1. Document Field Assignment -Directly change a field on the current document (the one that triggered the rule). -- **Example**: Set `status` to "Pending Review". +### 1. Update the Current Record +Change a field on the record that started the rule. +- **Example**: Automatically set the `Status` of a new ticket to "In Progress". -### 2. Context Variable Assignment {#context-variables-vars} -Create or update a "Variable" that exists only while the rule is running. This is useful for temporary calculations. -- **Example**: Calculate a total `tax_amount = doc.amount * 0.15`. +### 2. Save a Temporary Note (Variables) {#context-variables-vars} +Create a "Variable" to store a piece of information for later. This information isn't saved to your database; it's only used while the rule is running. +- **Example**: Calculate the tax for an order and save it as `Tax Amount` so you can use it in an email later. -## Batch Assignments -You can define multiple assignments within a single node. They are executed sequentially from top to bottom. +## Do Multiple at Once +You can list as many assignments as you want in a single block. FlexiRule will process them one by one from top to bottom. -## Normalization and Cleaning -Assignments support "Pipelines" to clean or transform data as it's being set. -- **Example**: Trimming whitespace from a string or converting a name to uppercase. +## Clean Your Data +You can also use assignments to "clean" information before it's saved. +- **Example**: Automatically capitalize a customer's name or remove extra spaces from an email address. diff --git a/content/en/core-actions/condition.md b/content/en/core-actions/condition.md index 3de2916..48793b1 100644 --- a/content/en/core-actions/condition.md +++ b/content/en/core-actions/condition.md @@ -6,25 +6,25 @@ aliases: - /docs/actions/condition/ --- -# Condition Action +# Condition -The **Condition** action allows you to create branching logic in your rules. It evaluates a set of rules and directs the execution flow down either a **True** or **False** path. +Use the **Condition** block to make decisions in your rule. It acts like a fork in the road: if your rule is met, it follows the **True** (Green) path; if not, it follows the **False** (Red) path. -## How to Configure +## How to Set It Up -### 1. The Rule Builder -Use the integrated condition builder to define your logic. -- **Field**: Select a field from the document or a variable. -- **Operator**: Choose how to compare (e.g., "is", "is not", "contains", "is greater than"). -- **Value**: The value to compare against. +### 1. Build Your Check +Use the simple builder to define your logic: +- **Field**: Pick the item you want to check (e.g., "Total Amount"). +- **Check**: Choose how to compare it (e.g., "is more than", "starts with", "is exactly"). +- **Value**: Type in the value you are looking for (e.g., "5000"). -### 2. Grouping Logic (And/Or) -- **AND**: All conditions in the group must be true. -- **OR**: At least one condition in the group must be true. +### 2. Combining Checks (And/Or) +- **AND**: Use this when *every* check must be true. +- **OR**: Use this when *at least one* check must be true. ## Simple Example -**Scenario**: Only notify a manager if an order is over $5,000. -1. Add a **Condition** node. -2. Set rule: `grand_total` is greater than `5000`. -3. Connect the **True** path to a **Notify** action. -4. Leave the **False** path empty or connect it to a different step. +**Goal**: Only send an alert if a Sales Order is over $5,000. +1. Add a **Condition** block. +2. Set it to check if `Total Amount` is more than `5000`. +3. Connect the **True** path to a **Notify** block. +4. Leave the **False** path alone, or connect it to something else if you want a different action for smaller orders. diff --git a/content/en/core-actions/entry-action.md b/content/en/core-actions/entry-action.md index 6a78668..73c1faa 100644 --- a/content/en/core-actions/entry-action.md +++ b/content/en/core-actions/entry-action.md @@ -8,12 +8,12 @@ aliases: # Entry Action -Every business rule starts with an **Entry Action**. This node represents the document and data that triggered the rule. +Every business rule starts with an **Entry Action**. This block represents the starting point and the record 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. +## What is it? +Think of the Entry Action as the "start" button. It holds all the information from the record that kicked off the rule (like a Sales Order or a Support Ticket) and makes that information available to every other block in your flow. -## 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. +## Setting Early Limits +You can set "Entry Conditions" on your rule. These act like a gatekeeper: if the record doesn't meet these requirements, the rule won't even start. This is great for keeping your system efficient. -**Note**: For branching logic *after* the rule has already started, use the [Condition Action]({{< relref "condition" >}}). +**Note**: If you want to make decisions *after* a rule has already started running, use a [Condition]({{< relref "condition" >}}) block instead. diff --git a/content/en/core-actions/loop.md b/content/en/core-actions/loop.md index e71cbff..040123b 100644 --- a/content/en/core-actions/loop.md +++ b/content/en/core-actions/loop.md @@ -6,22 +6,22 @@ aliases: - /docs/actions/loop/ --- -# Loop Action +# Loop -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. +Use the **Loop** block when you need to perform the same action on a group of items. It's like going through a checklist and doing a task for every item on that list. ## 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. +1. **The List**: Choose the group of items you want to process (usually from a **Query Records** block). +2. **The Action**: Connect any action you want to repeat to the Loop's output. +3. **The Result**: FlexiRule will run those actions once for every single item in your list. -## 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. +## Simple Example +**Goal**: Send a reminder email for every overdue invoice. +1. **Find Records**: Use a **Query Records** block to find all "Overdue Invoices". +2. **Loop**: Connect that list to a **Loop** block. +3. **Notify**: Connect a **Notify** block to the Loop. It will send a separate email for every invoice found. -## 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**. +## Pro Tips +- **Be Selective**: Only loop through the items you really need to process. Use filters in your search to keep the list as short as possible. +- **Keep it Simple**: If your loop starts looking like a giant spiderweb, consider using a **Sub-rule** to keep things tidy. diff --git a/content/en/core-actions/notify-action.md b/content/en/core-actions/notify-action.md index 099f731..cbeca90 100644 --- a/content/en/core-actions/notify-action.md +++ b/content/en/core-actions/notify-action.md @@ -6,27 +6,27 @@ aliases: - /docs/actions/notify/ --- -# Notify Action +# Notify -The **Notify** action is used to communicate information to users or external systems. +Use the **Notify** block to send messages to your team or customers. -## Notification Types +## Ways to Notify ### 1. Email -Send a formatted email to one or more recipients. -- **Recipients**: Use static email addresses or dynamic ones (e.g., `doc.owner`). -- **Templates**: Select from existing Frappe Email Templates or write custom content. -- **Attachments**: Attach the current document as a PDF. +Send a professional email. +- **Who**: Send to fixed addresses or pick someone related to the record (like the "Owner"). +- **What**: Write your own message or use a pre-made template. +- **Attach**: You can automatically include the current record as a PDF. -### 2. System Notification -Create a notification within the Frappe Desk for a specific user or role. These appear in the notification bell icon. +### 2. Desktop Notification +Alert a user or a specific role within the system. These show up in the notification bell. -### 3. UI Toast -Display a temporary popup message (Toast) to the user who triggered the rule. -- **Types**: Success, Info, Warning, or Error. -- **Note**: This only works for rules triggered by manual UI actions (e.g., clicking Save). +### 3. Quick Alert (Toast) +Show a temporary pop-up message to the person currently using the system. +- **Options**: Success, Info, Warning, or Error. +- **Best for**: Giving instant feedback after someone saves or clicks a button. -## Configuration Steps -1. **Select Type**: Choose how you want to notify. -2. **Define Content**: Write your message. You can use `{{ doc.name }}` to include data from the document. -3. **Set Recipients**: Choose who should receive the notification. +## How to Set Up +1. **Pick Method**: Choose how you want to send the message. +2. **Write Message**: Type your content. You can include details from the record by using curly brackets, like `{name}`. +3. **Choose Recipients**: Select who needs to see the message. diff --git a/content/en/core-actions/process.md b/content/en/core-actions/process.md index 406a443..015573f 100644 --- a/content/en/core-actions/process.md +++ b/content/en/core-actions/process.md @@ -6,16 +6,16 @@ aliases: - /docs/actions/process/ --- -# Process Action +# Process -The **Process** action is used for advanced logic that goes beyond standard record updates or notifications. +The **Process** block is for advanced tasks that need a little extra power. Use it when you need to run custom logic or connect to other systems. ## When to Use -- **Custom Scripts**: Run a predefined Python or JavaScript process. -- **Heavy Calculations**: Offload complex math to a dedicated process to keep the UI responsive. -- **External Integrations**: Call third-party APIs or services. +- **Custom Logic**: Run a specific piece of custom code built by your team. +- **Big Calculations**: Handle complex math without slowing down your system. +- **Connect to Others**: Send or receive information from external tools and websites. -## Configuration -1. Select the **Process** you want to run. -2. Provide any required **Input Parameters**. -3. Use the **Return Value** in subsequent nodes of your rule. +## How to Set It Up +1. Choose the **Process** you want to run from the list. +2. Fill in any **Information** the process needs to start. +3. If the process sends back an answer, you can use that answer in the next steps of your rule. diff --git a/content/en/core-actions/query-records.md b/content/en/core-actions/query-records.md index b3b7e5a..faf8be7 100644 --- a/content/en/core-actions/query-records.md +++ b/content/en/core-actions/query-records.md @@ -8,49 +8,36 @@ aliases: # Query Records -The **Query Records** action allows your rule flows to fetch information from the database. It is the primary way to make decisions based on data that isn't already present in your current document. +Use the **Query Records** block to find information from elsewhere in your system. It's the best way to get data you need to make decisions or update other records. -## When to Use -- **Data Enrichment**: Fetching related fields (e.g., getting a Customer's "Territory"). -- **Validation**: Checking for duplicates or conflicting records. -- **Aggregations**: Calculating totals across multiple documents (e.g., "Sum of all unpaid invoices"). +## Common Uses +- **Find Details**: Get a customer's address or a product's price. +- **Check Records**: See if a similar record already exists before creating a new one. +- **Calculate Totals**: Add up all unpaid invoices for a specific client. -## Query Modes +## Ways to Search -| Mode | Returns | Best For | +| Search Type | What it finds | Best For | | :--- | :--- | :--- | -| **Query List** | List of Records | Finding multiple records to loop over. | -| **Query Doc** | Single Record | Fetching detailed info from a specific record. | -| **Exist Record** | Yes/No | Simple validation and existence checks. | -| **Aggregations** | Number | Totals, counts, and averages (Sum, Min, Max). | -| **Group By** | List of Totals | Summary data grouped by a category (e.g., Sales by Territory). | +| **Find List** | A group of records | Getting many items to process one by one. | +| **Find One** | A single record | Getting specific details from one item. | +| **Check Existence** | A "Yes" or "No" | Simple checks (e.g., "Does this customer exist?"). | +| **Totals & Math** | A single number | Counting items or adding up values (Sum, Average). | -## Advanced Querying +## How to Set Up -### Aggregations -Use this mode when you only need a single number. -- **Count**: How many records match the filter. -- **Sum**: The total of a specific numeric field. -- **Average/Min/Max**: Standard statistical calculations. +### 1. Choose What to Find +Pick the type of record you are looking for (e.g., "Sales Invoice"). -### Group By -Use this to summarize data into "buckets". -- **Example**: Get the total sales amount for each individual salesperson in the last month. +### 2. Set Your Filters +Filters tell FlexiRule exactly which records to look for. +- **Simple**: Find records where `Status` is "Draft". +- **Smart**: Find records that match your current document (e.g., "Find invoices for *this* customer"). +- **Time-Based**: Find records from "Last 7 Days" using the built-in date builder. -## How to Configure +### 3. Test and Refresh +Click **Refresh Schema**. This runs a quick test to make sure your search works and lets FlexiRule know which fields will be available for you to use in the next steps. -### 1. Select the DocType -Choose the type of record you want to find (e.g., "Sales Invoice"). - -### 2. Define Filters -Filters tell FlexiRule exactly which records to find. -- **Static Filters**: `status = "Draft"` -- **Dynamic Filters**: `customer = doc.customer` (matches the customer from the current document). -- **Date Formulas**: Use the formula builder for rolling windows like "Last 7 Days". - -### 3. Refresh Schema (Important) -After setting your query, click the **Refresh Schema** button. This performs a live test and makes the resulting fields available to use in later steps of your rule. - -## Common Tips -- **Always Filter**: Avoid searching the entire database without filters to keep your rules fast. -- **Check the Result**: Remember that **Query List** always returns a list of items, even if it only finds one. Use **Query Doc** if you only need one specific record. +## Pro Tips +- **Be Specific**: Use filters to narrow down your search. Searching everything can slow down your rule. +- **Pick the Right Type**: If you only need one specific record, use **Find One**. If you need to process a whole list, use **Find List**. diff --git a/content/en/core-actions/stop-error.md b/content/en/core-actions/stop-error.md index c9ff13f..be396d1 100644 --- a/content/en/core-actions/stop-error.md +++ b/content/en/core-actions/stop-error.md @@ -7,15 +7,15 @@ aliases: - /docs/actions/raise-error/ --- -# Stop and Error Handling +# Stop and Error -These nodes allow you to explicitly control the end of a rule or handle situations where something goes wrong. +Use these blocks to control exactly when your rule should finish or to stop it if something is wrong. -## Stop Action -The **Stop** action immediately ends the execution of the rule. -- **Use Case**: Use this inside a **Condition** to exit a rule early if certain criteria aren't met, preventing subsequent actions from running. +## Stop +The **Stop** block ends the rule immediately. +- **When to use**: Put this on the "False" path of a **Condition** if you want the rule to just quit if a check fails. -## Raise Error Action -The **Raise Error** action stops the rule and displays an error message to the user. -- **Use Case**: Use this for strict validation. For example, if a Sales Order is missing a required attachment, you can "Raise Error" with a custom message like "Please upload the signed contract before submitting." -- **Visual Feedback**: In the Frappe UI, this will appear as a standard error popup. +## Raise Error +The **Raise Error** block stops the rule and shows a warning message to the person using the system. +- **When to use**: Use this for strict rules. For example, if an order is missing a required file, you can stop the rule and show a message like "You must upload a contract before you can save this." +- **What the user sees**: A standard system pop-up with your custom message. diff --git a/content/en/core-actions/sub-rule.md b/content/en/core-actions/sub-rule.md index 70ce002..62e30dc 100644 --- a/content/en/core-actions/sub-rule.md +++ b/content/en/core-actions/sub-rule.md @@ -6,15 +6,15 @@ aliases: - /docs/actions/sub-rule/ --- -# Sub-rule Action +# Sub-rule -The **Sub-rule** action allows you to execute one rule from inside another. This helps keep your rules organized and allows you to reuse common logic. +The **Sub-rule** block lets you run one rule from inside another. It's a great way to keep your rules organized and reuse the same logic across different processes. -## Why Use Sub-rules? -- **Organization**: Break down very large, complex rules into smaller, manageable pieces. -- **Reusability**: Create a "standard approval" logic once and call it from many different rules. +## Why use Sub-rules? +- **Stay Organized**: Break giant, messy rules into small, easy-to-understand pieces. +- **Reuse Your Work**: Create a "Standard Approval" rule once and use it in ten different places. ## How to Use -1. Select the **Sub-rule** node. -2. Pick the existing rule you want to run. -3. **Pass Data**: Optionally pass specific variables or documents into the sub-rule. +1. Add a **Sub-rule** block. +2. Choose the existing rule you want to run. +3. **Share Information**: Decide which information from your current rule should be shared with the sub-rule. diff --git a/content/en/core-actions/switch.md b/content/en/core-actions/switch.md index a49791f..8e9d923 100644 --- a/content/en/core-actions/switch.md +++ b/content/en/core-actions/switch.md @@ -6,21 +6,21 @@ aliases: - /docs/actions/switch/ --- -# Switch Action +# Switch -The **Switch** action is like a multi-way branch. Instead of a simple "True/False" condition, it allows you to choose from many different paths based on the value of a field. +The **Switch** block is for choosing between many different paths. It's like a multi-way junction: you check a specific value, and then follow the path that matches. -## How to Configure +## How to Set It Up -1. **Select Field**: Choose the field or variable you want to check (e.g., `doc.priority`). -2. **Define Cases**: Create a "Case" for each possible value you want to handle. - - **Case: High**: Path for high-priority items. - - **Case: Medium**: Path for medium-priority items. -3. **Default Path**: Define what happens if the value doesn't match any of your cases. +1. **Pick the Field**: Choose the field you want to check (e.g., "Ticket Priority"). +2. **Add Your Cases**: Create a "Case" for every value you want to handle. + - **Case: High**: The path for high-priority items. + - **Case: Medium**: The path for medium-priority items. +3. **The Default Path**: Decide what happens if the value doesn't match any of your specific cases. -## Example -**Scenario**: Route a support ticket based on its category. -- **Switch** on `category`. -- **Path "Billing"**: Connect to a node that notifies the finance team. -- **Path "Technical"**: Connect to a node that notifies the support engineering team. -- **Path "General"**: Connect to the default path. +## Simple Example +**Goal**: Send support tickets to the right team based on their category. +- **Switch** on the `Category` field. +- **Path "Billing"**: Send a message to the Finance team. +- **Path "Technical"**: Send a message to the Engineering team. +- **Path "Everything Else"**: Use the Default path to send to general support. diff --git a/content/en/core-actions/update-record.md b/content/en/core-actions/update-record.md index f44da2f..3e169a6 100644 --- a/content/en/core-actions/update-record.md +++ b/content/en/core-actions/update-record.md @@ -6,26 +6,30 @@ aliases: - /docs/actions/document-action/ --- -# Update Record (Document Action) +# Update Record -The **Document Action** (often labeled as **Update Record** in the UI) allows you to manipulate documents in the system. +The **Update Record** block allows you to create, change, or delete information in your system. It is the main tool for making sure your data is always up to date. -## Operations +## Common Tasks -### 1. Create New -Create a brand new document in any DocType. -- **Set Fields**: Define the initial values for the new record. -- **Asynchronous**: For heavy operations, you can enable "Run in Background". +### 1. Create a New Record +Automatically create a new item (e.g., create a "Task" whenever a "Sales Order" is submitted). +- **Set Values**: Choose which information should be put into the new record. +- **Run in Background**: For bigger tasks, you can have FlexiRule handle them in the background so you don't have to wait. -### 2. Update Existing -Modify fields on an existing document. -- **Find the Record**: You must provide the "Name" (ID) of the document to update. Usually, this comes from a previous **Query Records** step. -- **Field Mapping**: Map values from your current rule context to the target document. +### 2. Update an Existing Record +Change information on a record that already exists. +- **Identify the Record**: Tell FlexiRule which specific record to change. Usually, you'll use a **Query Records** block right before this to find the right one. +- **Set Fields**: Pick which fields to change and what the new values should be. -### 3. Delete Record -Remove a document from the system. -- **Caution**: This action is permanent. Ensure you have proper filters set to target the correct record. +### 3. Add a Comment or Task +- **Post Comment**: Automatically add a note to the timeline of a record. +- **Assign Task (ToDo)**: Create a task for a team member and link it to the record. -## Best Practices -- **Use Validation**: Before updating a record, consider using a **Condition** to ensure the update is valid. -- **Chain Actions**: Frequently used with **Query Records** (to find the document) followed by **Update Record** (to modify it). +### 4. Delete a Record +Permanently remove a record from the system. +- **Note**: Use this with care, as deleted records cannot be easily recovered. + +## Pro Tips +- **Check First**: Use a **Condition** block before updating a record to make sure the change is allowed. +- **Search and Update**: Often, you'll use **Query Records** to find a group of items, then a **Loop**, and finally an **Update Record** inside the loop to change each one. diff --git a/content/en/core-actions/wait.md b/content/en/core-actions/wait.md index 2ba8fae..5dc8254 100644 --- a/content/en/core-actions/wait.md +++ b/content/en/core-actions/wait.md @@ -6,17 +6,17 @@ aliases: - /docs/actions/wait/ --- -# Wait Action +# Wait -The **Wait** action pauses the execution of your rule. This is useful for follow-up automations or time-delayed tasks. +The **Wait** block pauses your rule for a set amount of time. It's perfect for follow-up reminders or delayed tasks. ## Wait Options -- **Duration**: Wait for a specific amount of time (e.g., "2 days", "4 hours"). -- **Until Date**: Wait until a specific date and time reached. You can use fields from the document (e.g., `doc.due_date`). +- **Amount of Time**: Pause for a specific duration, like "2 days" or "4 hours". +- **Until a Specific Date**: Pause until a specific date and time is reached. You can use a date from your record, like a "Due Date". -## Example -**Scenario**: Send a reminder email 24 hours after a quote is sent. -1. Rule triggers when Quote is saved. -2. **Wait** action set for "1 day". -3. **Notify** action sends the reminder email. +## Simple Example +**Goal**: Send a follow-up email 24 hours after a quote is sent to a customer. +1. Your rule starts when a **Quote** is saved. +2. Add a **Wait** block and set it to "1 day". +3. Connect a **Notify** block after the Wait to send the reminder email. diff --git a/content/en/getting-started/introduction.md b/content/en/getting-started/introduction.md index 94709e6..0dec93e 100644 --- a/content/en/getting-started/introduction.md +++ b/content/en/getting-started/introduction.md @@ -8,14 +8,14 @@ aliases: # Introduction to FlexiRule -FlexiRule is a high-performance, visual automation engine for the Frappe Framework. It allows you to design, execute, and manage complex business logic without writing boilerplate code. +FlexiRule is a visual automation platform that helps you build business logic without writing code. It transforms complex workflows into clear, manageable diagrams that anyone can understand. -## Why FlexiRule? +## Why use FlexiRule? -- **Visual First**: Design logic flows using an intuitive node-based interface. -- **No-Code Experience**: Empower business users to participate in logic design. -- **Native Frappe Integration**: Deeply integrated with DocTypes, Hooks, and the Frappe security model. -- **Enterprise-Grade**: Built for performance, auditability, and scale. +- **Build Visually**: Design your business processes by connecting simple blocks, just like a flowchart. +- **Save Time**: Automate repetitive tasks like sending emails, updating statuses, or calculating totals in minutes. +- **Collaborate**: Bridge the gap between business requirements and technical implementation with a shared visual language. +- **Safe and Secure**: Built directly into your existing system, ensuring your data remains protected and compliant. diff --git a/content/en/getting-started/quick-start.md b/content/en/getting-started/quick-start.md index 4fe6de8..cb55fe8 100644 --- a/content/en/getting-started/quick-start.md +++ b/content/en/getting-started/quick-start.md @@ -6,28 +6,28 @@ weight: 20 # Quick Start Guide -Follow these steps to create and activate your first automated business rule. +Create and activate your first automated business rule in just a few minutes. -## 1. Create a New Rule -1. Navigate to the **Rule** list in the FlexiRule Desk. -2. Click **New**. -3. Give your rule a name (e.g., "Auto-Approve Low Value Orders"). -4. Select the **Reference DocType** (e.g., Sales Order). +## 1. Start Your Rule +1. Open the **Rule** list from your sidebar. +2. Click the **New** button. +3. Name your rule (e.g., "Auto-Approve Small Orders"). +4. Choose which record type triggers the rule (e.g., **Sales Order**). -## 2. Define the Trigger -In the **Triggers** section, decide when this rule should run: -- **On Save**: Runs whenever the document is saved. -- **On Submit**: Runs only when the document is submitted. -- **Scheduled**: Runs at specific intervals. +## 2. Choose When it Runs +In the **Triggers** section, pick the moment the rule should start: +- **On Save**: Every time you save the record. +- **On Submit**: Only when the record is officially submitted. +- **Scheduled**: At a specific time of day or interval. -## 3. Build the Logic -Click on the **Rule Builder** tab to open the visual canvas. +## 3. Design the Flow +Open the **Rule Builder** tab to see your visual workspace. -1. **Add a Condition**: Click the `+` icon on the **Entry Action** to add a **Condition** node. -2. **Configure**: Set the condition to check if `doc.grand_total < 1000`. -3. **Add an Action**: On the `True` path, add a **Document Action** to update the `status` to "Approved". +1. **Add a Check**: Click the `+` on the starting block and select **Condition**. +2. **Set the Rule**: Configure it to check if the `Total Amount` is less than `1,000`. +3. **Add an Action**: On the **True** (Green) path, click `+` and select **Update Record**. Set the `Status` to "Approved". -## 4. Activate and Test -1. Save the Rule document. -2. Toggle the **Is Active** switch. -3. Create a test Sales Order to see your rule in action. +## 4. Go Live +1. **Save** your rule. +2. Turn on the **Is Active** switch. +3. Create a test record (like a Sales Order) and watch FlexiRule do the work for you! diff --git a/content/en/using-the-builder/adding-managing-actions.md b/content/en/using-the-builder/adding-managing-actions.md index 428a1a6..557678f 100644 --- a/content/en/using-the-builder/adding-managing-actions.md +++ b/content/en/using-the-builder/adding-managing-actions.md @@ -4,35 +4,35 @@ description: Learn how to use the Action Zone to build your rule logic. weight: 20 --- -# Adding and Managing Actions +# Adding Actions -Building logic in FlexiRule is centered around adding and connecting "Action" nodes. +Building your rule is as simple as adding and connecting blocks. Each block performs a specific task, like sending an email or checking a value. ## The Action Zone -The **Action Zone** is the primary way to add new logic. It provides a searchable menu of all available actions. +The **Action Zone** is how you add new blocks to your rule. It's a searchable menu of everything FlexiRule can do. {{< 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. +### How to Add a Block +1. **Hover**: Move your mouse over any line or empty space on the canvas. +2. **Click**: Click the `+` icon that appears. +3. **Pick**: Search or browse for the action you want (like "Email" or "Update Record"). +4. **Place**: The block is automatically placed 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. +### Auto-Healing +If you remove a block between two others, FlexiRule automatically reconnects the remaining blocks so your rule doesn't break. {{< 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. +You can also connect blocks yourself by dragging a line from one block to another. -## Intelligent Configuration +## Smart Settings -When you select an action, a configuration panel opens on the right. +When you click a block, its settings open on the right. FlexiRule makes this easy: -- **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. +- **Helpful Suggestions**: When picking fields, the builder only shows you options that make sense at that stage of the rule. +- **Instant Alerts**: If you forget a required setting, the builder will let you know before you save. diff --git a/content/en/using-the-builder/canvas-navigation.md b/content/en/using-the-builder/canvas-navigation.md index bb87973..5c7c809 100644 --- a/content/en/using-the-builder/canvas-navigation.md +++ b/content/en/using-the-builder/canvas-navigation.md @@ -8,37 +8,37 @@ aliases: # 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. +The Rule Builder is your visual workspace. It's a drag-and-drop canvas where you can design business processes by simply connecting blocks (nodes). ![Rule Builder Overview](/images/flexirule-canvas-view.png) -## Core Canvas Interactions +## Navigating the Canvas -### 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. +### Move and Zoom +- **Move Around**: Click and hold any empty space on the canvas to drag it around. +- **Zoom In/Out**: Use your mouse wheel or the zoom buttons in the bottom corner to get a better view of your rule. -### 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. +### Managing Blocks +- **Select**: Click once on any block to open its settings on the right. +- **Move**: Drag a block to change its position. +- **Delete**: Select a block and press the `Delete` key. FlexiRule will automatically try to keep your other blocks connected. -### 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. +### Copying Multiple Blocks +You can select several blocks at once by holding the `Shift` key and dragging a box around them. This is great for moving or copying entire sections of logic. {{< video src="/images/shift-click-nodes-to-copy.webm" >}} -## Debugging on the Canvas +## Testing Your Rule -The Rule Builder includes built-in tools to test your rules in real-time. +You don't have to guess if your rule works. The builder has tools to show you exactly what happens when it runs. -### Visual Execution Path -When you run a test, the builder highlights the exact path taken during execution, showing you exactly which nodes were triggered. +### See the Path +When you run a test, the builder lights up the path your rule took. You can see exactly which conditions were met and which actions 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. +### Check the Results +After a test, click on any block to see what it did. For example, you can see the exact email that would have been sent or the new value of a field. ![Debug View Return Result](/images/debug-view-return-result.png)