A drag-and-drop conditional branching configuration method for an expression engine with multiple operators and automatic type detection

The drag-and-drop conditional branching configuration method of the expression engine with multiple operators and automatic type detection solves the problems of insufficient operator coverage and reliance on manual data type parsing in existing technologies. It realizes flexible conditional branching configuration and compound logic judgment, which is suitable for a variety of business scenarios and reduces user learning costs and security risks.

CN123114447APending Publication Date: 2026-11-17RENAS SMART HOME (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611341127.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-01
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

The existing visual workflow conditional branch configuration scheme has insufficient operator coverage of the conditional expression engine, data type parsing relies on manual processing by the user, and the configuration flexibility is insufficient. This makes it impossible for non-technical users to cover numerical comparison, string matching and complex logic judgment scenarios with a single configuration interface.

Method used

A drag-and-drop conditional branching configuration method for an expression engine with multiple operators and automatic type detection is adopted. The terminal device processor executes the drag-and-drop condition judgment node to obtain the configuration list and matching mode parameters. By recursively decomposing regular expression comparison operators and logical operators, combined with automatic type detection, automatic type conversion and compound logical judgment of conditional expressions are realized.

Benefits of technology

It supports a variety of comparison operators and automatic type detection, eliminating data type errors, simplifying the configuration process, improving the flexibility and accuracy of configuration, making it suitable for various business scenarios, and reducing user learning costs and security risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123114447A_ABST
    Figure CN123114447A_ABST
Patent Text Reader

Abstract

This invention discloses a drag-and-drop conditional branch configuration method for an expression engine with multiple operators and automatic type detection, belonging to the field of visual workflow technology. It includes: dragging and placing conditional judgment nodes on a visual canvas; obtaining the conditional branch configuration list and matching mode parameters for that node; traversing the conditional branch configuration list, calling the expression evaluation function to evaluate each conditional expression, wherein the expression evaluation function executes regular expression comparison operator matching and logical operator recursive decomposition in a fixed priority order, and when a comparison operator is matched, it parses the operand data type in the order of priority: Boolean value, numeric value, quoted string, null value, and variable name before making a judgment; and determining the set of downstream nodes to be executed based on the matching mode and the evaluation result. This invention, through eleven built-in comparison operators, automatic operand type detection, and a dual-mode matching strategy, can achieve comprehensive conditional routing configuration covering numerical comparison, string matching, and logical combination without writing code, and eliminates the configuration complexity of manual type conversion by the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of visual workflow technology, specifically to a drag-and-drop conditional branch configuration method for an expression engine with multiple operators and automatic type detection. Background Technology

[0002] In existing visual workflow platforms, conditional branch nodes are the core component for intelligent process routing. When users build workflows on the canvas, they often need to determine which branch path the downstream should take based on the output of the upstream node. For example, when the HTTP request response status code is 200, the data processing workflow is followed; when the status code is 4xx, the error handling workflow is followed. Similarly, when the number of rows returned by a database query is greater than 0, the update workflow is followed; when it is equal to 0, the insert workflow is followed. The existing conditional branch configuration schemes of visual workflow platforms mainly suffer from the following three types of defects. Option A uses a fixed-option configuration. This option offers only a limited selection of operators, typically supporting only numerical comparisons (greater than, less than, equal to). Users select the operator from a dropdown menu and then enter the comparison value in the input box. The drawback of this option is its extremely limited operator variety—when users need to perform string matching (such as determining whether the response body contains a certain keyword or whether a filename starts with a certain prefix), Option A cannot perform such conditional judgments. Users must write code scripts to bypass the condition nodes, thus negating the value of visual configuration. Option B uses code script configuration. This option allows users to directly enter complete code expressions (such as JavaScript syntax) in condition nodes, which are then dynamically executed by the engine at runtime. The drawback of this option is that users must master the syntax and function libraries of the programming language, which contradicts the "no coding required" goal of the visual workflow. For business teams targeting non-technical users, the learning curve is too steep. Furthermore, directly executing user scripts introduces security risks. While Solution C supports multiple operators, it treats the data types of both the left and right operands in conditional expressions as strings. When the comparison value should be a number (e.g., comparing the strings "100" and "50" will result in the incorrect conclusion that "100 is less than 50"), the user must manually convert the data type, increasing configuration complexity and the probability of errors. The above solutions share a common fundamental technical problem: the conditional expression engine has insufficient operator coverage, data type parsing relies on manual user processing, it does not support nested logical operator combinations and lacks flexible matching pattern strategies, making it impossible for non-technical users to cover common business scenarios such as numerical comparison, string matching and complex logical judgments with a single configuration interface. Summary of the Invention The technical problem this invention aims to solve is that the existing visual workflow conditional branch configuration schemes have insufficient operator coverage of the conditional expression engine, data type parsing relies on manual processing by the user, and the configuration flexibility is insufficient, which makes it impossible for non-technical users to cover numerical comparison, string matching, and complex logic judgment scenarios with a single configuration interface. The technical solution of this invention is: a drag-and-drop conditional branch configuration method for an expression engine with multiple operators and automatic type detection, executed by a terminal device processor, including at least the following steps: dragging and placing condition judgment nodes on a visual canvas to obtain a conditional branch configuration list and matching mode parameters; traversing the conditional branch configuration list, calling the expression evaluation function to evaluate each conditional expression, wherein the expression evaluation function performs regular expression comparison operator matching according to a fixed priority—extracting the left operand, operator, and right operand using regular expressions, and entering the operand automatic type detection step when a match is successful—attempting to identify data types and perform type conversion on the operand strings according to a fixed priority of Boolean value, number, quoted string, null value, and variable name, and then executing the judgment logic according to the operator type; if the comparison operator matching fails, then detecting logical operators and performing recursive decomposition and summarization; determining the set of downstream nodes to be executed according to the matching mode parameters and the evaluation result, and returning it to the workflow engine as the next hop node list to complete the branch routing. The beneficial effects of this invention are as follows: First, the expression evaluation function adopts a two-level evaluation structure of regular expression-first matching plus recursive decomposition of logical operators. The first level uses regular expressions to extract the left operand, operator, and right operand at once. It supports 11 comparison operators, including equal to, not equal to, greater than, greater than or equal to, less than, less than or equal to, containing substring, starting with a specified prefix, ending with a specified suffix, empty value, and non-empty value, far exceeding the numerical size comparison capability of existing solutions. The second level detects logical AND and logical OR operators when the comparison operator fails to match. After splitting by operator, it recursively calls the expression evaluation function on each subexpression and then summarizes them. This allows a single conditional expression to express compound logical judgments such as "(status code equals 200 and response body contains success) or (response body contains created)", without having to split into multiple conditions and additional logical combination operations. Second, the automatic operand type detection uses a mechanism that attempts operands in a fixed priority order: Boolean values, numeric values, quoted strings, null values, and variable names. Prioritizing numeric types (before quoted strings) eliminates sorting errors caused by "string comparisons" in existing schemes—for example, when the number 100 is used as an operand, the system recognizes it as a numeric value rather than a string, thus the comparison result of "100 is not equal to 99" is true, rather than an incorrect conclusion based on string sorting. This mechanism allows users to avoid explicitly declaring data types in the configuration interface while retaining the ability to force string comparisons by enclosing them in quotes (e.g., "true" is treated as a string rather than a Boolean value). Third, the dual-mode matching strategy supports two modes: initial matching and full matching, which are suitable for two different business scenarios: mutual exclusion conditions and parallel triggering, respectively. The initial matching mode stops evaluating immediately after finding the first true condition, which is suitable for scenarios where the condition branches do not overlap (such as classification routing for status codes 200 / 4xx / 5xx); the full matching mode evaluates all conditions and returns the branch that satisfies all conditions, which is suitable for scenarios that need to trigger multiple downstream processes simultaneously. Attached Figure Description Figure 1 This is a flowchart of a drag-and-drop conditional branch configuration method for an expression engine with multiple operators and automatic type detection, as described in an embodiment of the present invention. The meanings of the markings in the diagram are as follows: 101 - Drag and drop conditional decision nodes / retrieve the conditional branch configuration list / and matching mode parameters; 102 - Traverse the conditional branch configuration list / evaluate each conditional expression; 103 - Determine if the conditional expression matches the regular expression comparison operation mode; 104 - Determine if the conditional expression contains a logical AND operator or a logical OR operator; 105 - Perform automatic operand type detection and then execute the judgment logic according to the comparison operator type; 106 - Split by logical operator / recursively evaluate the sub-expressions / and summarize the Boolean values; 107 - Accumulate the evaluation results to track the true / false status of each branch; 108 - Determine if the matching mode parameter is the first matching mode; 109 - Use the first true target node as the unique next-hop node; 110 - Add all true target nodes to the next-hop node set; 111 - Determine if all conditional expressions are false; 112 - Retrieve the default branch identifier from the configuration / as the next-hop node; 113 - Return the next-hop node list / and complete the branch routing in the workflow engine. Detailed Implementation like Figure 1As shown in mark 101, users drag and drop conditional decision nodes from the left-hand node panel onto the canvas using the visual canvas editor; the system automatically creates conditional decision node instances. Through the node properties panel, users add conditional branch configurations one by one—each configuration uses a text input control to enter a conditional expression (e.g., "status code greater than or equal to 200"), and a drop-down selection control to choose the target node identifier to jump to when the condition is met. Users also need to set the matching mode parameter to "first match" or "all match" using radio buttons, and specify a default branch (the branch path to follow when all conditions are not met). After configuration, the node obtains a list of conditional branch configurations (containing several triples of {branch identifier, conditional expression, target node identifier}) and the matching mode parameters. like Figure 1 As shown in marks 102 and 107, the engine begins to traverse the conditional branch configuration list, calling the expression evaluation function sequentially for each conditional expression. The evaluation results are accumulated into a tracking array (the array length is equal to the number of conditional branches, and each element is marked as true or false) for subsequent branch decision steps. like Figure 1 As shown in marks 103 to 106, the expression evaluation function performs two levels of evaluation logic. The first level matches the conditional expression against a regular expression. This regular expression starts with the left operand, matches one supported comparison operator (equal to, not equal to, greater than, greater than or equal to, less than, less than or equal to, substring included, starts with a specified prefix, ends with a specified suffix, null value, non-null value), and then matches the right operand (null and non-null operators have no right operand, all others do). If a match is successful, the automatic operand type detection step begins—the left and right operand strings are tested for data type identification according to the following fixed priority: first, Boolean value identification (true / false); second, numeric conversion (calling a numeric type conversion function); third, quoted string identification (content enclosed in double or single quotes is treated as a string after removing the quotes); fourth, null value identification; and fifth, processing as a variable name (retrieving the value from the execution context at runtime). After parsing, the corresponding judgment logic is executed according to the operator type. Taking "status code greater than or equal to 200" as an example, the left operand "status code" is used as a variable name and its actual value is retrieved from the execution context at runtime (such as 201). The right operand "200" is parsed as the value 200, and the greater than or equal to value comparison is performed to obtain the Boolean value true. Specifically, Boolean value recognition is performed before numeric value recognition, ensuring that Boolean values ​​`true` and `false` are correctly recognized as Boolean types when not enclosed in quotes. Prioritizing numeric type matching eliminates sorting errors caused by string comparisons—for example, when the left operand is "100" and the right operand is "99", the system recognizes both as numbers rather than strings, performing a numerical comparison ("100 is greater than 99") to obtain a true value, rather than the erroneous conclusion of "100 is less than 99" based on string lexicographical order. The following uses a typical complex conditional expression to illustrate the recursive decomposition process of logical operators. The configured expression is "(status code equals 200 and response body contains success) or response body contains created". The first-level regular expression comparison operator matching attempt fails (because the expression as a whole is not a single "left-infix-right" structure). The expression evaluation function enters the second level—detecting the "OR" operator, it splits the expression into two subexpressions: "(status code equals 200 and response body contains success)" and "response body contains created". The expression evaluation function is called again for each subexpression: the former enters the second level and is split into two simplest atomic expressions by the "AND" operator: "status code equals 200" and "response body contains success". Regular expression comparison operators are called for each atomic expression—"status code equals 200" matches successfully and after automatic operand type detection, the result of the equality operator is a Boolean value of true; "response body contains success" matches successfully and after automatic operand type detection, the result of the substring operator is a result of the substring operator. The evaluation results of the two atomic expressions are summed by AND, and the summed value is true only if both are true. Finally, the summed results of the two OR branches are summed by OR to obtain the final Boolean value. like Figure 1 As shown in marks 108 to 113, branch decisions execute different logic based on the matching mode parameters. In the first-match mode, the first true element in the tracking array is sequentially searched, and its corresponding target node identifier is taken as the unique next-hop node; subsequent conditions are not evaluated. In the all-match mode, all true elements in the tracking array are traversed, and their corresponding target node identifiers are added to the next-hop node set. If all elements in the tracking array are false (i.e., all conditions are not met), a default branch identifier is obtained from the node configuration, and its corresponding target node identifier is used as the unique element in the next-hop node list. Finally, the next-hop node list is returned to the workflow engine's scheduler. The scheduler marks these downstream nodes as having satisfied their dependencies based on the node identifiers in the list, and continues executing subsequent workflow processes. The foregoing has provided a detailed description of a drag-and-drop conditional branch configuration method for an expression engine with multiple operators and automatic type detection, as provided by this invention. The embodiments in this specification are exemplary and not intended to limit the scope of protection of this invention. Those skilled in the art can make various improvements and modifications without departing from the principles of this invention, and these improvements and modifications should also be considered to fall within the scope of protection of this invention.

Claims

1. A drag-and-drop conditional branch configuration method for an expression engine with multiple operators and automatic type detection, executed by a terminal device processor, comprising at least the following steps: Drag and drop condition judgment nodes on the visualization canvas to obtain the condition branch configuration list and matching mode parameters of the node. Each condition branch configuration includes a branch identifier, a condition expression, and a target node identifier. The matching mode parameters indicate the first matching mode or the full matching mode. Iterate through the conditional branch configuration list and call the expression evaluation function to evaluate each conditional expression; In the expression evaluation function, regular expression comparison operator matching and logical operator recursive decomposition are executed sequentially according to a fixed priority: first, the left operand, comparison operator, and right operand are extracted from the conditional expression using a preset regular expression. If the match is successful, the automatic operand type detection step is entered, and the corresponding judgment logic is executed according to the operator type to obtain a Boolean value. If the match fails, it is checked whether the conditional expression contains a logical AND operator or a logical OR operator. If it does, the expression evaluation function is recursively called after splitting according to the logical operator and the Boolean value is summarized. The automatic operand type detection step is as follows: for the left operand string and the right operand string, the data types are identified and converted in sequence according to the fixed priority of Boolean value, number, quoted string, null value and variable name. The converted operands are then judged according to the operator type. Boolean value identification is performed before number identification, so that the numeric string "100" is correctly parsed as a number type instead of a string type, eliminating the sorting error caused by string comparison. The set of downstream nodes to be executed is determined based on the matching mode parameter and the evaluation result: if the matching mode parameter indicates the first matching mode, the target node identifier corresponding to the first conditional branch configuration that is true in the evaluation result is selected as the unique node to be executed; If the matching mode parameter indicates all matching modes, then the target node identifiers corresponding to the condition branches whose evaluation results are all true are selected to form a set of nodes to be executed. The downstream node set is returned to the workflow engine as a list of next-hop nodes to complete the branch routing.

2. The method according to claim 1, wherein, The supported operator types in the decision logic executed according to the operator type include: equal to, not equal to, greater than, greater than or equal to, less than, less than or equal to, containing substring, starting with a specified prefix, ending with a specified suffix, empty value, and non-empty value.

3. The method according to claim 1, wherein, The logic for determining the left operand of the operator with an empty value is as follows: if the Boolean value of the left operand is false, or the left operand is an empty string, or the length of the left operand after removing leading and trailing whitespace characters is 0, then return true; otherwise, return false. The logic for determining the value of the operator with a non-empty value is the opposite of the logic for determining the value of an empty value.

4. The method according to claim 1, wherein, When all conditional expressions evaluate to false, the default branch identifier is obtained from the conditional branch configuration list, and the default target node corresponding to the default branch identifier is used as the unique element of the next hop node list.

5. The method according to claim 1, wherein, The steps of dragging and dropping condition judgment nodes on the visualization canvas specifically include: obtaining node definition data from the node panel through drag gestures, creating a condition judgment node instance at the release position on the canvas; adding condition branches one by one through the node property panel according to interactive operations, entering the condition expression for each condition branch through the text input control, selecting the target node identifier through the drop-down selection control, and selecting the matching mode parameter through the radio button control.

6. A drag-and-drop conditional branching configuration system for an expression engine with multiple operators and automatic type detection, comprising: The node configuration acquisition module is used to obtain the list of conditional branch configurations and matching mode parameters of a conditional judgment node after dragging and dropping it on the visualization canvas. Each conditional branch configuration includes a branch identifier, a conditional expression, and a target node identifier. The expression evaluation module is used to traverse the conditional branch configuration list and call the expression evaluation function to evaluate each conditional expression. The expression evaluation function performs regular expression comparison operator matching and logical operator recursive decomposition according to a fixed priority. When a comparison operator is matched, the operand data types are identified in order of priority: Boolean value, number, quoted string, null value and variable name. After type conversion, the judgment logic is executed. The branch decision module is used to determine the set of downstream nodes to be executed based on the matching mode parameters and the evaluation results, and return the set of downstream nodes as the next hop node list to the workflow engine to complete the branch routing.

7. The system according to claim 6, wherein, The comparison operator types supported by the expression evaluation module include equal to, not equal to, greater than, greater than or equal to, less than, less than or equal to, containing substring, starting with a specified prefix, ending with a specified suffix, empty value, and non-empty value.

8. A terminal device comprising a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method according to any one of claims 1 to 5.

9. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 5.