diff --git a/content/en/advanced-reference/process-action.md b/content/en/advanced-reference/process-action.md new file mode 100644 index 0000000..b2188ce --- /dev/null +++ b/content/en/advanced-reference/process-action.md @@ -0,0 +1,23 @@ +--- +title: Advanced Process +description: Run complex custom tools or special integrations. +weight: 110 +aliases: + - /docs/actions/process/ +--- + +# Advanced Process + +The **Advanced Process** block is for special tasks that go beyond simple updates or emails. + +## When to Use +- **Custom Tools**: Run special tools built by your technical team. +- **Complex Math**: Perform heavy calculations that need extra processing power. +- **Connecting Others**: Talk to other software or services outside of your main system. + +## How to Set it Up +1. **Pick the Process**: Select the specific tool or process you want to run. +2. **Fill in Details**: Provide any information the process needs to do its job. +3. **Use the Result**: If the process gives you back a result (like a calculation), you can use that result in the next steps of your rule. + +**Note**: This block is usually set up with help from your system administrator or a developer, as it involves specialized system tools. diff --git a/content/en/core-actions/assignment.md b/content/en/core-actions/assignment.md index 47f2397..3b9bb9a 100644 --- a/content/en/core-actions/assignment.md +++ b/content/en/core-actions/assignment.md @@ -1,28 +1,28 @@ --- -title: Assignment -description: Set variables and modify document fields within the rule flow. +title: Set Value (Assignment) +description: Change values or save temporary information for later. weight: 50 aliases: - /docs/actions/assignment/ --- -# Assignment Action +# Set Value (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. +The **Set Value** block is used to update information during your rule. You can use it to change fields on the current record or to save a temporary piece of information (a "Variable") to use in a later step. -## Types of Assignments +## Types of Changes -### 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 +Directly change a field on the record that started the rule. +- **Example**: Set the `Status` to "Review Required". -### 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 for Later (Variables) {#context-variables-vars} +Create a temporary piece of information that only exists while this rule is running. This is great for math or combining text. +- **Example**: Calculate a total with tax: `Total With Tax = Grand Total * 1.15`. You can then use this `Total With Tax` value in a **Notify** or **Update Record** block later on. -## Batch Assignments -You can define multiple assignments within a single node. They are executed sequentially from top to bottom. +## Doing Multiple Things at Once +You can add several changes inside a single **Set Value** block. The system 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. +## Cleaning and Fixing Data +You can also use "Pipelines" to clean up data as you set it. +- **Example**: Automatically remove extra spaces from a name or change text to ALL CAPS. diff --git a/content/en/core-actions/condition.md b/content/en/core-actions/condition.md index 3de2916..75e0904 100644 --- a/content/en/core-actions/condition.md +++ b/content/en/core-actions/condition.md @@ -1,30 +1,34 @@ --- -title: Condition -description: Branch your rule logic based on true/false evaluations. +title: Check (Condition) +description: Split your rule into different paths based on a check. weight: 40 aliases: - /docs/actions/condition/ --- -# Condition Action +# Check (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. +The **Check** block is how you create "Yes/No" paths in your rule. It looks at your data and decides which way the rule should go. -## 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. Define the Check +Use the builder to set your rules: +- **What to check**: Pick a field (like `Grand Total` or `Status`). +- **How to compare**: Choose a comparison (like "is greater than", "is not", or "contains"). +- **Value**: The thing you're checking against (like `5000` or "Draft"). -### 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. Multiple Checks (And/Or) +- **AND (All)**: Use this if *every* check you list must be true for the rule to follow the "True" path. +- **OR (Any)**: Use this if *any* one of your checks being true is enough to follow the "True" path. -## 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. +## The Two Paths +- **True (Green)**: The rule follows this path if your check passes. +- **False (Red)**: The rule follows this path if your check fails. + +## Example +**Scenario**: You only want to alert a manager if an order is over $5,000. +1. Add a **Check** block. +2. Set it to: `Grand Total` is `Greater than` `5000`. +3. Connect the **True** path to a **Notify** block. +4. You can leave the **False** path empty if nothing needs to happen for smaller orders. diff --git a/content/en/core-actions/entry-action.md b/content/en/core-actions/entry-action.md index 6a78668..7ec6c79 100644 --- a/content/en/core-actions/entry-action.md +++ b/content/en/core-actions/entry-action.md @@ -8,12 +8,16 @@ 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 is the green "Start" block on your map. ## 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. +Think of this block as the "input" for your rule. It represents the record (the "Doc") that triggered the rule to run. + +Because this is the starting point, all the information from this record is automatically available for you to use in every following step. ## 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. +You can set "Gatekeeper" rules on the main Rule document. These are called **Entry Conditions**. +- If these conditions aren't met, the rule won't even start. +- **Example**: Only run this rule if the `Customer Type` is "Individual". -**Note**: For branching logic *after* the rule has already started, use the [Condition Action]({{< relref "condition" >}}). +**Tip**: If you want to perform different actions *after* the rule has already started based on certain information, use a [Check (Condition)]({{< relref "condition" >}}) block instead. diff --git a/content/en/core-actions/loop.md b/content/en/core-actions/loop.md index e71cbff..799b076 100644 --- a/content/en/core-actions/loop.md +++ b/content/en/core-actions/loop.md @@ -1,27 +1,27 @@ --- -title: Loop -description: Repeat a sequence of actions for each item in a list. +title: Repeat (Loop) +description: Do the same steps for every item in a list. weight: 60 aliases: - /docs/actions/loop/ --- -# Loop Action +# Repeat (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. +The **Repeat** block lets you perform the same set of actions multiple times. This is useful when you have a list of items (like a list of overdue invoices) and need to handle each one individually. ## 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**: You pick a list of items to work through (usually found using a **Query Records** block). +2. **The Steps**: Any blocks you connect to the Repeat block will run once for every item in that list. +3. **The Current Item**: While inside the repeat cycle, you can look at the specific details of the item currently being handled. ## 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. +**Scenario**: You want to send a reminder for every overdue invoice you found. +1. **Find Records**: Use a **Query Records** block to find all "Invoices" that are "Overdue". +2. **Repeat**: Connect that list to a Repeat block. +3. **Notify**: Connect a Notify block to the Repeat block. The system will now send a separate notification for *each* overdue 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**. +## Simple Tips +- **Keep it Short**: Only repeat over the items you actually need. Use filters when finding your records to keep the list small. +- **Organization**: If you find yourself adding many blocks inside a repeat cycle, consider using a **Sub-rule** to keep your main map clean. diff --git a/content/en/core-actions/notify-action.md b/content/en/core-actions/notify-action.md index 099f731..3a61eae 100644 --- a/content/en/core-actions/notify-action.md +++ b/content/en/core-actions/notify-action.md @@ -1,32 +1,32 @@ --- title: Notify -description: Send emails, system notifications, or UI toasts. +description: Send emails, system messages, or popup alerts. weight: 20 aliases: - /docs/actions/notify/ --- -# Notify Action +# Notify -The **Notify** action is used to communicate information to users or external systems. +The **Notify** block is how your rule talks to people or other systems. -## Notification Types +## Types of Notifications ### 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 formatted email. +- **Who gets it**: Enter an email address or pick a field (like "Owner's Email"). +- **What it says**: Use a pre-made template or write your own message. +- **Attachments**: You can automatically attach the record (like a Sales Order) 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. System Message +Send an alert inside the system. These show up in the "Bell" icon at the top of the screen for specific users or roles. -### 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. Popup Alert (Toast) +Show a small popup message to the person who is currently using the system. +- **Alert Types**: Success (Green), Info (Blue), Warning (Yellow), or Error (Red). +- **Note**: These only appear if the rule was triggered by someone clicking a button (like "Save") in the browser. -## 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 it Up +1. **Pick the Type**: Choose how you want to send the message. +2. **Write the Message**: Type your message. You can include data from your rule by using curly brackets, like `Hello {{ doc.owner }}`. +3. **Choose the Audience**: Select who should receive the alert. diff --git a/content/en/core-actions/process.md b/content/en/core-actions/process.md deleted file mode 100644 index 406a443..0000000 --- a/content/en/core-actions/process.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: Process -description: Execute complex custom logic or background tasks. -weight: 110 -aliases: - - /docs/actions/process/ ---- - -# Process Action - -The **Process** action is used for advanced logic that goes beyond standard record updates or notifications. - -## 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. - -## 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. diff --git a/content/en/core-actions/query-records.md b/content/en/core-actions/query-records.md index b3b7e5a..f05a667 100644 --- a/content/en/core-actions/query-records.md +++ b/content/en/core-actions/query-records.md @@ -1,6 +1,6 @@ --- title: Query Records -description: Retrieve data from the system using filters and aggregations. +description: Find and retrieve data from other parts of the system. weight: 10 aliases: - /docs/actions/query-records/ @@ -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. +The **Query Records** block lets you "look up" information that isn't already in the record that started the rule. -## 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"). +## When to use it +- **Find Details**: Get a customer's address from their record when you're processing an order. +- **Check for Others**: Look for other unpaid invoices for the same customer. +- **Get Totals**: Calculate the total amount of all orders placed today. -## Query Modes +## Ways to Find Information -| Mode | Returns | Best For | +| Way to Find | What it gives you | 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 Single** | One specific record | Getting details from one item (e.g., a specific Customer). | +| **Find Many** | A list of records | Finding multiple things to work with (e.g., all "Draft" invoices). | +| **Check if Exists** | A Yes or No | Simple checks (e.g., "Is there already a record with this ID?"). | +| **Calculate Total** | A single number | Getting a Count, Sum, or Average. | -## Advanced Querying +## How to Set it 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 the Record Type +Pick what you are looking for (e.g., "Sales Invoice" or "Supplier"). -### 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 the Filters +Filters tell FlexiRule exactly which records you want. +- **Fixed Filter**: `Status` is "Draft". +- **Matching Filter**: `Customer` matches the `Customer` on the current order. +- **Time Filter**: Find records from the "Last 7 Days". -## How to Configure +### 3. Refresh Data (Important) +Once you've set your filters, click **Refresh Schema**. This tests your lookup and makes all the information it finds available for you to use in the next blocks of your map. -### 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. +## Simple Tips +- **Be Specific**: Always use filters so the system doesn't have to look through every single record, which keeps things fast. +- **One vs. Many**: If you only need one specific record (like a Customer), use **Find Single** (Query Doc). If you need a list to work through, use **Find Many** (Query List). diff --git a/content/en/core-actions/stop-error.md b/content/en/core-actions/stop-error.md index c9ff13f..8fbd91f 100644 --- a/content/en/core-actions/stop-error.md +++ b/content/en/core-actions/stop-error.md @@ -1,21 +1,24 @@ --- -title: Stop and Error Handling -description: Control how a rule finishes or handle errors. +title: Stop and Errors +description: Control how a rule finishes or block actions with an error. weight: 100 aliases: - /docs/actions/stop/ - /docs/actions/raise-error/ --- -# Stop and Error Handling +# Stop and Errors -These nodes allow you to explicitly control the end of a rule or handle situations where something goes wrong. +These blocks give you final control over how a rule finishes its work. -## 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 tells the rule to finish immediately. +- **When to use it**: Use this if you want to exit a rule early. For example, if a check fails and there's no more work to do, just use a Stop block to end the process cleanly. -## 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 user. +- **When to use it**: Use this for strict rules. For example, if a Sales Order is missing an important attachment, you can use a **Raise Error** block with the message: *"Please upload the signed contract before saving."* +- **What happens**: The system will stop everything, and the user will see your message in a popup. + +## Simple Tip +- **Stop vs. Error**: Use **Stop** when everything is fine but the rule is just done. Use **Raise Error** when something is wrong and the user needs to fix it before they can continue. diff --git a/content/en/core-actions/sub-rule.md b/content/en/core-actions/sub-rule.md index 70ce002..2efea9b 100644 --- a/content/en/core-actions/sub-rule.md +++ b/content/en/core-actions/sub-rule.md @@ -1,20 +1,20 @@ --- title: Sub-rule -description: Run another rule from within your current flow. +description: Run another rule from within your current map. weight: 90 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. This is a great way to stay organized and reuse logic you've already built. ## 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. +- **Stay Organized**: Instead of one giant, messy map, you can break your process into smaller, "bite-sized" rules. +- **Save Time**: If you have a standard process (like an "Approval Flow") that you use for many different things, you only have to build it once and can call it as a sub-rule whenever you need it. ## How to Use -1. Select the **Sub-rule** node. +1. Add a **Sub-rule** block. 2. Pick the existing rule you want to run. -3. **Pass Data**: Optionally pass specific variables or documents into the sub-rule. +3. **Share Information**: You can choose which data 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..a84d9a5 100644 --- a/content/en/core-actions/switch.md +++ b/content/en/core-actions/switch.md @@ -1,26 +1,27 @@ --- -title: Switch -description: Route execution down different paths based on a specific value. +title: Multi-Path (Switch) +description: Choose from several different paths based on a value. weight: 70 aliases: - /docs/actions/switch/ --- -# Switch Action +# Multi-Path (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 **Multi-Path** block is like a traffic intersection. Instead of a simple "Yes/No" check, it lets you choose from many different directions based on a specific piece of information. -## 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 Info**: Choose the field you want to check (like `Priority` or `Category`). +2. **Set the Paths**: Create a "Path" for each specific value. + - **Path 1**: "High" + - **Path 2**: "Medium" + - **Path 3**: "Low" +3. **Default Path**: Tell the system which way to go if the information doesn't match any of your specific paths. ## 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. +**Scenario**: Route a support request to the right team based on its category. +- **Check** the `Category` field. +- **Path "Billing"**: Leads to an email for the Finance team. +- **Path "Technical"**: Leads to an email for the Engineering team. +- **Path "General"**: Leads to the "Default" path for the Support team. diff --git a/content/en/core-actions/update-record.md b/content/en/core-actions/update-record.md index f44da2f..9aef7dc 100644 --- a/content/en/core-actions/update-record.md +++ b/content/en/core-actions/update-record.md @@ -1,31 +1,31 @@ --- title: Update Record -description: Create, update, or delete documents in the system. +description: Change fields, create new items, or delete records. weight: 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 is how your rule makes changes to documents in your system. -## Operations +## What it Can Do -### 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. Update Existing +Change information on a record that already exists. +- **How it works**: You tell the system which record to change (usually by using information found in a previous **Query Records** step). +- **Example**: Change a Sales Invoice's `Status` to "Paid". -### 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. Create New +Build a brand new record from scratch. +- **How it works**: Pick the type of record you want to create and fill in the initial information. +- **Example**: Automatically create a "Task" for a manager when a new "Lead" is created. ### 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. +Permanently remove a record. +- **Caution**: This cannot be undone. Always use a **Check** (Condition) before this step to make sure you are deleting the correct item. -## 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). +## Simple Tips +- **Be Precise**: When updating an existing record, make sure you've used a **Query Records** block first to find exactly the right one. +- **Check First**: It's often a good idea to use a **Check** (Condition) block before an update to make sure the change is actually needed. diff --git a/content/en/core-actions/wait.md b/content/en/core-actions/wait.md index 2ba8fae..17ec24b 100644 --- a/content/en/core-actions/wait.md +++ b/content/en/core-actions/wait.md @@ -1,22 +1,24 @@ --- title: Wait -description: Pause rule execution for a specified duration or until a date. +description: Pause the rule for a set amount of time. weight: 80 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 tells the rule to pause before moving on to the next step. This is great for follow-ups or delayed actions. -## Wait Options +## Ways to Wait -- **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`). +- **For a Duration**: Wait for a specific amount of time, like "2 days" or "4 hours". +- **Until a Date**: Wait until a specific date is reached. You can use a date from your record, like the `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. +**Scenario**: Send a "Thank You" email 24 hours after a customer makes a purchase. +1. The rule starts when a new "Sales Invoice" is created. +2. **Wait**: Set the block to wait for "1 day". +3. **Notify**: Send the thank you email. + +The rule will start immediately when the invoice is created, but it will "sit" at the Wait block for 24 hours before sending the email. diff --git a/content/en/getting-started/introduction.md b/content/en/getting-started/introduction.md index 94709e6..27c212f 100644 --- a/content/en/getting-started/introduction.md +++ b/content/en/getting-started/introduction.md @@ -6,23 +6,25 @@ aliases: - /docs/getting-started/ --- -# Introduction to FlexiRule +# 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 logic builder for Frappe and ERPNext. It helps you automate business processes without writing complex code. Instead of hidden scripts, you build clear, visual maps of how your business should work. -## 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. +- **See Your Logic**: Design your business flows using an intuitive, drag-and-drop map. +- **No Coding Required**: Configure complex rules using simple pickers and forms. +- **Everything in One Place**: Stop searching through hidden files; all your business rules are organized in a single dashboard. +- **Safe and Reliable**: Built-in safeguards ensure your rules run predictably and don't cause system loops. -## Core Concepts +## How it Works -FlexiRule simplifies business automation into three main stages: +FlexiRule simplifies automation into three simple steps: -1. **The Trigger**: Defining *when* a rule should run (e.g., when a Sales Order is saved or on a schedule). -2. **The Logic**: Using the **Rule Builder** to map out the decision path and actions. -3. **The Result**: Executing actions like updating records, sending notifications, or calling external APIs. +1. **The Trigger**: Decide *when* a rule should run (e.g., "When a Sales Order is saved"). +2. **The Logic**: Use the **Rule Builder** to draw the path and decisions (e.g., "If the total is over $1,000, send for approval"). +3. **The Result**: Automatically perform actions (e.g., "Update the status" or "Notify the manager"). + +[Ready to build? Check out the Quick Start Guide →]({{< relref "quick-start" >}}) diff --git a/content/en/getting-started/quick-start.md b/content/en/getting-started/quick-start.md index 4fe6de8..0838a76 100644 --- a/content/en/getting-started/quick-start.md +++ b/content/en/getting-started/quick-start.md @@ -4,30 +4,30 @@ description: Create your first business rule in minutes. weight: 20 --- -# Quick Start Guide +# Your First Rule -Follow these steps to create and activate your first automated business rule. +Let's build a simple rule: **"If a Sales Order is over $1,000, mark it for review."** -## 1. Create a New Rule -1. Navigate to the **Rule** list in the FlexiRule Desk. +## 1. Create the Rule +1. Go to the **Rule** list in your 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). - -## 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. - -## 3. Build the Logic -Click on the **Rule Builder** tab to open the visual canvas. - -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". - -## 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. +3. Name it: `High Value Order Review`. +4. Set the **Reference DocType** to `Sales Order`. + +## 2. Set the Trigger +We want this to run every time someone saves an order. +1. In the **Triggers** section, ensure **On Save** is selected. + +## 3. Build the Path +Click the **Rule Builder** tab at the top to open the canvas. + +1. **Add a Check**: Hover over the line coming from the **Entry Action** (the green start node) and click the `+` icon. Select **Condition**. +2. **Configure the Check**: In the panel that opens, set it to check if `Grand Total` is `Greater than` `1000`. +3. **Add an Action**: On the **True** (green) path coming out of your condition, click `+` and select **Update Record**. +4. **Set the Update**: Choose the operation **Update Existing**. Set the `Status` field to `Pending Review`. + +## 4. Activate +1. Click **Save** on the Rule document. +2. Switch the **Is Active** toggle to **On**. + +**That's it!** Now, whenever a Sales Order over $1,000 is saved, FlexiRule will automatically change its status to "Pending Review". diff --git a/content/en/using-the-builder/adding-managing-actions.md b/content/en/using-the-builder/adding-managing-actions.md index 428a1a6..605671a 100644 --- a/content/en/using-the-builder/adding-managing-actions.md +++ b/content/en/using-the-builder/adding-managing-actions.md @@ -1,38 +1,38 @@ --- -title: Adding and Managing Actions +title: Adding 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. +In FlexiRule, you build your process by adding "Action" blocks to your canvas. ## 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 steps. It's a searchable menu of every tool available to you. {{< 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 Step +1. **Find the Spot**: Hover your mouse over any line or empty space where you want to add a step. +2. **Click `+`**: Click the plus icon that appears. +3. **Search**: Type what you want to do (like "Email" or "Check"). +4. **Select**: Click the action, and it will be placed and connected automatically. -## Managing Connections +## Intelligent 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 from the middle of a flow, FlexiRule will automatically "heal" the gap by connecting the blocks on either side. This prevents your rule from breaking when you make changes. {{< 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. +### Manual Connection +You can also draw connections yourself. Just click and drag from the circle on the right side of one block to the circle on the left side of another. -## Intelligent Configuration +## Configuring Your Steps -When you select an action, a configuration panel opens on the right. +When you click a block, a 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. +- **Smart Pickers**: FlexiRule knows your data. If you're building a rule for a Sales Order, the pickers will only show you fields and information relevant to that order. +- **Instant Checks**: If a step is missing a required setting, the builder will highlight it so you can fix it before saving. diff --git a/content/en/using-the-builder/canvas-navigation.md b/content/en/using-the-builder/canvas-navigation.md index bb87973..19f83cf 100644 --- a/content/en/using-the-builder/canvas-navigation.md +++ b/content/en/using-the-builder/canvas-navigation.md @@ -1,47 +1,48 @@ --- -title: Canvas Navigation +title: Using the Builder description: Learn how to navigate and use the visual Rule Builder canvas. weight: 10 aliases: - /docs/user-guide/rule-builder/ --- -# Canvas Navigation +# Navigating the Builder -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 where you "draw" your business processes using blocks and connections. ![Rule Builder Overview](/images/flexirule-canvas-view.png) -## Core Canvas Interactions +## Moving Around -### 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 the Map**: Click and drag on any empty space to pan around your rule. +- **Zoom In/Out**: Use your mouse wheel or the zoom buttons in the corner to see more or less of your flow. -### 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. +## Working with Blocks -### 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. +Each block represents a step in your process (like a check or an action). + +- **Select**: Click a block to open its settings on the right. +- **Move**: Drag a block to a new position to keep your map organized. +- **Delete**: Click a block and press `Delete`. FlexiRule is smart—it will automatically try to reconnect the blocks before and after the one you deleted to keep the flow intact. + +### Selecting Multiple Blocks +Hold `Shift` and drag a box around several blocks to select them all at once. You can then move them as a group or copy them. {{< 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. You can test it right inside the builder. -### 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 exact path the rule followed. This makes it easy to see if a "Condition" worked the way you expected. {{< 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, if you updated a record, you can see exactly which fields were changed. ![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" >}}). +## Learn More +Ready to start building? See [How to Add Actions]({{< relref "adding-managing-actions" >}}). diff --git a/hugo_build_2.log b/hugo_build_2.log new file mode 100644 index 0000000..6bc47dc --- /dev/null +++ b/hugo_build_2.log @@ -0,0 +1,16 @@ +Start building sites … +hugo v0.163.3-4d22555aebf458d5d150500c9ac4bee5b24cf0d3+extended linux/amd64 BuildDate=2026-06-18T16:18:24Z VendorInfo=gohugoio + +WARN deprecated: .Site.Data was deprecated in Hugo v0.156.0 and will be removed in a future release. Use hugo.Data instead. + + │ EN +──────────────────┼───── + Pages │ 126 + Paginator pages │ 0 + Non-page files │ 0 + Static files │ 25 + Processed images │ 0 + Aliases │ 47 + Cleaned │ 0 + +Total in 676 ms