Visual backend business flow execution method, system, storage medium and computer device supporting hot update and code generation
By implementing a visual backend business flow execution method independent of Spring Integration, it supports hot updates and code generation for Groovy script nodes, solving the problems of heavy architecture and security risks in enterprise-level business process orchestration, and achieving efficient and secure business process management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SICHUAN YOUSIKE INFORMATION TECHNOLOGY CO LTD
- Filing Date
- 2026-02-05
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies suffer from problems such as heavy architecture, low performance, difficulty in expressing programming primitives, security risks, and performance loss in enterprise-level business process orchestration, especially lacking effective solutions for high-concurrency automation scenarios and hot updates.
It provides a visual backend business flow execution method independent of Spring Integration, supports hot reloading of Groovy script nodes and code generation, configures non-BPMN business processes through a visual interface, and combines Spring Bean dynamic management to achieve global context passing and secure sandbox execution, while being compatible with the Spring Integration programming paradigm.
It enables flexible development and production stability in high-concurrency automated scenarios, supports hot updates and code generation, improves development efficiency and system security, and avoids security risks and performance losses in the production environment.
Smart Images

Figure CN122152294A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of enterprise-level backend service development and low-code platform, specifically relating to a visual backend business flow execution method, system, storage medium, and computer equipment that supports hot updates and code generation. Background Technology
[0002] Currently, enterprise-level business process orchestration mainly relies on the following two technologies: The first type is the BPMN workflow engine (such as Activiti and Camunda). This technology is designed for long-cycle processes such as manual approval, and has a heavy architecture and low performance. In addition, the "task-gateway" is relatively abstract and it is difficult to express programming primitives such as if-else and for, making it unsuitable for high-concurrency automation scenarios.
[0003] The second type is Spring Integration. Although this technology has lightweight message routing capabilities, it requires developers to manually write chained code using IntegrationFlow.from().handle().route(), lacks visual support, and does not support hot updates.
[0004] Some technical solutions attempt to introduce Groovy scripts to implement dynamic logic, but the entire process is usually written as a Groovy script, which leads to security risks, performance loss, and inability to perform static auditing in the production environment. Summary of the Invention
[0005] The technical problem this invention aims to solve is to provide a visual backend business flow execution method, system, storage medium, and computer device that supports hot updates and code generation, thereby addressing the problems existing in the background art. Internally, it is independent of Spring Integration, but fully compatible with the Spring Integration programming paradigm in terms of interface and data model. It supports visually embedded Groovy script nodes for local logic customization, achieves hot updates through dynamic management of Spring Beans, and can convert all logic (including scripts) into standard Java source code during configuration.
[0006] The technical solution adopted by this invention to solve its technical problem is: a visual backend business flow execution method that supports hot updates and code generation, including the following steps: S1 allows configuration of non-BPMN business processes through a visual interface. Non-BPMN business processes include standard nodes and Groovy script nodes. Data is passed between standard nodes and Groovy script nodes through a process-level global context. S2, construct a DispatcherFlow executor instance. The message model of the DispatcherFlow executor instance is compatible with the message model of Spring Integration. The global context is encapsulated as the payload of Message. Data is passed between standard nodes and Groovy script nodes through MessageChannel. Each node implements the MessageHandler interface. Provides a dual-mode usage mechanism: In hot update mode, the script content of Groovy script nodes is dynamically compiled and executed in a secure sandbox at runtime. When the configuration of non-BPMN business processes changes, Groovy script nodes dynamically unload the old DispatcherFlow Bean executor instance and register a new DispatcherFlow Bean executor instance through the Spring container. The code generation mode statically translates the script content in Groovy script nodes into equivalent Java expressions, generating DispatcherFlow Java configuration classes based on templates that do not depend on Groovy or script engines.
[0007] Furthermore, the standard nodes include SQL nodes, HTTP call nodes, and internal service call nodes.
[0008] Furthermore, the SQL node generates parameterized query statements through the graphical selector of non-BPMN business processes and attributes configured in step S1, prohibiting the direct input of raw SQL statements.
[0009] Furthermore, when the HTTP call node and the internal service call node are executed, the target address or service identifier they call must be in a pre-configured access whitelist.
[0010] Furthermore, the Groovy script node implements conditional judgment, data mapping, and simple calculation logic, and prohibits the execution of file system, network operations, and access to dangerous classes in hot update mode.
[0011] Furthermore, the DispatcherFlow executor is implemented independently of Spring Integration, but can reuse the standard MessageHandler component of Spring Integration.
[0012] A visual backend business flow execution system that supports hot updates and code generation. It adopts a visual backend business flow execution method that supports hot updates and code generation, including a non-BPMN visual orchestration module, a DispatcherFlow executor, a Groovy script node management and sandbox execution module, a Spring Bean dynamic management module, and a script-to-Java translator. The non-BPMN visual orchestration module is used to configure non-BPMN business processes through a visual interface. The non-BPMN business process includes standard nodes and Groovy script nodes, and data is passed between the standard nodes and Groovy script nodes through the process-level global context. The DispatcherFlow executor is used to construct DispatcherFlow executor instances. The message model of the DispatcherFlow executor instance is compatible with the message model of Spring Integration. The global context is encapsulated as the payload of a Message. Data is transmitted between standard nodes and Groovy script nodes through MessageChannel. Each node implements the MessageHandler interface. The Groovy script node management and sandbox execution module is used to execute the script content of the Groovy script node in a secure sandbox by dynamic compilation at runtime in hot update mode. The Spring Bean dynamic management module is used to dynamically unload the old DispatcherFlow Bean executor instance and register a new DispatcherFlow Bean executor instance through the Spring container when the configuration of a non-BPMN business process changes. The script-to-Java translator is used to statically translate the script content in Groovy script nodes into equivalent Java expressions in code generation mode, and generate DispatcherFlow Java configuration classes based on templates that do not have Groovy or script engine dependencies.
[0013] A storage medium on which a computer program is stored, which, when executed by a processor, implements a visual backend business flow execution method that supports hot updates and code generation.
[0014] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements a visual backend business flow execution method that supports hot updates and code generation.
[0015] Compared with existing technologies, the beneficial effects of this invention are: This invention provides a visual backend business flow execution method, system, storage medium, and computer device that supports hot updates and code generation. Internally, it is independent of Spring Integration, but fully compatible with the Spring Integration programming paradigm in terms of interface and data model. It supports visual embedding of Groovy script nodes for local logic customization, achieves hot updates through dynamic management of Spring Beans, and can convert all logic (including scripts) into standard Java source code during configuration. It balances development flexibility with production stability.
[0016] Instruction manual illustrations
[0017] Figure 1 This is a schematic diagram of the visual layout interface; Figure 2 This is a diagram of the internal structure of DispatcherFlow; Figure 3 Here is a flowchart of the dual-mode execution mechanism; Detailed Implementation
[0018] The following is an explanation attached. Figure 1 , 2 The present invention will be further illustrated by references 3, 4, and 5, as well as by the embodiments.
[0019] Figure 1 Highlight the Groovy script node editing area and the node layout for non-BPMN business processes.
[0020] Figure 2 It demonstrates how to build a process using Message, MessageChannel, and MessageHandler.
[0021] Figure 3 The hot update mode (i.e., dynamic execution of Groovy script nodes) and the code generation mode (static compilation of Java) were compared.
[0022] A visual backend business flow execution method that supports hot updates and code generation, including the following steps: S1 allows you to configure non-BPMN business processes through a visual interface. Non-BPMN business processes include standard nodes and Groovy script nodes, and data is passed between standard nodes and Groovy script nodes through a process-level global context.
[0023] Specifically, users define the mapping rules between source field paths and target field paths through a browser using a drag-and-drop table or graph. These mapping rules form the Set or Get methods of the data object.
[0024] It supports drag-and-drop canvases and supports a standard number of nodes greater than or equal to 40 (such as SQL, HTTP, Service calls, and sub-processes) as well as Groovy script nodes.
[0025] Simple computational logic specifically includes conditional judgment, set processing, and loop traversal.
[0026] Specifically, the dangerous classes include File and Socket.
[0027] Standard nodes and Groovy script nodes communicate via a process-level global context (Payload).<Input, Output> (Transmit data.)
[0028] S2 constructs a DispatcherFlow executor instance. The DispatcherFlow executor instance's message model is compatible with Spring Integration's message model, encapsulating the global context as a Message payload. Data is passed between standard nodes and Groovy script nodes via MessageChannel, and each node implements the MessageHandler interface. The DispatcherFlow executor instance is lightweight and efficient (single-process memory <50KB), without the burden of a BPMN engine, and is fully controllable. It can directly call Spring Integration's standard handlers (such as HttpRequestExecutingMessageHandler). It supports control structures such as IF / ELSE, SWITCH / CASE, and FOR loops, and is natively mapped to the process topology.
[0029] Provides a dual-mode usage mechanism: In hot-reload mode, the script content of Groovy script nodes is dynamically compiled and executed in a secure sandbox at runtime. When the configuration of non-BPMN business processes changes, the Groovy script nodes dynamically unload the old DispatcherFlow Bean executor instance and register a new DispatcherFlow Bean executor instance through the Spring container. This achieves zero-downtime hot reloading of business logic. Based on Spring container lifecycle management, thread safety and resource reclamation are ensured, making hot reloading reliable.
[0030] Configuration changes for non-BPMN business processes are essentially script modifications to Groovy script nodes.
[0031] The Groovy script node implements conditional statements, data mapping, and simple computational logic, and prohibits file system, network operations, and access to dangerous classes in hot update mode. Groovy script nodes run in a restricted security sandbox in hot update mode, providing a higher level of security.
[0032] The code generation mode statically translates the script content within Groovy script nodes into equivalent Java expressions (e.g., context.amount > 1000 → (Double)context.get("amount") > 1000), generating a DispatcherFlow Java configuration class based on a template that does not depend on Groovy or the script engine. Groovy script nodes are only used for local script nodes and support one-click conversion to pure Java expressions, offering flexibility and security. Java expressions can be incorporated into version control, CI / CD, and manual auditing processes.
[0033] Preferably, the standard nodes include SQL nodes, HTTP call nodes, and internal service call nodes.
[0034] The SQL node generates parameterized query statements through a graphical selector of non-BPMN business processes and attributes configured in step S1, prohibiting the direct input of raw SQL statements. This provides a higher level of security.
[0035] When the HTTP call node and the internal service call node are executed, the target address or service identifier they call must be in the pre-configured access whitelist.
[0036] Preferably, the DispatcherFlow executor is implemented independently of Spring Integration, but can reuse the standard MessageHandler component of Spring Integration, thus exhibiting ecosystem integration.
[0037] A visual backend business flow execution system that supports hot updates and code generation. It adopts a visual backend business flow execution method that supports hot updates and code generation, including a non-BPMN visual orchestration module, a DispatcherFlow executor, a Groovy script node management and sandbox execution module, a Spring Bean dynamic management module, and a script-to-Java translator. The non-BPMN visual orchestration module is used to configure non-BPMN business processes through a visual interface. The non-BPMN business process includes standard nodes and Groovy script nodes, and data is passed between the standard nodes and Groovy script nodes through the process-level global context. The DispatcherFlow executor is used to construct DispatcherFlow executor instances. The message model of the DispatcherFlow executor instance is compatible with the message model of Spring Integration. The global context is encapsulated as the payload of a Message. Data is transmitted between standard nodes and Groovy script nodes through MessageChannel. Each node implements the MessageHandler interface. The Groovy script node management and sandbox execution module is used to execute the script content of the Groovy script node in a secure sandbox by dynamic compilation at runtime in hot update mode. The Spring Bean dynamic management module is used to dynamically unload the old DispatcherFlow Bean executor instance and register a new DispatcherFlow Bean executor instance through the Spring container when the configuration of a non-BPMN business process changes. The script-to-Java translator is used to statically translate the script content in Groovy script nodes into equivalent Java expressions in code generation mode, and generate DispatcherFlow Java configuration classes based on templates that do not have Groovy or script engine dependencies.
[0038] A storage medium on which a computer program is stored, which, when executed by a processor, implements a visual backend business flow execution method that supports hot updates and code generation.
[0039] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements a visual backend business flow execution method that supports hot updates and code generation.
[0040] The risk control process for e-commerce orders will be used as an example for further explanation.
[0041] S1, Visual Configuration
[0042] S101, User drags in nodes: SQL node (query order) → Groovy script node (data preparation) → BRM rule node (risk control rule) → branch processing; SQL nodes are generated from non-BPMN business process configurations: SELECT FROM orders WHERE amount >?; S102, written in the Groovy script node: payload.orderAmount = payload.unitPrice payload.orderAmt; S2 provides a dual-mode usage mechanism. S201, Hot Update Mode S2011, Building a DispatcherFlow executor instance: public class OrderRiskFlow extends DispatcherFlow { public void configure() { from("inputChannel") .handle(sqlMessageHandler) / / Query orders .handle(new ScriptMessageHandler( "payload.orderAmount = payload.unitPrice payload.orderAmt;" )) .handle(ruleMessageHandler) / / Execute the rule .route(r -> r / / Route based on rule results) .subFlow(true).to("highRiskChannel") .subFlow(false).to("normalChannel") ); } } S2012, register this instance as a Spring Bean orderRiskFlow; In S2013, after modifying the Groovy script node, the DispatcherFlow executor calls beanFactory.destroySingleton("orderRiskFlow") to re-instantiate OrderRiskFlow and update the Bean through registry.registerSingleton("orderRiskFlow", newInstance); The script content of Groovy script nodes is executed in a secure sandbox at runtime through dynamic compilation; S2014, new requests automatically use the new logic; S202, Code Generation Mode S2021 converts the script content in Groovy script nodes into Java code (i.e., Java expressions): public Message amount(Message message){ message.getPayload().setOrderAmount(message.getPayload().getUnitPrice() message.getPayload().getOrderAmt()); return message; } S2022, converting DispatcherFlow to Java code: public Message orderRisk(Message message){ sqlMessageHandler.handle(message); amount(message); ruleMessageHandler.handle(message); if(message.getRisk()){ / / Execute high-risk logic }else{ / / Execute low-risk logic } } The specific embodiments described are preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. All equivalent changes made to the structure, shape, and principle of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A visual backend business flow execution method that supports hot updates and code generation, characterized in that: Including the following steps: S1 allows configuration of non-BPMN business processes through a visual interface. Non-BPMN business processes include standard nodes and Groovy script nodes. Data is passed between standard nodes and Groovy script nodes through a process-level global context. S2, construct a DispatcherFlow executor instance. The message model of the DispatcherFlow executor instance is compatible with the message model of Spring Integration. The global context is encapsulated as the payload of Message. Data is passed between standard nodes and Groovy script nodes through MessageChannel. Each node implements the MessageHandler interface. Provides a dual-mode usage mechanism: In hot update mode, the script content of Groovy script nodes is dynamically compiled and executed in a secure sandbox at runtime. When the configuration of non-BPMN business processes changes, Groovy script nodes dynamically unload the old DispatcherFlow Bean executor instance and register a new DispatcherFlow Bean executor instance through the Spring container. The code generation mode statically translates the script content in Groovy script nodes into equivalent Java expressions, generating DispatcherFlow Java configuration classes based on templates that do not depend on Groovy or script engines.
2. The visual backend business flow execution method supporting hot updates and code generation as described in claim 1, characterized in that: The standard nodes include SQL nodes, HTTP call nodes, and internal service call nodes.
3. The visual backend business flow execution method supporting hot updates and code generation as described in claim 2, characterized in that: The SQL node generates parameterized query statements through the graphical selector of non-BPMN business processes and attributes configured in step S1, and prohibits direct input of raw SQL statements.
4. The visual backend business flow execution method supporting hot updates and code generation as described in claim 2, characterized in that: When the HTTP call node and the internal service call node are executed, the target address or service identifier they call must be in the pre-configured access whitelist.
5. The visual backend business flow execution method supporting hot updates and code generation as described in claim 1, characterized in that: The Groovy script node implements conditional judgment, data mapping, and simple calculation logic, and prohibits the execution of file system, network operations, and access to dangerous classes in hot update mode.
6. The visual backend business flow execution method supporting hot updates and code generation as described in claim 1, characterized in that: The DispatcherFlow executor is implemented independently of Spring Integration, but can reuse Spring Integration's standard MessageHandler component.
7. A visual backend business flow execution system supporting hot updates and code generation, employing the visual backend business flow execution method supporting hot updates and code generation as described in any one of claims 1-6, characterized in that: It includes a non-BPMN visual orchestration module, a DispatcherFlow executor, a Groovy script node management and sandbox execution module, a Spring Bean dynamic management module, and a script-to-Java translator; The non-BPMN visual orchestration module is used to configure non-BPMN business processes through a visual interface. The non-BPMN business process includes standard nodes and Groovy script nodes, and data is passed between the standard nodes and Groovy script nodes through the process-level global context. The DispatcherFlow executor is used to construct DispatcherFlow executor instances. The message model of the DispatcherFlow executor instance is compatible with the message model of Spring Integration. The global context is encapsulated as the payload of a Message. Data is transmitted between standard nodes and Groovy script nodes through MessageChannel. Each node implements the MessageHandler interface. The Groovy script node management and sandbox execution module is used to execute the script content of the Groovy script node in a secure sandbox by dynamic compilation at runtime in hot update mode. The Spring Bean dynamic management module is used to dynamically unload the old DispatcherFlow Bean executor instance and register a new DispatcherFlow Bean executor instance through the Spring container when the configuration of a non-BPMN business process changes. The script-to-Java translator is used to statically translate the script content in Groovy script nodes into equivalent Java expressions in code generation mode, and generate DispatcherFlowJava configuration classes based on templates that do not have Groovy or script engine dependencies.
8. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the visual backend business flow execution method that supports hot updates and code generation as described in any one of claims 1-6.
9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements the visual backend business flow execution method that supports hot updates and code generation as described in any one of claims 1-6.