A dynamic routing assembly rendering method, system, medium and program product
By using a dynamic routing assembly rendering method, the path conflict problem of assembling multiple modules in low-code software platforms is solved, enabling flexible loading and stable rendering of modules, supporting multi-platform adaptation, reducing redundant configuration, and improving the flexibility and stability of applications.
Patent Information
- Application Number
- CN202611312098.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-27
- Publication Date
- 2026-11-20
AI Technical Summary
In a low-code software SaaS platform, how can we dynamically load and assemble page routes for multiple independent business modules in a front-end single-page application, ensuring that the URL paths between modules do not conflict, and that modules can be freely added or removed without rebuilding the application?
A dynamic routing assembly rendering method is adopted. By loading the front-end configuration, business capability package list and internationalization resources in parallel, multi-dimensional conflict detection is performed to generate a three-level routing tree structure. When receiving user access, path matching and page rendering are performed. A path concatenation function is used to add a prefix identifier to each business capability package to ensure path uniqueness and compatibility.
It enables dynamic loading and assembly of modules without rebuilding the application, ensures no path conflicts, supports multi-platform layout adaptation, reduces redundant configuration, improves the flexibility and stability of modules, and avoids runtime rendering errors.
Smart Images

Figure CN123137780A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of low-code software technology, and in particular to a dynamic routing assembly rendering method, system, medium, and program product. Background Technology
[0002] Low-code Software as a Service (SaaS) platforms need to serve multiple tenants (enterprise customers), and each tenant's application consists of several business modules (such as customer management, human resources, finance, etc.). These business modules need to be able to be developed independently, deployed independently, and assembled into the applications of different tenants on demand.
[0003] The core challenge lies in how to dynamically load and assemble page routes for multiple independent business modules at runtime within a single-page application, ensuring that the Uniform Resource Locator (URL) paths between modules do not conflict and that modules can be freely added or removed without rebuilding the application.
[0004] Specifically, this is manifested in: 1. The number and combination of business modules are not determined during front-end construction. Different tenants use different modules, and new modules can be launched at any time. 2. Each business module needs to have its own page and path, but multiple modules share the same front-end application shell (navigation bar, layout template). 3. The CRUD pages of business modules have highly standardized path patterns, such as create, edit, view, and process approval. Manually configuring each one is inefficient. 4. The platform needs to support both desktop and mobile devices, with the same module having different layout templates on both platforms but reusing the same business pages; 5. Multiple business capability packages come from different developers, and their routing declarations may have path conflicts. For example, if two business capability packages declare the same custom path, it is necessary to automatically detect and reject them during the assembly stage. Therefore, how to provide a dynamic routing assembly rendering method, system, media, and program product is an urgent problem to be solved. Summary of the Invention
[0005] This invention provides a dynamic routing assembly rendering method, system, medium, and program product to solve the problems of the above-mentioned technologies in the prior art.
[0006] According to a first aspect of the present invention, a method for assembling and rendering dynamic routes is provided.
[0007] In one embodiment, the dynamic routing assembly rendering method includes the following steps: After the front-end application starts, it initiates asynchronous requests in parallel, including loading the front-end configuration, loading the list of business capability packages, and loading internationalization resources. After the asynchronous requests are completed, it performs internationalization translation processing on the list of business capability packages to obtain the loaded list of business capability packages. Perform multi-dimensional conflict detection on the loaded list of service capability packages, and inject a predefined standard path pattern into each service capability package that passes the conflict detection. Then, add a prefix identifier to all routing paths of each service capability package through the path concatenation function to generate a three-level routing tree structure. Based on the three-level routing tree, a route instance is created. When the resource locator accessed by the user is received, the front-end routing engine locates the target route node through a path pattern matching algorithm. By reading the page type field pre-annotated in the target route node, the renderer component obtains the structured description configuration file through the three-segment path structure, and completes the page rendering through the structured description configuration file.
[0008] According to a second aspect of the present invention, a dynamic routing assembly rendering system is provided.
[0009] In one embodiment, the dynamic routing assembly rendering system includes: The configuration loading module is used to initiate asynchronous requests in parallel after the front-end application starts, including loading the front-end configuration, loading the list of business capability packages, and loading internationalization resources. After the asynchronous requests are completed, internationalization translation processing is performed on the list of business capability packages to obtain the loaded list of business capability packages. The routing assembly engine module is used to perform multi-dimensional conflict detection on the loaded list of service capability packages, and inject a predefined standard path pattern into each service capability package that passes the conflict detection, so as to add a prefix identifier to all routing paths of each service capability package through the path concatenation function, and generate a three-level routing tree structure. The route matching and page rendering module is used to create route instances based on the three-level route tree. When the front-end route engine receives the resource locator accessed by the user, it locates the target route node through the path pattern matching algorithm. By reading the page type field pre-annotated in the target route node, the renderer component obtains the structured description configuration file through the three-segment path structure, and completes the page rendering through the structured description configuration file.
[0010] According to a third aspect of the present invention, a computer-readable storage medium is provided.
[0011] In one embodiment, a computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the steps of the above method.
[0012] According to a fourth aspect of the present invention, a computer program product is provided.
[0013] In one embodiment, the computer program product stores a computer program that, when executed by a processor, implements the steps of the method.
[0014] The technical solutions provided by the embodiments of the present invention may include the following beneficial effects: 1. In this invention, PBC is a pure configuration that can be enabled / disabled at any time on the backend, and the frontend can respond to module changes without needing to be rebuilt.
[0015] 2. In this invention, multiple PBCs coexist in the same application, and the PBC identifier prefix ensures that the paths will never conflict.
[0016] 3. This invention performs identifier uniqueness verification, path segment legality verification, and parameterized path priority conflict detection before route assembly, thereby discovering and blocking route conflict issues during the assembly stage, rather than causing rendering errors that are difficult to troubleshoot at runtime.
[0017] 4. The automatic injection of the universal route template in this invention eliminates most of the duplicate route declarations. Each PBC only needs to declare 2-3 custom routes to obtain complete standard path coverage for form CRUD, process, and general pages.
[0018] 5. This invention allows the same PBC configuration to serve both desktop and mobile devices simultaneously. It achieves dual-platform adaptation by automatically adding path prefixes and switching layout template references, eliminating the need for repeated configuration.
[0019] 6. The layout template layer and business page layer of this invention are completely decoupled. Switching the visual style only requires modifying the template name in the application configuration, without affecting any business logic and routing structure.
[0020] 7. This invention avoids the performance problem of route tree reconstruction triggered by reference changes by passing the context through a single reference object, and maintains the stability of the routing structure in scenarios where user permissions change in real time.
[0021] 8. This invention uses a combination of PBC identifier, form entity identifier, and layout identifier to uniquely determine a rendering configuration, which can support the existence of business objects with the same name under different PBCs without affecting each other.
[0022] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention. Attached Figure Description
[0023] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0024] Figure 1 This is a flowchart illustrating a dynamic routing assembly and rendering method according to an exemplary embodiment; Figure 2 This is a schematic diagram of a dynamic routing assembly rendering system according to an exemplary embodiment; Figure 3 This is a flowchart illustrating a dynamic routing assembly and rendering method according to an exemplary embodiment; Figure 4 This is a layered rendering architecture diagram illustrating a dynamic routing assembly rendering method according to an exemplary embodiment; Figure 5 This is a schematic diagram illustrating the PBC namespace and standard path injection method for assembling and rendering dynamic routes according to an exemplary embodiment. Figure 6 This is a flowchart illustrating a conflict detection process for a dynamic routing assembly and rendering method according to an exemplary embodiment. Figure 7 This is a flowchart illustrating a three-stage configuration path acquisition process in a dynamic routing assembly rendering method according to an exemplary embodiment. Detailed Implementation
[0025] The following description and accompanying drawings fully illustrate specific embodiments described herein to enable those skilled in the art to practice them. Some portions and features of certain embodiments may be included in or replace portions and features of other embodiments. The scope of the embodiments herein includes the entire scope of the claims and all available equivalents thereof. The various embodiments described herein are presented in a progressive manner, with each embodiment focusing on its differences from other embodiments; similar or identical parts between embodiments can be referred to interchangeably.
[0026] The modules in the apparatus or system of this application can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0027] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0028] Figure 1 An embodiment of the dynamic routing assembly rendering method of the present invention is shown.
[0029] In this optional embodiment, the dynamic route assembly rendering method includes the following steps: Step S101: After the front-end application starts, it initiates asynchronous requests in parallel, including loading the front-end configuration, loading the list of business capability packages, and loading internationalization resources. After the asynchronous requests are completed, it performs internationalization translation processing on the list of business capability packages to obtain the loaded list of business capability packages. Step S102: Perform multi-dimensional conflict detection on the loaded list of service capability packages, and inject a predefined standard path pattern into each service capability package that passes the conflict detection, so as to add a prefix identifier to all routing paths of each service capability package through the path concatenation function to generate a three-level routing tree structure. Step S103: Create a route instance based on the three-level routing tree. When the resource locator accessed by the user is received, the front-end routing engine locates the target route node through the path pattern matching algorithm. By reading the page type field pre-annotated in the target route node, the renderer component obtains the structured description configuration file (JSON Schema configuration file) through the three-segment path structure, so as to complete the page rendering through the structured description configuration file.
[0030] In this optional embodiment, the step of initiating asynchronous requests in parallel after the front-end application starts, including loading the front-end configuration, loading the business capability package list, and loading internationalization resources, and performing internationalization translation processing on the business capability package list after the asynchronous requests are completed, to obtain the loaded business capability package list includes the following steps: After the front-end application starts, three independent asynchronous requests are triggered to obtain the front-end configuration information, the business capability package list, and the multilingual internationalization resource package, respectively; after all asynchronous requests return successfully, each business capability package in the business capability package list is traversed, and its fields are translated using the multilingual internationalization resource package; the translated business capability packages are then summarized to form the loaded business capability package list.
[0031] In this optional embodiment, the step of performing multi-dimensional conflict detection on the loaded list of service capability packages and injecting a predefined standard path pattern into each service capability package that passes the conflict detection, so as to add a prefix identifier to all routing paths of each service capability package through a path concatenation function to generate a three-level routing tree structure, includes the following steps: performing multi-dimensional conflict detection on the loaded list of service capability packages and removing abnormal service capability packages according to the detection results; for each service capability package that passes the conflict detection, injecting a predefined standard path pattern into the routing declaration contained in the service capability package; for service capability packages that have completed the injection of standard path patterns, adding a prefix identifier to all routing paths of each service capability package through a path concatenation function to generate a desktop / mobile dual-tree structure; and generating a three-level routing tree structure by merging based on the desktop / mobile dual-tree structure and combined with application-level routing.
[0032] In this optional embodiment, the step of performing multi-dimensional conflict detection on the list of loaded service capability packages and removing abnormal service capability packages based on the detection results includes: initializing a set of registered identifiers, traversing each service capability package in the list of loaded service capability packages, and checking whether the identifier token of the service capability package already exists in the set of registered identifiers; if it exists, it is determined that the service capability package has an identifier duplication conflict, an exception is thrown and route assembly is terminated; if it does not exist, the identifier token is added to the set of registered identifiers until all service capability packages have completed the identifier duplication conflict detection; based on preset path segment verification requirements, for each service capability package that passes the identifier uniqueness verification, the following steps are performed: The path keys in the routing declaration undergo format validation. If they meet the preset path segment validation requirements, the format validation passes; otherwise, it fails. For service capability packages that pass format validation, parameterized path priority conflict detection is performed between their custom routing declaration and the predefined standard path pattern to check for ambiguities between static and parameterized paths. If ambiguities exist, the parameterized path priority conflict detection fails; otherwise, it succeeds. Service capability packages that fail format validation or parameterized path priority conflict detection are treated as abnormal service capability packages and removed from the service capability package list. The remaining service capability packages are output as a list of service capability packages that pass conflict detection.
[0033] In this optional embodiment, the format verification includes checking whether the path segment starts with a forward slash, whether it contains illegal special characters, and whether it conflicts with a pre-reserved prefix.
[0034] In this optional embodiment, the step of injecting the predefined standard path pattern into the route declaration contained in the service capability package according to its pre-configured page attributes for each service capability package that passes the conflict detection includes the following steps: obtaining a set of predefined standard path patterns; for each service capability package that passes the conflict detection, traversing each standard path pattern in the set of standard path patterns and comparing the standard path pattern with the route path declared by the service capability package itself; if the service capability package itself has declared a custom route with the same path segment as the standard path pattern, the route declared by the service capability package itself has a higher priority and the standard path pattern is not injected; otherwise, the standard path pattern is added to the route declaration of the service capability package; the page type field pre-annotated in the injected standard path pattern is synchronously written into the configuration of the corresponding route node in the route declaration of the service capability package, thus completing the injection of the standard path pattern into the route declaration of the service capability package.
[0035] In this optional embodiment, the standard path pattern includes form entity routing, form view routing, process initiation routing, process approval routing, and general page routing.
[0036] In this optional embodiment, for a service capability package that has completed standard path pattern injection, adding a prefix identifier to all routing paths of each service capability package using a path concatenation function to generate a desktop / mobile dual-tree structure includes: for a service capability package that has completed standard path pattern injection, obtaining its identifier token, and calling the path concatenation function to concatenate the identifier token as a prefix to each routing path of the desktop terminal object in the routing declaration of the service capability package, thereby generating a desktop routing path; for the same service capability package, calling the path concatenation function to concatenate a preset mobile terminal identifier (e.g., / mobile / ) and the identifier token of the service capability package as prefixes to each routing path of the mobile terminal object in the routing declaration of the service capability package, thereby generating a mobile routing path; and constructing a desktop routing tree and a mobile routing tree respectively based on the desktop routing path and the mobile routing path to generate a desktop / mobile dual-tree structure. In this optional embodiment, the step of generating a three-level routing tree structure based on a desktop / mobile dual-tree structure and combined with application-level routing includes the following steps: configuring page routes that do not require authentication as top-level routing nodes to form first-level routing nodes; constructing desktop layout template framework nodes and mobile layout template framework nodes, and wrapping the layout template framework nodes in an authentication component to form second-level routing nodes; mounting the service capability package service page routes in the desktop routing tree and mobile routing tree as sub-routes to the corresponding layout template framework nodes to form third-level routing nodes; and merging the first-level routes, second-level routes, and third-level routes to generate a three-level routing tree structure.
[0037] In this optional embodiment, the steps of creating a route instance based on the three-level routing tree and, upon receiving a resource locator accessed by the user, the front-end routing engine locates the target route node using a path pattern matching algorithm, and the renderer component obtains a structured description configuration file (JSON Schema configuration file) through a three-segment path structure by reading the pre-annotated page type field in the target route node, to complete page rendering using the structured description configuration file, include the following steps: After receiving the resource locator accessed by the user, the front-end routing engine performs path pattern matching between the resource locator and the created three-level routing tree to locate the target route node and extract the resource locator parameters; the page rendering scheduler reads the pre-annotated page type field in the target route node, performs string matching based on the page type field to determine the rendering strategy, and selects the corresponding renderer component; the renderer component extracts the form entity identifier, layout identifier, and data record identifier from the resource locator parameters, and sends a request to the backend based on the three-segment path structure to obtain the corresponding structured description configuration file; the obtained structured description configuration file is passed to the general form renderer, which dynamically generates the page and completes the rendering.
[0038] In this optional embodiment, the renderer component extracts the form entity identifier, layout identifier, and data record identifier from the resource locator parameters, and initiates a request to the backend based on a three-segment path structure to obtain the corresponding structured description configuration file. This includes the following steps: The renderer component calls the form configuration selector to check if a pre-compiled configuration file corresponding to the business capability package identifier, form entity identifier, and layout identifier exists locally; if a pre-compiled page structure file (schema file) exists locally, it directly loads the page structure file locally as the structured description configuration file; if it does not exist locally, the form configuration selector concatenates the backend interface request path with the business capability package identifier as the first path segment, the form entity identifier as the second path segment, and the layout identifier as the third path segment, and initiates a request to the backend to obtain the structured description configuration file; while requesting the structured description configuration file from the backend, it also requests the form entity metadata in parallel; the obtained form entity metadata is appended to the structured description configuration file and merged into the final structured description configuration file.
[0039] Figure 2 An embodiment of a dynamic routing assembly rendering system according to the present invention is shown.
[0040] In this optional embodiment, the dynamic routing assembly rendering system includes: the system includes: The configuration loading module 201 is used to initiate asynchronous requests in parallel after the front-end application starts, including loading the front-end configuration, loading the list of business capability packages, and loading internationalization resources. After the asynchronous requests are completed, internationalization translation processing is performed on the list of business capability packages to obtain the loaded list of business capability packages. The routing assembly engine module 202 is used to perform multi-dimensional conflict detection on the loaded list of service capability packages, and inject a predefined standard path pattern into each service capability package that passes the conflict detection, so as to add a prefix identifier to all routing paths of each service capability package through the path concatenation function to generate a three-level routing tree structure. The route matching and page rendering module 203 is used to create route instances based on the three-level route tree. When the front-end route engine receives the resource locator accessed by the user, it locates the target route node through the path pattern matching algorithm. By reading the page type field pre-annotated in the target route node, the renderer component obtains the structured description configuration file (JSON Schema configuration file) through the three-segment path structure, so as to complete the page rendering through the structured description configuration file.
[0041] To facilitate understanding of the above technical solutions of the present invention, the following further explains the above technical solutions of the present invention from the perspective of architecture and principle, as follows: The core idea of this solution is: (1) A business module (called a Packaged BusinessCapability, or PBC for short) is just a configuration, which includes module metadata and route declarations (i.e., which paths correspond to which configuration modes); (2) When the front-end application starts, it dynamically pulls the list of all PBCs activated by the current tenant from the back-end; (3) Multi-dimensional conflict detection is performed during the route assembly stage, including PBC identifier uniqueness verification, route path duplication detection, and priority conflict detection between parameterized paths and static paths, to ensure that the merged route tree is unambiguous; (4) During runtime, the route declarations of all PBCs are merged into a complete route tree, and the route of each PBC is automatically isolated in namespaces by prefixing it with its unique identifier; (5) At the same time, a set of standard path modes (create / edit / view / process, etc.) are automatically injected into each PBC.
[0042] The standard path pattern refers to a set of URL path templates automatically injected by the platform for each PBC. These templates use route parameter placeholders (path segments starting with a colon, such as :formEntityToken) to define common page access rules. The standard path pattern abstracts the most common page access scenarios in PBC (form CRUD operations, workflow initiation and approval, and general page access) into fixed-format path rules, which PBC developers can use without having to declare them individually.
[0043] Specifically, business modules are defined as Business Capability Packages (PBCs) in pure configuration form. At runtime, the front-end application retrieves the list of currently active PBCs from the back-end, performs multi-dimensional conflict detection, dynamically assembles the route tree, and maps the paths to the actual page rendering through a layered rendering pipeline (layout templates, page rendering scheduler, form configuration selector, and form renderer). The overall architecture includes the following layers: 1. Configuration loading layer: When the application starts, it loads the application configuration (including template selection, title, internationalization configuration, etc.), routing configuration file, internationalization language resources and PBC list in parallel; 2. Conflict Detection Layer: Performs multi-dimensional conflict detection on the loaded PBC list and route declarations, including uniqueness verification, path duplication detection, and parameterized path priority conflict detection; 3. Route Assembly Layer: Merges application-level routes, route declarations for each PBC, and general route templates into a complete front-end route tree; 4. Layout Template Layer: The layout template component serves as the outer shell node of the route tree, providing layout frameworks such as navigation bars and sidebars, and rendering sub-route content through sub-route exits; 5. Page rendering layer: The page rendering scheduler determines the rendering strategy based on the page type field in the routing parameters, and the form configuration selector obtains the form JSON Schema configuration and drives the form rendering.
[0044] The form JSON Schema configuration refers to the form rendering configuration file defined in JSON format. It describes the complete structure of a form page, including which fields, field types, layout arrangement, validation rules, data source binding, event handling, etc. After the page rendering scheduler obtains this configuration, it passes it to the general form renderer, which then dynamically generates the page UI according to the configuration.
[0045] The specific steps are as follows: Step 1: Application startup and configuration loading in parallel; After the front-end application starts, the following three sets of asynchronous requests are initiated in parallel: Group 1: Frontend configuration loading; Application configuration (JSON format, including template name, application title, internationalization configuration such as a list of allowed languages, etc.) and route configuration (JSON format, including application-level custom route declarations) are obtained from the backend interface (cloud service mode) or the local file system (local development mode). Both modes use the same JSON data structure, differing only in their data source.
[0046] The second group: Loading the PBC list; obtaining the list of PBCs activated by the current tenant from the backend interface. Each PBC data includes: a unique identifier (token string), a category (BUSINESS represents the business module), and a route declaration (JSON string, containing two sub-objects, desktop and mobile, where the key of each sub-object is the route path and the value is the route configuration).
[0047] The third step involves loading internationalization resources. First, the custom translation resource files are loaded. Then, the missing language translation entries are completed based on the allowed language list in the application configuration (using the default language translation as a fallback). Finally, the i18n initialization function is called to complete the creation of the internationalization runtime. After initialization, the localization package for the UI framework corresponding to the current language (such as the localized text for components like date pickers and paginators) is also loaded.
[0048] Internationalized language resources refer to multilingual translation files of the system interface text, such as key-value pairs in Chinese, English, and Japanese, used to switch the interface display language according to the user's language preference. Specifically, this includes built-in translation resources (such as the button text "Submit") and business-defined translation resources (such as menu names, field labels, etc.). During loading, the translation resources are injected into the internationalization runtime via the i18n initialization function, enabling all subsequent components to obtain the text in the current language through the translation function.
[0049] It's important to explain the specific processing steps of the i18n initialization function: The i18n initialization function establishes a translation environment for front-end components based on the application configuration and loaded internationalized language resources. The function first reads the list of allowed languages and the default language from the application configuration, then determines the language to use: It prioritizes the language specified in the URL; if not specified, it uses the user's previously saved language selection; if no allowed language is found, it uses the browser language; if none of the above methods yield a allowed language, it uses the default language.
[0050] After the language is determined, the function adds the loaded business translation resources and system translation resources to the translation environment. If a certain language does not provide a translation text, the corresponding translation text in the default language is used. After initialization, the function provides the translation environment to components such as navigation menus, field titles, and buttons in the application; it also loads the text for UI components such as date pickers and paginators corresponding to the current language. If initialization fails, an initialization failure message is displayed, and the process of proceeding to the subsequent route creation is stopped.
[0051] After all three sets of requests are completed, the system performs internationalization translation on the front-end configuration and PBC list (replacing the translatable fields with text in the current language), and then enters the conflict detection and route assembly stage.
[0052] Step 2; PBC conflict detection; such as Figure 6 As shown, before assembling routes, the system performs the following conflict checks on the loaded PBC list, including: (1) PBC Identifier Uniqueness Verification: The system maintains a set of registered identifiers (set data structure), and iterates through each PBC entry in the PBC list with the category "BUSINESS". For each PBC, it checks whether its token already exists in the set: If the token already exists: throw an exception, terminate route assembly, and the error message should clearly indicate that the token value is duplicated (e.g., "Twopbc has the same token crm"). If it does not exist: add the token to the set and continue processing the next PBC; This verification ensures that each PBC has a globally unique namespace prefix in the current tenant application, fundamentally avoiding routing path overlay issues caused by duplicate identifiers.
[0053] (2) Route path segment validity verification: Perform format verification on the path keys (such as "report / sales", "org-chart") in the route declaration of each PBC: Path segments must not begin with a forward slash (relative path requirement); The path segment must not contain special characters (only letters, numbers, hyphens, forward slashes, and route parameter placeholders are allowed); The path segment must not conflict with the reserved prefixes of the standard path pattern (such as not starting with "form / ", "flow / ", or "page / ", because these prefixes have been used by the general route template). (3) Parameterized path priority conflict detection: When merging the custom route declarations and standard route templates of each PBC, detect whether there is any ambiguity between static paths and parameterized paths: If a PBC custom route declares the path "form / customer" (static), while the standard route template contains "form / :formEntityToken" (parameterized), ambiguity may arise when matching routes. The system detects such conflicts through a path segment comparison algorithm: the path is divided into a segment array by slashes, and the overlap between the static segment and the parameter segment is compared segment by segment. If the static segments of two paths match completely and one path contains a parameter segment, it is marked as a potential conflict and an alarm log is recorded. If necessary, it can be removed. This triple detection mechanism ensures the security of multi-PBC route merging, which is a key technical feature that distinguishes it from simple route merging schemes in existing technologies.
[0054] Step 3: Router assembly; such as... Figure 3 As shown, the route assembly engine performs the following merging logic on the list of PBCs that have passed collision detection: (a) Injection of general route templates; such as Figure 5 As shown, the system predefines a set of standard path patterns, covering the most common page types in low-code platforms. These patterns use route parameter placeholders to represent the variable parts: (1) Create a new form page: form / :formEntityToken / layout / :layoutToken.
[0055] Here, `:formEntityToken` is the form entity identifier, used to identify a specific business object, such as "customer" representing a customer form; `:layoutToken` is the layout identifier, used to identify the view layout of the form, such as "list" representing a list layout and "detail" representing a detail layout. The page type is marked as ENTITY.
[0056] (2) Form editing page: form / :formEntityToken / layout / :layoutToken / :formEntityDataId.
[0057] Append `:formEntityDataId` to the URL of the newly created page to identify the data record. When the URL contains the data record identifier, the system automatically determines that it is in edit mode and loads the record data. The page type is marked as ENTITY.
[0058] (3) Default view page for forms: form / :formEntityDataId / view.
[0059] Load the default read-only view of the corresponding form based on the data record identifier. The page type is labeled ENTITY-VIEW.
[0060] (4) The form specifies the entity view page: form / :formEntityToken / :formEntityDataId / view.
[0061] Specify the form entity identifier and data record identifier to load a read-only view. The page type is labeled ENTITY-VIEW.
[0062] (5) Process initiation page: flow / :flowToken / new.
[0063] Here, :flowToken is the process definition identifier. The page type is marked as FLOW-FORM.
[0064] (6) Process editing page: flow / :flowInstanceId / edit.
[0065] Here, :flowInstanceId is the process instance identifier. The page type is labeled FLOW-FORM.
[0066] (7) Process approval page: flow / :flowInstanceId / approval.
[0067] The page type is labeled as FLOW-APPROVAL.
[0068] (8) Process approval initiation page: flow / :flowToken / approval-new.
[0069] When the first node in the process is an approval node, the process is triggered by that node. The page type is marked as FLOW-APPROVAL.
[0070] (9) General page: page / :schemaId.
[0071] Here, `:schemaId` is the page's JSON schema configuration identifier. The page type annotation is empty and will be handled by the default renderer.
[0072] (10) PBC entry page: " / " indicates that the entry page configuration of the PBC is loaded by default relative to the root path of the PBC namespace.
[0073] When assembling each PBC, the system merges the aforementioned generic route template with the routes declared by the PBC itself. Routes declared by the PBC itself have higher priority. That is, if a PBC explicitly declares a route with the same path segment as the generic template (i.e., the generated path pattern is the same. For example, given the default `form / :formEntityDataId / view`, if the PBC explicitly declares the same `form / :formEntityDataId / view` route configuration to load different pages, the PBC declaration takes precedence), then the PBC declaration prevails, and routes with the same name in the generic template are not injected.
[0074] The relationship between the above standard path pattern and the business page type is as follows: The parameter placeholders in the standard path pattern (such as :formEntityToken, :layoutToken) are replaced with specific values (such as customer, list) when the user actually accesses the page. The page rendering scheduler selects the corresponding rendering strategy according to the page type field (such as ENTITY, FLOW-FORM) pre-marked in the route configuration, and then obtains the specific configuration file for rendering by combining the parameter values parsed from the URL.
[0075] The specific process of retrieving and rendering the configuration file using URL parameters is as follows: Taking a user accessing / crm / form / customer / layout / list / 123 as an example, the routing engine matches this URL to / crm / form / :formEntityToken / layout / :layoutToken / :formEntityDataId, and obtains the PBC identifier crm, the form entity identifier customer, the layout identifier list, and the data record identifier 123. The PBC identifier is determined by the prefix added during route assembly, while the form entity identifier, layout identifier, and data record identifier are obtained from the parameter placeholders in the URL.
[0076] The page rendering scheduler selects a form entity renderer based on the formType=ENTITY pre-marked on the route. The form entity renderer checks whether the form entity identifier and layout identifier are complete, and determines whether the current page is an edit page or a new page based on the presence of data record identifiers.
[0077] The form configuration selector then uses the PBC identifier, form entity identifier, and layout identifier to locate the specific schema configuration: first, it checks if the corresponding schema file exists locally; if it does, it reads the schema file directly; if it doesn't exist locally, it concatenates the request address according to these three identifiers to request the corresponding schema configuration, and simultaneously requests the form entity information. After obtaining the results, it passes the form entity information and schema configuration together to the general form renderer, which then generates the page according to the schema configuration. If the parameters are incomplete, the schema configuration is not obtained, or the request fails, a loading failure message is displayed, and form rendering does not proceed.
[0078] (ii) Namespace isolation (routing path prefix injection): All routes for each PBC are automatically prefixed with the PBC's token. Specifically, the path concatenation function `joinPaths([pbcToken, path])` is called to concatenate the PBC identifier with each route path. For example, if the PBC identifier is `crm`, its route `form / customer / layout / list` is actually registered as ` / crm / form / customer / layout / list`.
[0079] The relationship between routing paths (such as / crm / form / customer / layout / list) and standard path patterns (such as form / :formEntityToken / layout / :layoutToken) is as follows: a standard path pattern is a routing registration rule with parameter placeholders. When a user accesses the specific URL / crm / form / customer / layout / list, the front-end routing engine performs pattern matching between the URL and the registered path pattern / crm / form / :formEntityToken / layout / :layoutToken. If the match is successful, the parameters formEntityToken=customer and layoutToken=list are extracted and passed to the page rendering scheduler.
[0080] (III) Desktop / Mobile Dual Tree Generation: For each PBC route declaration (containing two sub-objects: desktop and mobile), generate two sets of routes for the desktop and mobile ends respectively: Desktop routing: prefixed with the PBC token (e.g., / crm / ...), referencing the desktop layout template; Mobile routing: A token prefixed with / mobile / +PBC (e.g., / mobile / crm / ...) that references the mobile layout template; The two sets of routes share the same PBC route declaration data structure, differing only in path prefixes and template references, eliminating the need for repeated configuration.
[0081] (iv) Permission Route Tag: PBC route declarations may contain access permission predicates (such as {"hasAllOf":["crm:view"]}), which are appended to the permission predicate field of the route node during assembly. When a route is converted into a renderable element, the route node containing the permission predicate is wrapped in a permission validation component, which checks whether the current user's permission mapping table satisfies the predicate conditions before rendering.
[0082] The specific judgment process for permission predicates is as follows: The user permission mapping table uses permission identifiers as keys and whether the user possesses the permission as values, for example, { "crm:view": true, "crm:edit": false}. After obtaining the current user's permission mapping table and the access permission predicates of the route nodes, the permission verification component judges them in the following order: 1. If the current user is an administrator, grant access directly; 2. If the routing node is not configured with an access permission verb, allow access; 3. If an access permission verb is configured but the user permission mapping table is not obtained, access is denied; 4. If the predicate contains hasAllOf, then check each permission identifier in the array to see if it is true in the permission mapping table; if it is true for all, access is allowed. 5. If the predicate does not contain hasAllOf but contains hasAnyOf, check if at least one of the permission identifiers in hasAnyOf is true in the permission mapping table; if at least one is true, access is allowed. 6. If both hasAllOf and hasAnyOf exist, the decision is made based on hasAllOf. 7. Display an insufficient permissions page (403) when access is denied; continue rendering the corresponding business page when access is granted.
[0083] The above judgment is used for access control when a logged-in user accesses a specific business page; whether a user is logged in is still determined by the outer authentication component.
[0084] (v) Application-level routes (application routes refer to the system's preset routes before rendering PBC, serving as the system's basic functionality. For example, / login means login, and / reset-password means password reset) are merged with PBC routes. The final merged route tree adopts a three-level structure: Level 1 (Top Level): Page routes that do not require authentication, including login pages, password reset pages, 404 pages, and pages marked with noNeedAuth: true in the PBC route declaration. These routes are rendered directly at the top level and do not go through the authentication component.
[0085] Level 2 (Layout Template Framework): One layout template framework node each for desktop and mobile. This node renders the layout template component and wraps it in an authentication component; users must be logged in to access this level. The layout template component generates a navigation menu based on the merged routing table.
[0086] The third level (business pages): sub-routes of the layout template framework nodes, i.e., the business page routes of each PBC. These routes are rendered in the content area (sub-route exit) of the layout template.
[0087] The specific implementation of this layout template component as a framework node wrapping a page route requiring authentication is as follows: A parent route node with the path " / " is defined in the route configuration. Its rendering component is the layout template, and the node's `children` array contains all PBC business routes requiring authentication. When a user accesses any child route, the front-end routing engine first renders the parent node's layout template component (this component is wrapped by the authentication component, triggering login verification). After the layout template is rendered, the page renderer corresponding to the matched child route is rendered through the child route's exit point.
[0088] Step 4: Layout template rendering; the second-level frame node of the route tree is the layout template component. The complete rendering steps for this component are as follows: (1) Dynamic template loading: The system maintains a template registry (key-value pair structure) that maps template names to corresponding asynchronous loading functions. For example: { "Template2": () =>import("@site / src / components / Templates / Template2"), "Template3": () =>import("@site / src / components / Templates / Template3"), "MobileTemplate1": () =>import("@site / src / components / Templates / MobileTemplate1") }".
[0089] When the route assembly determines to use a certain template name (from the template field or mobileTemplate field in the application configuration), the system calls the lazy loading function (React lazy) to wrap the corresponding asynchronous loading function. In conjunction with the asynchronous boundary component (Suspense), it realizes on-demand loading. The template code is only downloaded from the server (generated as a separate file through the code splitting function of the front-end build tool) when the user enters the route that requires the template for the first time. A global loading indicator is displayed during the download.
[0090] Here, "lazy loading" means that the JavaScript code for the layout template is not included in the initial application load package, but is downloaded on demand via a dynamic "import()" statement when it is first needed for rendering. The purpose of this is to reduce the initial load size of the application. The application may be configured with multiple templates (one for desktop and one for mobile), but users usually only use one of them in a single session.
[0091] (2) Template component rendering layout framework: After the template component is loaded, the layout mode is determined according to the template configuration parameters (templateConfig) in the application configuration. Taking Template2 as an example, it supports three layout modes: SidebarLayout: The navigation menu is displayed vertically in the left sidebar and supports multi-level collapsing; HeaderLayout: The navigation menu is displayed horizontally at the top; HeaderSidebarLayout: The top-level menu is displayed horizontally at the top, and the sub-menus of the currently active top-level menu are displayed vertically in the left sidebar. The template component receives the merged route table (allRoutes) as an attribute, extracts the routing information of each PBC from it, and automatically generates a navigation menu tree. The display name of the menu item comes from the pageTitle field in the route declaration (internationalization has been completed during the configuration loading phase).
[0092] (3) Logical connection between route assembly and layout template rendering: The complete route tree produced in the route assembly stage has a second-level node (TemplateRender component) that receives a routes property. The value of this property is the result of flattenRoutes(appRoutes, pbcList), which is the flattened route table after all PBC routes are concatenated with identifier prefixes. The layout template component uses this route table to generate a navigation menu and renders the currently matched third-level sub-route through the sub-route exit. Therefore, the output of route assembly serves two purposes: 1) registering with the front-end route engine for URL matching; 2) passing it to the layout template for menu generation.
[0093] (4) Common functions provided by the layout template include: Sidebar / top navigation menu (automatically generated based on the routing table, supports multi-level nesting and search filtering); Breadcrumb navigation (automatically generated based on the hierarchical relationship of the parent field of the route); Global search (fuzzy match of all menu item names); User menu (logout, personal settings, etc.); Language switcher (generated based on the list of allowed languages configured in the application); Notification Center; The content area renders the currently matched sub-route through the sub-route exit; Step 5: Page rendering scheduling; such as Figure 4 As shown, when a user accesses a URL (such as / crm / form / customer / layout / list), the specific process of path matching performed by the front-end routing engine is as follows: (1) Path matching process: The front-end routing engine (based on React Router) adopts the best matching algorithm for path patterns: it compares the current URL path with all registered routing patterns one by one, and sorts the routing patterns according to their accuracy scores. Static segments score higher than parameter segments, and patterns with more path segments are given priority over patterns with fewer segments. Specifically, in this system: The routing engine first checks the top-level route (login page, etc.), and if it does not match, it proceeds to the second-level layout template node; 1) The routing engine first compares the current URL path with the top-level routes. The top-level routes include the login page, password reset page, pages marked noNeedAuth:true that do not require authentication, desktop layout template nodes, mobile layout template nodes, and 404 pages.
[0094] 2) If the current URL path matches the login page, password reset page, or page that does not require authentication, the matched page will be rendered directly without entering the layout template node or performing login authentication.
[0095] 3) If the above-mentioned page that does not require authentication is not matched, then the desktop layout template node or the mobile layout template node will be matched. After a successful match, the authentication component outside the node will first determine whether the user is logged in. After successful login, the specific PBC business page will continue to be matched in the sub-route exit of the layout template.
[0096] 4) In the sub-routes of the layout template node, fixed text path segments take precedence over parameter placeholder path segments, and parameter placeholder path segments take precedence over 404 wildcard paths. For example, the URL " / crm / form / customer / layout / list" matches " / crm / form / :formEntityToken / layout / :layoutToken", and obtains "formEntityToken=customer" and "layoutToken=list".
[0097] 5) If no authentication is required, and the layout nodes and their child routes on the desktop or mobile devices are not matched, a 404 page will be displayed.
[0098] Therefore, the method to determine whether a path matches a route of a certain PBC is as follows: through exact matching of namespace prefixes, if the first segment of the URL (such as crm) equals the token of a certain PBC, then the PBC has been located. No additional checks are needed because the uniqueness of the PBC identifier is guaranteed during the conflict detection phase.
[0099] (2) Page type identification and rendering strategy distribution: After a successful path match, the routing engine renders the PageRenderer component configured for that route node. The PageRenderer identifies the page type by reading the formType field pre-annotated in the route configuration. This field has been written into the route node during the route assembly stage (from the general route template or the explicit declaration in the PBC custom route declaration).
[0100] The type identifier is identified by exact string matching, and the list of legal type identifiers predefined by the system is shown in Table 1. Table 1. List of predefined legal type identifiers (3) Specific execution flow of each rendering strategy: Taking the most common ENTITY (form entity) type as an example, the complete rendering scheduling and execution flow is as follows: 1. The PageRenderer component receives props, including formType="ENTITY", pbcToken="crm", and context (context reference). 2. PageRenderer matches the ENTITY branch based on formType and renders the FormEntityRenderer component; 3. FormEntityRenderer extracts formEntityToken (e.g., "customer"), layoutToken (e.g., "list"), and formEntityDataId (if present, indicating edit mode) from the URL parameters; 4. FormEntityRenderer judgment: If formEntityDataId exists, it is in edit mode (pageType=form-edit); otherwise, it is in new creation mode (pageType=form-create). 5. FormEntityRenderer passes the above parameters to FormRendererSelector (form configuration selector).
[0101] Aside from the ENTITY type, other rendering strategies are handled as follows: 1. ENTITY-VIEW strategy: Retrieve the corresponding data based on the data record identifier, obtain the schema in read-only mode, and render the page.
[0102] 2. FLOW-FORM strategy: Obtain the process form based on the process definition identifier or process instance identifier, and render it according to the process initiation or process editing method.
[0103] 3. FLOW-APPROVAL strategy: Obtain the process form based on the process definition identifier or process instance identifier, and render the form content and operations required for approval according to the approval method.
[0104] 4. EXTERNAL strategy: Based on the name of the external component, find the corresponding component from the configured external components and render it; if not found, display a message indicating that the component does not exist.
[0105] 5. IFRAME strategy: Load the corresponding embedded page using the embedded page address given in the routing configuration.
[0106] 6. Default strategy: When formType is empty or not declared, the general page schema is obtained and rendered based on schemaId; when formType is a non-empty or invalid value, the error message "UnknownformType" is displayed.
[0107] (4) Obtaining the configuration of the form configuration selector, such as Figure 7 As shown; the specific method by which FormRendererSelector constructs the request path based on the PBC identifier, form entity identifier, and layout identifier is as follows: 1) First, check if a pre-compiled schema file exists locally (a mapping table generated by the front-end build tool during the build process by scanning the src / pbc / {pbcToken} / forms / {formEntityToken} / {layoutToken} directory). 2) If it exists locally: load it directly from local storage (zero network requests, suitable for local development mode); 3) If it does not exist locally (cloud service mode): Construct a backend interface request path of / form / api / v2 / form-entity-layout / {pbcToken} / {formEntityToken} / {layoutToken} / schema-json, and send an HTTP GET request to the backend to obtain the JSON Schema configuration; 4) Simultaneously request the metadata of the form entity in parallel: / form / api / v2 / form-entity / {pbcToken} / {formEntityToken}; 5) After the two requests are completed, append the form entity metadata to the schema object (avoid serialization conflicts by using symbol type attributes). 6) Pass the final schema to the general form renderer (FormRenderer) for page rendering. For a generic page of type page / :schemaId, the request path is: / form / api / form-entity-page / get-by-schema-id / {pbcToken} / {schemaId}.
[0108] The rules for concatenating the above paths can be summarized as follows: the PBC identifier serves as the namespace isolation segment, the form entity identifier locates the business object, and the layout identifier locates the specific view presentation method. The combination of these three identifiers uniquely determines a JSONSchema configuration file. This three-segment path structure ensures that form entities with the same name can exist under different PBCs (such as multiple PBCs having an entry page named "entry") without conflict.
[0109] Step 6: Cross-level context stable pass-through mechanism; this mechanism runs through the entire process from Step 3 to Step 5 above. Throughout the entire process from route assembly to final rendering, the system always passes through a context object, which contains runtime information such as the current user permission mapping table and user profile.
[0110] The specific technical implementation of maintaining the same object through pass-by-reference is as follows: 1. When the top-level component of the application is executed for the first time, useRef({}) is called to create a reference container contextRef; at this time, contextRef.current points to an initial empty object.
[0111] 2. Each time the top-level component is executed, the externally passed context properties are written to the same contextRef.current object one by one. This process only updates the properties in the object, and does not replace the object pointed to by contextRef.current.
[0112] 3. When calling the route assembly function, pass in the object `contextRef.current`. The `context` property received by each page rendering node in the route configuration points to the same object.
[0113] 4. After a user logs in or their permissions change, the latest user permission mapping table is written to contextRef.current.userPermissionMap. When a route node performs permission checks or renders a page, it reads the latest user permission mapping table through context.userPermissionMap; here, context is contextRef.current, and is no longer written as context.current.
[0114] 5. The route assembly function does not destructure or copy the context object, but passes it as is to the route node, so that the route node that has already been created can still read the updated properties later.
[0115] 6. During page rendering, the page rendering scheduler supplements the current PBC identifier, page type, and data record identifier on the context object for use by the current page.
[0116] In addition, the page rendering scheduler also broadcasts the following global state to all child components through a global context broadcasting mechanism: The currently active PBC information can be retrieved by triggering the setPbcToken lookup. The current page title, used for breadcrumbs and browser tabs; PBC list, used for cross-module references; Redirection status, used to control the loading indicator when switching pages.
[0117] The following provides supplementary explanations through specific implementation methods; Example 1: Multi-PBC route assembly and conflict detection; Assume that the current tenant has activated two PBCs: Customer Management Module (token "crm") and Human Resources Module (token "hr").
[0118] Routing declaration (JSON format) for the customer management module: json { "desktop": { " / ": { "schemaId": "entry", "pageTitle": "Customer Management"}, "report / sales": { "schemaId": "sales-report", "pageTitle": "Sales Report"} }, "mobile": { " / ": { "schemaId": "mobile-entry", "pageTitle": "Customer Management"} } }".
[0119] Routing declaration for the Human Resources module: json { "desktop": { " / ": { "schemaId": "entry", "pageTitle": "Human Resources"}, "org-chart": { "schemaId": "org-chart", "pageTitle": "Organizational Structure"} }, "mobile": { " / ": { "schemaId": "mobile-entry", "pageTitle": "Human Resources"} } }".
[0120] The collision detection process includes: 1. Uniqueness check: tokenSet is empty → add "crm" → tokenSet={"crm"} → add "hr" → tokenSet={"crm","hr"} → no conflict; 2. Path segment validity check: "report / sales" does not start with the reserved prefixes "form / ", "flow / ", or "page / " → valid; "org-chart" is similarly valid. 3. Parameterized path conflict detection: The first part "report" in the PBC custom path "report / sales" is different from the first part "form" in the general template "form / :formEntityToken" → no ambiguity.
[0121] Simplified assembled routing tree: Top-level (no authentication required): / login → Login Page / reset-password → Password reset page / *→ 404 page * / Level 2 (Desktop layout template, authentication required): / → TemplateRender(name="Template2", routes=allRoutes) Sub-routes: / crm / → PageRenderer(schemaId="entry", pbcToken="crm") / crm / report / sales→ PageRenderer(schemaId="sales-report", pbcToken="crm") / crm / form / :formEntityToken / layout / :layoutToken → PageRenderer(formType="ENTITY", pbcToken="crm") [General Template Injection] / crm / form / :formEntityToken / layout / :layoutToken / :formEntityDataId → PageRenderer(formType="ENTITY", pbcToken="crm") [General Template Injection] / crm / flow / :flowToken / new → PageRenderer(formType="FLOW-FORM",pbcToken="crm") [General Template Injection] / crm / flow / :flowInstanceId / approval → PageRenderer(formType="FLOW-APPROVAL", pbcToken="crm") [General Template Injection] / crm / page / :schemaId → PageRenderer(pbcToken="crm") [General Template Injection] / hr / → PageRenderer(schemaId="entry", pbcToken="hr") / hr / org-chart→ PageRenderer(schemaId="org-chart", pbcToken="hr") / hr / form / :formEntityToken / layout / :layoutToken → PageRenderer(formType="ENTITY", pbcToken="hr") [General Template Injection] ... (The same applies to other general template routes for HR.) Level 2 (Mobile layout template, authentication required): / mobile→ TemplateRender(name="MobileTemplate1", routes=allRoutes) Sub-routes: / mobile / crm / → PageRenderer(schemaId="mobile-entry", pbcToken="crm") / mobile / crm / form / :formEntityToken / layout / :layoutToken → PageRenderer(formType="ENTITY", pbcToken="crm") [General Template Injection] / mobile / hr / → PageRenderer(schemaId="mobile-entry", pbcToken="hr") ... (The same applies to other routes on mobile devices).
[0122] Key points: Customer management and human resources each declare their own unique routes (2-3), while standard form / process / page paths are automatically injected by the platform (8 or more), greatly reducing the amount of configuration required.
[0123] Example 2: Conflict detection and interception of duplicate PBCs; Assume an administrator makes a mistake, resulting in two records with the same token appearing in the PBC list: json [ { "token": "crm", "category": "BUSINESS", "routesJson": "..."}, { "token": "crm", "category": "BUSINESS", "routesJson": "..."} ]".
[0124] Collision detection process: 1. Iterate through the first PBC; if token="crm" is not in the tokenSet, add it to the set. 2. Traversing the second PBC, token="crm" is already in the tokenSet → throws an exception: Error:Twopbchassametokencrm.
[0125] 3. The routing assembly was aborted, the application failed to start, and a clear error message was displayed in the console.
[0126] Developers can quickly locate the problem (backend PBC data configuration error) based on the error message, rather than encountering route coverage issues that are difficult to troubleshoot at runtime.
[0127] Example 3: Complete Rendering Scheduling and Distribution Chain; When a user accesses / crm / form / customer / layout / list in the browser address bar, the complete processing chain is as follows: 1. Route matching: The first segment of the URL, crm, matches the route group with crm as the prefix within the sub-route range of the layout template → further match the pattern / crm / form / :formEntityToken / layout / :layoutToken → extract parameters: formEntityToken="customer",layoutToken="list".
[0128] 2. Layout rendering: The layout template components (navigation bar, sidebar) have been rendered. The matched sub-routes are rendered at the exit of the sub-routes in the content area.
[0129] 3. Type recognition: PageRenderer reads the configuration formType="ENTITY" of the route node → selects FormEntityRenderer.
[0130] 4. Mode determination: FormEntityRenderer checks whether the URL parameters contain formEntityDataId → if not, it is determined to be a new creation mode (pageType=form-create).
[0131] 5. Configuration retrieval: FormRendererSelector calls fetchSchema({pbcToken:"crm",formEntityToken:"customer",layoutToken:"list"}) → first checks the local schema mapping table → no local schema → initiates API request GET / form / api / v2 / form-entity-layout / crm / customer / list / schema-json.
[0132] 6. Form rendering: The API (Application Programming Interface) returns a JSON Schema configuration → which is passed to the FormRenderer → the form renderer dynamically generates a complete form page based on the field definitions, layout structure, and validation rules in the schema.
[0133] 7. State synchronization: After rendering is complete, the current PBC is broadcast as "crm" and the page title is the title defined in the schema through AppContext, and the breadcrumbs of the layout template are updated accordingly.
[0134] Example 4: Dynamic addition and removal of PBCs; The tenant enabled a new PBC "Finance" (token "finance") in the management backend.
[0135] 1. The backend PBC list API now returns a finance module and its route declaration; 2. The front-end reloads the configuration the next time the user visits (or after the application is refreshed); 3. Conflict detection passed (“finance” is not in the existing tokenSet); 4. The routing assembly engine merges the routes of the financial module with the routes of existing modules to generate a new routing tree; 5. Paths such as / finance / , / finance / form / , etc., are immediately available; 6. The navigation menu updates automatically based on the new routing table, eliminating the need for front-end rebuilding and redeployment.
[0136] In addition, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0137] In addition, the present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0138] This invention is not limited to the structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this invention is limited only by the appended claims.
Claims
1. A dynamic routing assembly and rendering method, characterized in that, Includes the following steps: After the front-end application starts, it initiates asynchronous requests in parallel, including loading the front-end configuration, loading the list of business capability packages, and loading internationalization resources. After the asynchronous requests are completed, it performs internationalization translation processing on the list of business capability packages to obtain the loaded list of business capability packages. Perform multi-dimensional conflict detection on the loaded list of service capability packages, and inject a predefined standard path pattern into each service capability package that passes the conflict detection. Then, add a prefix identifier to all routing paths of each service capability package through the path concatenation function to generate a three-level routing tree structure. Based on the three-level routing tree, a route instance is created. When the resource locator accessed by the user is received, the front-end routing engine locates the target route node through a path pattern matching algorithm. By reading the page type field pre-annotated in the target route node, the renderer component obtains the structured description configuration file through the three-segment path structure, and completes the page rendering through the structured description configuration file.
2. The dynamic routing assembly and rendering method according to claim 1, characterized in that, After the front-end application starts, asynchronous requests are initiated in parallel, including loading the front-end configuration, loading the list of business capability packages, and loading internationalization resources. After the asynchronous requests are completed, internationalization translation processing is performed on the list of business capability packages to obtain the loaded list of business capability packages. This includes the following steps: After the front-end application starts, three independent asynchronous requests are triggered to obtain front-end configuration information, a list of business capability packages, and a multi-language internationalization resource package, respectively. After all asynchronous requests have returned successfully, iterate through each business capability package in the business capability package list and use the multilingual internationalization resource package to perform internationalization translation processing on each field. Each business capability package after internationalization translation is summarized to form a list of loaded business capability packages.
3. The dynamic routing assembly and rendering method according to claim 1, characterized in that, The process of performing multi-dimensional conflict detection on the loaded list of service capability packages and injecting a predefined standard path pattern into each service capability package that passes the conflict detection, and then adding a prefix identifier to all routing paths of each service capability package through a path concatenation function to generate a three-level routing tree structure includes the following steps: Perform multi-dimensional conflict detection on the list of loaded business capability packages, and remove abnormal business capability packages based on the detection results; For each service capability package that passes the conflict detection, a predefined standard path pattern is injected into the route declaration contained in that service capability package; For service capability packages that have completed the standard path pattern injection, a prefix identifier is added to all routing paths of each service capability package through the path concatenation function to generate a desktop / mobile dual-tree structure; Based on a desktop / mobile dual-tree structure, and combined with application-level routing, a three-level routing tree structure is generated by merging.
4. The dynamic routing assembly and rendering method according to claim 3, characterized in that, The process of performing multi-dimensional conflict detection on the list of loaded service capability packages and removing abnormal service capability packages based on the detection results includes: Initialize a set of registered identifiers, iterate through each service capability package in the list of loaded service capability packages, and check whether the identifier token of the service capability package already exists in the set of registered identifiers. If it exists, it is determined that the service capability package has an identifier duplicate conflict, throws an exception and terminates route assembly. If it does not exist, the identifier token is added to the set of registered identifiers until all service capability packages have completed the identifier duplicate conflict detection. Based on the preset path segment verification requirements, the path key in the routing declaration of each service capability package that has passed the identifier uniqueness verification is format verified. If the preset path segment verification requirements are met, the format verification passes; otherwise, the format verification fails. For service capability packages that pass format validation, parameterized path priority conflict detection is performed between their custom route declarations and predefined standard path patterns to check for ambiguities between static paths and parameterized paths. If ambiguity exists, parameterized path priority conflict detection fails; otherwise, parameterized path priority conflict detection succeeds. Service capability packages that fail format validation or parameterized path priority conflict detection are treated as abnormal service capability packages and removed from the service capability package list. The remaining service capability packages are output as the list of service capability packages that pass conflict detection.
5. The dynamic routing assembly and rendering method according to claim 3, characterized in that, The format verification includes checking whether the path segment starts with a forward slash, whether it contains illegal special characters, and whether it conflicts with a pre-reserved prefix.
6. The dynamic routing assembly and rendering method according to claim 3, characterized in that, For each service capability package that passes conflict detection, the process of injecting the predefined standard path pattern into the route declaration contained in the service capability package according to its pre-configured page attributes includes the following steps: Retrieve a predefined set of standard path patterns; For each service capability package that passes the conflict detection, iterate through each standard path pattern in the standard path pattern set and compare the standard path pattern with the route path declared by the service capability package itself. If the service capability package itself has already declared a custom route with the same path segment as the standard path pattern, the route declared by the service capability package itself has higher priority and the standard path pattern will not be injected again. Otherwise, the standard path pattern will be added to the route declaration of the service capability package. The pre-annotated page type field in the injected standard path pattern is synchronously written into the configuration of the corresponding route node in the route declaration of the business capability package, thus completing the injection of the standard path pattern of the route declaration of the business capability package.
7. The dynamic routing assembly and rendering method according to claim 6, characterized in that, The standard path patterns include form entity routing, form view routing, process initiation routing, process approval routing, and general page routing.
8. The dynamic routing assembly and rendering method according to claim 3, characterized in that, For the service capability packages that have completed the standard path pattern injection, the method of adding a prefix identifier to all routing paths of each service capability package through a path concatenation function to generate a desktop / mobile dual-tree structure includes: For a business capability package that has completed the standard path pattern injection, obtain its identification token, and call the path concatenation function to concatenate the identification token as a prefix to each route path of the desktop terminal object in the route declaration of the business capability package to generate the desktop terminal route path; For the same service capability package, the path concatenation function is called to concatenate the preset mobile terminal identifier and the identification token of the service capability package as prefixes to each route path of the mobile terminal object in the route declaration of the service capability package, thereby generating the mobile terminal route path; Based on the desktop routing path and the mobile routing path, construct the desktop routing tree and the mobile routing tree respectively, generating a desktop / mobile dual-tree structure.
9. The dynamic routing assembly and rendering method according to claim 1, characterized in that, The process of generating a three-level routing tree structure based on a desktop / mobile dual-tree structure and combined with application-level routing includes the following steps: Configure pages that do not require authentication as top-level route nodes to form first-level route nodes; Construct desktop layout template framework nodes and mobile layout template framework nodes, and wrap the layout template framework nodes in an authentication component to form a second-level routing node. Each business capability package business page route in the desktop routing tree and mobile routing tree is mounted as a sub-route to the corresponding layout template framework node, forming a third-level routing node; The first-level routes, second-level routes, and third-level routes are merged to generate a three-level routing tree structure.
10. The dynamic routing assembly and rendering method according to claim 1, characterized in that, The process of creating a route instance based on a three-level routing tree, and upon receiving a resource locator accessed by a user, the front-end routing engine locates the target route node using a path pattern matching algorithm. By reading the pre-annotated page type field in the target route node, the renderer component obtains a structured description configuration file through a three-segment path structure to complete page rendering. This includes the following steps: After receiving the resource locator accessed by the user, the front-end routing engine performs path pattern matching between the resource locator and the created three-level routing tree to locate the target routing node and extract the resource locator parameters. The page rendering scheduler reads the page type field pre-annotated in the target route node, performs string matching based on the page type field to determine the rendering strategy, and selects the corresponding renderer component; The renderer component extracts the form entity identifier, layout identifier, and data record identifier from the resource locator parameter, and sends a request to the backend based on the three-segment path structure to obtain the corresponding structured description configuration file. The obtained structured description configuration file is passed to the general form renderer, which then dynamically generates the page and completes the rendering.
11. The dynamic routing assembly and rendering method according to claim 1, characterized in that, The renderer component extracts the form entity identifier, layout identifier, and data record identifier from the resource locator parameters, and sends a request to the backend based on the three-segment path structure to obtain the corresponding structured description configuration file, including the following steps: The renderer component calls the form configuration selector to check if a pre-compiled configuration file exists locally that corresponds to the business capability package identifier, form entity identifier, and layout identifier; If a pre-compiled page structure file exists locally, it is loaded directly from the local machine as the structured description configuration file. If it does not exist locally, the form configuration selector uses the business capability package identifier as the first path segment, the form entity identifier as the second path segment, and the layout identifier as the third path segment to construct the backend interface request path and send a request to the backend to obtain the structured description configuration file. While requesting the structured description configuration file from the backend, the form entity metadata is requested in parallel. The obtained form entity metadata is appended to the structured description configuration file and merged into the final structured description configuration file.
12. A dynamic routing assembly rendering system, characterized in that, The system includes: The configuration loading module is used to initiate asynchronous requests in parallel after the front-end application starts, including loading the front-end configuration, loading the list of business capability packages, and loading internationalization resources. After the asynchronous requests are completed, internationalization translation processing is performed on the list of business capability packages to obtain the loaded list of business capability packages. The routing assembly engine module is used to perform multi-dimensional conflict detection on the loaded list of service capability packages, and inject a predefined standard path pattern into each service capability package that passes the conflict detection, so as to add a prefix identifier to all routing paths of each service capability package through the path concatenation function, and generate a three-level routing tree structure. The route matching and page rendering module is used to create route instances based on the three-level route tree. When the front-end route engine receives the resource locator accessed by the user, it locates the target route node through the path pattern matching algorithm. By reading the page type field pre-annotated in the target route node, the renderer component obtains the structured description configuration file through the three-segment path structure, and completes the page rendering through the structured description configuration file.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 11.
14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 11.
