Flowable-based front-end and back-end code automatic generation method and system, medium and equipment

Through the automatic generation method of front-end and back-end code based on Flowable, Flowable flowcharts are analyzed and business configuration information is obtained, and the code is generated dynamically, which solves the problems of inefficient and high error rates in traditional manual coding, and achieves high-quality and fast-responsive code generation.

CN119806501APending Publication Date: 2025-04-11SAIC GM WULING AUTOMOBILE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411970089.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

When facing complex and changing business needs, the traditional manual coding method is inefficient and has high error rates, making it difficult to respond quickly and ensure code quality.

Method used

The automatic generation method of front-end and back-end code based on Flowable is adopted. By analyzing the Flowable flowchart, node information and process definition keys are obtained, process node configuration tables are generated, form and field configuration information are obtained from the business design plan and process database, and this information is associated with the process definition keys. Finally, these configuration information are passed to the Velocity template engine to dynamically generate back-end interface codes and front-end page codes.

Benefits of technology

It realizes the close relationship between business logic and technical implementation, reduces manual coding errors, improves development efficiency and code quality, ensures that the generated code fully meets business needs, and maintains code consistency and high-quality standards.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806501A_ABST
    Figure CN119806501A_ABST
Patent Text Reader

Abstract

The invention discloses a flow-based front-end and back-end code automatic generation method, system, medium and equipment, and the method comprises the steps: analyzing a preset Flowable flow chart according to a preset Flowable engine, obtaining node information and a flow definition key of the Flowable flow chart, and generating a flow node configuration table according to the node information; obtaining form and field configuration information from a preset business design scheme and a process database; wherein the form and field configuration information and the node information are associated according to the process definition key; and transmitting the form and field configuration information and the process node configuration table as parameters to a preset Velocity template engine, so that the Velocity template engine dynamically generates a back-end interface code and a front-end page code. According to the method, the development efficiency and the code quality are improved through standardized configuration of the database table in combination with the use of the process engine and the template engine.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of software development, and relates to a flowable-based front-end and back-end code automatic generation method, system, medium and device. Background Art

[0002] With the rapid development of information technology, process approval and management are becoming increasingly important in enterprise-level application systems. Modern enterprises rely on efficient business processes to improve work efficiency, optimize resource allocation and enhance competitiveness.

[0003] However, traditional manual coding methods have problems of low efficiency and high error rate. Especially when faced with complex and changing business needs, manually written code is difficult to respond quickly and ensure quality. Summary of the invention

[0004] In view of the deficiencies in the prior art, the present application provides a method, system, medium and device for automatic generation of front-end and back-end codes based on flowable to improve development efficiency and code quality.

[0005] To achieve the above objectives, in a first aspect, the present invention provides a method for automatically generating front-end and back-end codes based on flowable, comprising:

[0006] Parse the preset Flowable flow chart according to the preset Flowable engine, obtain the node information and process definition key of the Flowable flow chart, and generate a process node configuration table according to the node information;

[0007] Obtaining form and field configuration information from a preset business design solution and process database; wherein the form and field configuration information is associated with the node information according to the process definition key;

[0008] The form and field configuration information and the process node configuration table are passed as parameters to a preset Velocity template engine, so that the Velocity template engine dynamically generates backend interface code and frontend page code.

[0009] Compared with the prior art, the embodiments of the present application have the following beneficial effects: by parsing the Flowable flow chart through the Flowable engine, obtaining node information and process definition keys, and generating a process node configuration table, the close connection between business logic and technical implementation is ensured, the possibility of manual coding errors is reduced, and development efficiency is improved; the form and field configuration information is obtained from the preset business design scheme and process database, and this information is associated with the node information through the process definition key, which ensures the relevance and accuracy of all relevant configurations, simplifies the data management and query process, and enhances the flexibility and maintainability of the system. Finally, the form and field configuration information and the process node configuration table are passed as parameters to the preset Velocity template engine, which realizes the automatic generation of code, greatly shortens the development cycle, ensures that the generated code fully meets business requirements, and maintains the consistency and high quality standards of the code.

[0010] In some embodiments of the first aspect of the present application, the obtaining of form and field configuration information from a preset business design solution and process database includes:

[0011] Obtain form configuration information from a preset business design solution, and generate a form configuration table according to the form configuration information and the process definition key;

[0012] The form configuration table and the process node configuration table are associated according to the process definition key.

[0013] Compared with the prior art, the above embodiment has the following beneficial effects: obtaining form configuration information from the business design plan, and generating a form configuration table according to the form configuration information and the process definition key, thereby ensuring a high degree of match between the form design and the actual business needs, and enabling the business logic and user interface design to be closely integrated, thereby improving user experience and operational convenience; establishing a direct association between the form configuration table and the process node configuration table through the process definition key, thereby ensuring the consistency and coherence of the form content and processing logic at different business process stages, thereby improving the overall coordination and reliability of the system, and providing a solid foundation for subsequent automated code generation.

[0014] In some embodiments of the first aspect of the present application, the obtaining form and field configuration information from a preset business design solution and process database further includes:

[0015] According to a preset process database, process list information is obtained, and a table field configuration table is generated according to the process list information;

[0016] The table field configuration table is associated with the form configuration table according to the table name information in the process list information.

[0017] Compared with the prior art, the above embodiment has the following beneficial effects: the process list information is obtained according to the preset process database, and the table field configuration table is generated according to the process list information, thereby ensuring that the table field configuration table accurately reflects the data structure in the business process, providing a solid foundation for subsequent code generation, and ensuring the consistency of the data model; the table field configuration table and the form configuration table are associated through the table name information, thereby ensuring the consistency of the form design and the database structure, and avoiding the problem of data inconsistency.

[0018] In some embodiments of the first aspect of the present application, the obtaining form and field configuration information from a preset business design solution and process database further includes:

[0019] Acquire module information and display field information of the front-end form interface from the business design solution, and generate a front-end form module display field table according to the module information and display field information of the front-end form interface;

[0020] Among them, the front-end form module display field table is associated with the table field configuration table according to the display field information.

[0021] Compared with the prior art, the above embodiment has the following beneficial effects: the module information and display field information of the front-end form interface are obtained from the business design plan, and the front-end form module display field table is generated according to this information, thereby ensuring that the design of the front-end page meets the business requirements and providing detailed layout and interaction rules for front-end code generation; by associating the front-end form module display field table with the table field configuration table through the display field information, the consistency of the front-end page display and the back-end data structure is ensured, thereby avoiding the problem of data inconsistency.

[0022] In some embodiments of the first aspect of the present application, the form and field configuration information and the process node configuration table are passed as parameters to a preset Velocity template engine so that the Velocity template engine dynamically generates a backend interface code and a frontend page code, including:

[0023] Generate dictionary data according to the form configuration information of the form configuration table; wherein the elements of the dictionary data include: a draft saving interface path, a draft deleting interface path and an end event processing function, and each element corresponds to the same process definition key;

[0024] Create a table entity object, obtain the form configuration information of the form configuration table, and save it to the table entity object;

[0025] A field attribute object is created, and each table field configuration information in the table field configuration table is traversed. If the table field configuration information meets the preset judgment rule, a special identification field corresponding to the judgment rule is set for the field attribute object.

[0026] Compared with the prior art, the above embodiment has the following beneficial effects: dictionary data is generated according to the form configuration information of the form configuration table, and each element of the dictionary corresponds to the same process definition key, which simplifies the interface definition process and improves the consistency and reliability of the interface; a table entity object is created and the form configuration information is saved to the object, which provides a clear data structure for code generation and simplifies the implementation of the data access layer; a field attribute object is created, and by traversing the table field configuration information and setting special identification fields according to judgment rules, special configuration requirements can be automatically identified and processed, reducing the manual workload of developers, ensuring the flexibility and adaptability of the generated code, and improving the accuracy and efficiency of code generation.

[0027] In some embodiments of the first aspect of the present application, the form and field configuration information and the process node configuration table are passed as parameters to a preset Velocity template engine so that the Velocity template engine dynamically generates a backend interface code and a frontend page code, and further includes:

[0028] Generate a front-end list display field list and a front-end list data query item list according to the table field configuration information of the table field configuration table;

[0029] A process node parameter assignment object list is generated according to the process node configuration information in the process node configuration table and the table field configuration information in the table field configuration table.

[0030] Compared with the prior art, the above embodiment has the following beneficial effects: by generating a front-end list display field list and a front-end list data query item list, as well as a process node parameter assignment object list, the code generation rules of the front-end page and the back-end interface are further refined to ensure the consistency of the display content and interaction logic of the front-end interface.

[0031] In some embodiments of the first aspect of the present application, the form and field configuration information and the process node configuration table are passed as parameters to a preset Velocity template engine so that the Velocity template engine dynamically generates a backend interface code and a frontend page code, and further includes:

[0032] Create a configuration mapping object, and add the dictionary data, table entity object, field attribute object, front-end list display field list, front-end list data query item list, process node parameter assignment object list and module display field information of the front-end form module display field table to the configuration mapping object;

[0033] The template type parameter in the form configuration table is used as a parameter, and a preset template acquisition method is called to obtain the front-end and back-end Velocity template files of the local corresponding template type;

[0034] According to the configuration mapping object, data rendering is performed on the front-end and back-end Velocity template files to obtain the back-end interface code and the front-end page code.

[0035] Compared with the prior art, the above embodiment has the following beneficial effects: by encapsulating all necessary configuration information into a mapping object and accurately filling the template with data, high-quality back-end interface code and front-end page code are ultimately generated, which not only ensures the consistency and high quality of the code, but also greatly shortens the development cycle.

[0036] In a second aspect, the present invention also provides a flowable-based front-end and back-end code automatic generation system, including: a process parsing module, a configuration acquisition module and a code generation module;

[0037] The process parsing module is used to parse the preset Flowable flow chart according to the preset Flowable engine, obtain the node information and process definition key of the Flowable flow chart, and generate a process node configuration table according to the node information;

[0038] The configuration acquisition module is used to acquire form and field configuration information from a preset business design solution and process database; wherein the form and field configuration information is associated with the node information according to the process definition key;

[0039] The code generation module is used to pass the form and field configuration information and the process node configuration table as parameters to the preset Velocity template engine, so that the Velocity template engine dynamically generates backend interface code and frontend page code.

[0040] Compared with the prior art, the above embodiments of the present application have the following beneficial effects: by parsing the Flowable flow chart through the Flowable engine, obtaining node information and process definition keys, and generating a process node configuration table, the close connection between business logic and technical implementation is ensured, the possibility of manual coding errors is reduced, and development efficiency is improved; the form and field configuration information is obtained from the preset business design scheme and process database, and this information is associated with the node information through the process definition key, which ensures the relevance and accuracy of all relevant configurations, simplifies the data management and query process, and enhances the flexibility and maintainability of the system. Finally, the form and field configuration information and the process node configuration table are passed as parameters to the preset Velocity template engine, which realizes the automatic generation of code, greatly shortens the development cycle, ensures that the generated code fully meets business requirements, and maintains the consistency and high quality standards of the code.

[0041] In the third aspect, the present invention also provides a device for automatically generating front-end and back-end codes based on flowable, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is loaded into the processor, the steps of the method for automatically generating front-end and back-end codes based on flowable are implemented.

[0042] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for automatically generating front-end and back-end codes based on flowable are implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 : A flow chart of a method for automatically generating front-end and back-end codes based on flowable provided in some embodiments of the present invention.

[0044] Figure 2 : A structural diagram of a flowable-based front-end and back-end code automatic generation system provided in some embodiments of the present invention.

[0045] Figure 3 : A structural diagram of a flowable-based front-end and back-end code automatic generation device provided in some embodiments of the present invention.

[0046] Figure 4 : A flowchart of code generation in a flowable-based front-end and back-end code automatic generation method provided in some embodiments of the present invention. DETAILED DESCRIPTION

[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0048] Embodiment 1:

[0049] Please refer to Figure 1 , a flowable-based front-end and back-end code automatic generation method provided by an embodiment of the present invention, including steps S1 to S3:

[0050] Step S1: parse the preset Flowable flowchart according to the preset Flowable engine, obtain the node information and process definition key of the Flowable flowchart, and generate a process node configuration table according to the node information.

[0051] Among them, the process node configuration table is used to record the details of the process nodes to control the behavior of each step in the process, including parameter information of each node, such as form configuration ID, business module code, flowchart deployment version, process definition key, flowchart user task node definition ID, process node parameter value, process node name, process node key, process node processing address, whether the form page is editable, editable fields of the current node, etc.

[0052] In this embodiment, step S1 parses the Flowable flowchart through the Flowable engine, obtains node information and process definition keys, and generates a process node configuration table, thereby ensuring a close connection between business logic and technical implementation, reducing the possibility of manual coding errors, and improving development efficiency.

[0053] Step S2: Obtain form and field configuration information from a preset business design solution and process database;

[0054] The form and field configuration information and the node information are associated according to the process definition key.

[0055] Preferably, in some embodiments of the present application, step S2 can be implemented by the following preferred implementations, including steps S21 to S23, as follows:

[0056] S21: acquiring form configuration information from a preset business design solution, and generating a form configuration table according to the form configuration information and the process definition key;

[0057] Among them, in a specific implementation, the configuration data of the form configuration table may include data source configuration, package name, table remarks, module name, table name, author, table prefix, template type, process definition key and serial number format, etc. The process definition key can be used to associate the form configuration table with the process node configuration table.

[0058] In step S21, the form configuration information is obtained from the business design plan, and a form configuration table is generated based on the form configuration information and the process definition key, ensuring that the form design is highly matched with actual business needs; a direct association between the form configuration table and the process node configuration table is established through the process definition key, ensuring the consistency and coherence of the form content and processing logic at different business process stages.

[0059] S22: Obtaining process list information from a preset process database, and generating a table field configuration table according to the process list information;

[0060] Among them, in a specific implementation, the table field configuration table is used to define the field information in each form, and the configuration data may include table name, field name, field data type, primary key identifier, whether it is allowed to be empty, whether it is a query item, query item sorting, field type, camel case naming, whether it is editable, whether it is displayed in a list, list display sorting, process parameter type, operation assignment node, web page display name, whether the web page is required, front-end component type and dictionary value, etc. The table field configuration table is associated with the form configuration table according to the table name information in the process list information.

[0061] In step S22, the process list information is obtained from the preset process database, and a table field configuration table is generated based on the process list information, ensuring that the table field configuration table accurately reflects the data structure in the business process, providing a solid foundation for subsequent code generation, and ensuring the consistency of the data model; the table field configuration table and the form configuration table are associated through the table name information to ensure the consistency of the form design and the database structure, avoiding the problem of data inconsistency.

[0062] Step S23: Acquire the module information and display field information of the front-end form interface from the business design solution, and generate a front-end form module display field table according to the module information and display field information of the front-end form interface.

[0063] Among them, in a specific implementation, the front-end form module display field table can be used to define the configuration information of each module of each front-end page, wherein the configuration data may include module type, title name, display field and sort number of the current module, etc. The front-end form module display field table is associated with the table field configuration table according to the display field information (such as the field name in the display field information).

[0064] In step S23, the module information and display field information of the front-end form interface are obtained from the business design plan, and the front-end form module display field table is generated based on this information, ensuring that the design of the front-end page meets business requirements and providing detailed layout and interaction rules for front-end code generation; by associating the front-end form module display field table with the table field configuration table through the display field information, the consistency of the front-end page display and the back-end data structure is ensured, avoiding the problem of data inconsistency.

[0065] In this embodiment, step S2 obtains form and field configuration information from the preset business design plan and process database, and associates this information with node information through the process definition key, thereby ensuring the relevance and accuracy of all relevant configurations, simplifying the data management and query process, and enhancing the flexibility and maintainability of the system.

[0066] Step S3: passing the form and field configuration information and the process node configuration table as parameters to a preset Velocity template engine, so that the Velocity template engine dynamically generates backend interface code and frontend page code.

[0067] In the specific implementation, the Velocity template engine is used to dynamically generate back-end interface code and front-end page code. The back-end interface code includes paging query, process order number query, saving draft, starting process and process approval, etc., and the front-end page code includes list and form VUE code.

[0068] Preferably, in some embodiments of the present application, Figure 4 The flowchart of code generation shown in FIG. 1 , step S3 can be implemented by the following preferred implementation, including steps S31 to S38, as follows:

[0069] S31: Generate dictionary data according to the form configuration information of the form configuration table;

[0070] Among them, the elements of the dictionary data include: draft saving interface path, draft deletion interface path and end event processing function, and each element corresponds to the same process definition key; in a specific implementation, the above three dictionary elements can be generated according to a predetermined naming rule through the "table notes" field information and the process definition key, and their functions are: after the code is generated and deployed, when the user uses the relevant process, clicks Save Draft to save it to the draft box, and the draft box will record the front-end page path (i.e., the draft saving interface path) and the back-end deletion interface address (i.e., the draft deletion interface path) of the current process. When the user opens the draft from the draft box, the draft saving interface path parameters will be used, and when the draft is deleted, the draft deletion interface path parameters will be used; when the process approval is completed, the deployed flowchart back-end logic will use the end event processing function, call the specified back-end event listener, perform logical processing according to the process definition key, and change the process approval status to the end status.

[0071] In addition, in the specific implementation, the two parameters of the processing page path and the viewing page path are needed when deploying the code, which are used to call the relevant page paths when subsequent users use them. Here, the "table name" field information of the table field configuration table can be used to generate these two page path parameters according to the predetermined naming rules, and then use the relevant interfaces of the deployment environment to call these two page path parameters to complete the page configuration. For example: if the table name is test_xx, the viewing path can be defined as: / testXX / module / view.vue; the processing page path is: / testXX / module / approval.vue. Of course, you can also use the interface of the test environment to configure the test first, and then use the interface of the deployment environment to configure after the test is successful.

[0072] S32: Create a table entity object, obtain the form configuration information of the form configuration table, and save it to the table entity object;

[0073] For example, in a specific implementation, a TableEntity object (i.e., table entity object) may be created, and information such as the package name, module name, author, table name, table remarks, and table prefix in the form configuration table may be set therein.

[0074] S33: Create a field attribute object, traverse each table field configuration information in the table field configuration table, and if the table field configuration information meets the preset judgment rule, set the special identification field corresponding to the judgment rule for the field attribute object.

[0075] For example, in the specific implementation, you can create a ColumnProperty field containing a property object (i.e., a field property object) and set some special flags, such as whether the field property contains hasBigDecimal (whether the field contains BigDecimal), hasLocalDate (whether the field contains LocalDate), hasFileColumn (whether there is an attachment field), etc. The default is false, and the judgment is made by traversing each row of records in the table field configuration table. For example, when the field property type is LocalDate or BigDecimal, set the corresponding property to true; when the field front-end control type is attachment, set hasFileColumn to true. The role of the ColumnProperty field containing a property object is that when the code is generated, if the property is true, the back-end code needs to reference a specific jar package, and the front-end code will reference a specific component.

[0076] In the implementation of steps S31-S33, dictionary data is generated according to the form configuration information of the form configuration table, and each element of the dictionary corresponds to the same process definition key, which simplifies the interface definition process and improves the consistency and reliability of the interface; creating a table entity object and saving the form configuration information to the object provides a clear data structure for code generation and simplifies the implementation of the data access layer; creating a field attribute object, by traversing the table field configuration information and setting special identification fields according to judgment rules, it can automatically identify and process special configuration requirements, reduce the manual workload of developers, ensure the flexibility and adaptability of the generated code, and improve the accuracy and efficiency of code generation.

[0077] S34: Generate a front-end list display field list and a front-end list data query item list according to the table field configuration information of the table field configuration table;

[0078] For example, in the specific implementation, the table field configuration table is traversed. There are four field attributes in the table field configuration table: is_list_show (whether to display in the list), list_show_order (list display sorting), is_query (whether to be a query item), and query_order (query item sorting). Not all field information of a process form needs to be displayed in the list and used as a search item. According to whether is_list_show is true or is_query is true, all fields in the table field configuration table are filtered, and a front-end list display field list is generated according to the list display sorting results, and a front-end list data query item list is generated according to the query item sorting results.

[0079] S35: Generate a process node parameter assignment object list according to the process node configuration information in the process node configuration table and the table field configuration information in the table field configuration table.

[0080] For example, in a specific implementation, a process node parameter assignment object list is generated according to the process node key of the process node configuration table and the operation assignment node of the table field configuration table.

[0081] In the implementation of steps S34-S35, by generating a front-end list display field list and a front-end list data query item list, as well as a process node parameter assignment object list, the code generation rules of the front-end page and the back-end interface are further refined to ensure the consistency of the display content and interaction logic of the front-end interface.

[0082] S36: Create a configuration mapping object, and add the dictionary data, table entity object, field attribute object, front-end list display field list, front-end list data query item list, process node parameter assignment object list and module display field information of the front-end form module display field table to the configuration mapping object;

[0083] For example, in a specific implementation, a map object (ie, a configuration mapping object) may be created first, and then all the data in the above step S36, such as dictionary data and table entity objects (ie, TableEntity objects), may be added to the map object.

[0084] S37: Using the template type parameter in the form configuration table as a parameter, calling a preset template acquisition method, and obtaining the front-end and back-end Velocity template files of the local corresponding template type;

[0085] S38: Rendering the front-end and back-end Velocity template files according to the configuration mapping object to obtain the back-end interface code and the front-end page code;

[0086] Among them, the back-end interface code includes all back-end logic implementations, including but not limited to the control layer, service layer, data access layer, etc.; the front-end page code includes all front-end interface implementations, including page layout, style, interaction logic, etc.

[0087] In the implementation of steps S36-S38, by encapsulating all necessary configuration information into the mapping object and accurately filling the template with data, high-quality back-end interface code and front-end page code are finally generated, which not only ensures the consistency and high quality of the code, but also greatly shortens the development cycle.

[0088] In summary, compared with the prior art, the above embodiments of the present application have the following beneficial effects: by parsing the Flowable flowchart through the Flowable engine, obtaining node information and process definition keys, and generating a process node configuration table, the close connection between business logic and technical implementation is ensured, the possibility of manual coding errors is reduced, and development efficiency is improved; the form and field configuration information is obtained from the preset business design scheme and process database, and this information is associated with the node information through the process definition key, which ensures the relevance and accuracy of all relevant configurations, simplifies the data management and query process, and enhances the flexibility and maintainability of the system. Finally, the form and field configuration information and the process node configuration table are passed as parameters to the preset Velocity template engine to realize the automatic generation of code, greatly shorten the development cycle, and ensure that the generated code fully meets business requirements while maintaining the consistency and high quality standards of the code.

[0089] Embodiment 2:

[0090] Please refer to Figure 2 Based on the same inventive concept, an embodiment of the present invention discloses a flowable-based front-end and back-end code automatic generation system, including: a process parsing module M1, a configuration acquisition module M2 and a code generation module M3.

[0091] The process parsing module M1 is used to parse a preset Flowable flow chart according to a preset Flowable engine, obtain node information and a process definition key of the Flowable flow chart, and generate a process node configuration table according to the node information;

[0092] The process parsing module M1 of this embodiment parses the Flowable flowchart through the Flowable engine, obtains node information and process definition keys, and generates a process node configuration table, ensuring a close connection between business logic and technical implementation, reducing the possibility of manual coding errors, and improving development efficiency.

[0093] The configuration acquisition module M2 is used to acquire form and field configuration information from a preset business design solution and process database; wherein the form and field configuration information is associated with the node information according to the process definition key.

[0094] The configuration acquisition module M2 includes: a form configuration table generation unit, a table field configuration table generation unit and a front-end form module display field table generation unit.

[0095] The form configuration table generating unit is used to obtain form configuration information from a preset business design scheme, and generate a form configuration table according to the form configuration information and the process definition key; wherein the form configuration table is associated with the process node configuration table according to the process definition key;

[0096] The table field configuration table generating unit is used to obtain process list information from a preset process database, and generate a table field configuration table according to the process list information; wherein the table field configuration table is associated with the form configuration table according to the table name information in the process list information;

[0097] The front-end form module display field table generation unit is used to obtain the module information and display field information of the front-end form interface from the business design plan, and generate the front-end form module display field table according to the module information and display field information of the front-end form interface; wherein the front-end form module display field table is associated with the table field configuration table according to the display field information.

[0098] The configuration acquisition module M2 of this embodiment obtains form and field configuration information from the preset business design plan and process database, and associates this information with node information through the process definition key, ensuring the relevance and accuracy of all relevant configurations, simplifying the data management and query process, and enhancing the flexibility and maintainability of the system.

[0099] The code generation module M3 is used to pass the form and field configuration information and the process node configuration table as parameters to the preset Velocity template engine, so that the Velocity template engine dynamically generates backend interface code and frontend page code.

[0100] The code generation module M3 includes: a data encapsulation unit, a list generation unit and a code output unit.

[0101] Among them, the data encapsulation unit is used to generate dictionary data according to the form configuration information of the form configuration table; wherein the elements of the dictionary data include: draft saving interface path, draft deletion interface path and end event processing function, and each element corresponds to the same process definition key; create a table entity object, obtain the form configuration information of the form configuration table, and save it to the table entity object; create a field attribute object, traverse the table field configuration information in the table field configuration table, if the table field configuration information meets the preset judgment rule, then for the field attribute object, set the special identification field corresponding to the judgment rule.

[0102] The list generation unit is used to generate a front-end list display field list and a front-end list data query item list according to the table field configuration information of the table field configuration table; and generate a process node parameter assignment object list according to the process node configuration information of the process node configuration table and the table field configuration information in the table field configuration table.

[0103] The code output unit is used to create a configuration mapping object, and add the dictionary data, table entity object, field attribute object, front-end list display field list, front-end list data query item list, process node parameter assignment object list and module display field information of the front-end form module display field table to the configuration mapping object; use the template type parameter in the form configuration table as a parameter, call the preset template acquisition method, and obtain the front-end and back-end Velocity template files of the local corresponding template type; according to the configuration mapping object, render the data of the front-end and back-end Velocity template files to obtain the back-end interface code and the front-end page code.

[0104] The code generation module M3 of this embodiment encapsulates the necessary configuration information in the form and field configuration information and the process node configuration table, and then passes it as a parameter to the preset Velocity template engine, thereby realizing automatic code generation, greatly shortening the development cycle, and ensuring that the generated code fully meets business requirements while maintaining code consistency and high quality standards.

[0105] In summary, compared with the prior art, the embodiments of the present application have the following beneficial effects: by parsing the Flowable flowchart through the Flowable engine, obtaining node information and process definition keys, and generating a process node configuration table, the close connection between business logic and technical implementation is ensured, the possibility of manual coding errors is reduced, and development efficiency is improved; the form and field configuration information is obtained from the preset business design scheme and process database, and this information is associated with the node information through the process definition key, which ensures the relevance and accuracy of all relevant configurations, simplifies the data management and query process, and enhances the flexibility and maintainability of the system. Finally, the form and field configuration information and the process node configuration table are passed as parameters to the preset Velocity template engine to realize the automatic generation of code, greatly shorten the development cycle, and ensure that the generated code fully meets business requirements while maintaining the consistency and high quality standards of the code.

[0106] The division of the modules described above is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules may be combined or integrated into another system.

[0107] Embodiment three:

[0108] Figure 3 The structure diagram of a device for automatically generating front-end and back-end codes based on flowable is presented. Figure 3 As shown, the front-end and back-end code automatic generation device may include: a processor N1, a memory N2, a data interface N3 and a communication bus N4.

[0109] Among them: the processor N1, the memory N2, and the data interface N3 communicate with each other through the communication bus N4; the data interface N3 is used for data communication with other devices such as input devices or output devices; the processor N1 is used to execute the program N5, which can specifically execute the relevant steps in the above-mentioned embodiment of the method for automatic generation of front-end and back-end codes based on flowable.

[0110] Specifically, the program N5 may include program codes, and the program codes include computer executable instructions.

[0111] The processor N1 may be a central processing unit CPU, or an application-specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the flowable-based front-end and back-end code automatic generation device may be processors of the same type, such as one or more CPUs, or processors of different types, such as one or more CPUs and one or more ASICs.

[0112] The memory N2 is used to store the program N5. The memory N2 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0113] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system or other device. In addition, the embodiments of the present application are not directed to any particular programming language.

[0114] Embodiment 4:

[0115] An embodiment of the present invention also provides a computer-readable storage medium, which stores at least one executable instruction. When the executable instruction is run on a flowable-based front-end and back-end code automatic generation device / system, the flowable-based front-end and back-end code automatic generation device / system executes the flowable-based front-end and back-end code automatic generation method in any of the above method embodiments.

[0116] In the specification provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. Similarly, in order to simplify the application and help understand one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present application, the various features of the embodiments of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. Wherein, the claims that follow the specific embodiment are thus clearly incorporated into the specific embodiment, wherein each claim itself is used as a separate embodiment of the application.

[0117] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and further may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive.

Claims

1. A method for automatically generating front-end and back-end codes based on flowable, characterized in that: include: Parse the preset Flowable flowchart according to the preset Flowable engine, obtain the node information and process definition key of the Flowable flowchart, and generate a process node configuration table according to the node information; Obtaining form and field configuration information from a preset business design solution and process database; wherein the form and field configuration information is associated with the node information according to the process definition key; The form and field configuration information and the process node configuration table are passed as parameters to a preset Velocity template engine, so that the Velocity template engine dynamically generates backend interface code and frontend page code.

2. A method for automatically generating front-end and back-end codes based on flowable as claimed in claim 1, characterized in that: The obtaining of form and field configuration information from the preset business design solution and process database includes: Obtain form configuration information from a preset business design solution, and generate a form configuration table according to the form configuration information and the process definition key; The form configuration table and the process node configuration table are associated according to the process definition key.

3. A method for automatically generating front-end and back-end codes based on flowable as claimed in claim 2, characterized in that: The obtaining of form and field configuration information from a preset business design solution and process database also includes: According to a preset process database, process list information is obtained, and a table field configuration table is generated according to the process list information; The table field configuration table is associated with the form configuration table according to the table name information in the process list information.

4. A method for automatically generating front-end and back-end codes based on flowable as claimed in claim 3, characterized in that: The obtaining of form and field configuration information from a preset business design solution and process database also includes: Acquire module information and display field information of the front-end form interface from the business design solution, and generate a front-end form module display field table according to the module information and display field information of the front-end form interface; Among them, the front-end form module display field table is associated with the table field configuration table according to the display field information.

5. A method for automatically generating front-end and back-end codes based on flowable as claimed in claim 4, characterized in that: The form and field configuration information and the process node configuration table are passed as parameters to a preset Velocity template engine so that the Velocity template engine dynamically generates a backend interface code and a frontend page code, including: Generate dictionary data according to the form configuration information of the form configuration table; wherein the elements of the dictionary data include: a draft saving interface path, a draft deleting interface path and an end event processing function, and each element corresponds to the same process definition key; Create a table entity object, obtain the form configuration information of the form configuration table, and save it to the table entity object; A field attribute object is created, and each table field configuration information in the table field configuration table is traversed. If the table field configuration information meets the preset judgment rule, a special identification field corresponding to the judgment rule is set for the field attribute object.

6. A method for automatically generating front-end and back-end codes based on flowable as claimed in claim 5, characterized in that: The method of passing the form and field configuration information and the process node configuration table as parameters to a preset Velocity template engine so that the Velocity template engine dynamically generates a backend interface code and a frontend page code also includes: Generate a front-end list display field list and a front-end list data query item list according to the table field configuration information of the table field configuration table; A process node parameter assignment object list is generated according to the process node configuration information in the process node configuration table and the table field configuration information in the table field configuration table.

7. A method for automatically generating front-end and back-end codes based on flowable as claimed in claim 6, characterized in that: The method of passing the form and field configuration information and the process node configuration table as parameters to a preset Velocity template engine so that the Velocity template engine dynamically generates a backend interface code and a frontend page code also includes: Create a configuration mapping object, and add the dictionary data, table entity object, field attribute object, front-end list display field list, front-end list data query item list, process node parameter assignment object list and module display field information of the front-end form module display field table to the configuration mapping object; The template type parameter in the form configuration table is used as a parameter, and a preset template acquisition method is called to obtain the front-end and back-end Velocity template files of the local corresponding template type; According to the configuration mapping object, data rendering is performed on the front-end and back-end Velocity template files to obtain the back-end interface code and the front-end page code.

8. A flowable-based front-end and back-end code automatic generation system, characterized in that: include: Process parsing module, configuration acquisition module and code generation module; The process parsing module is used to parse the preset Flowable flow chart according to the preset Flowable engine, obtain the node information and process definition key of the Flowable flow chart, and generate a process node configuration table according to the node information; The configuration acquisition module is used to acquire form and field configuration information from a preset business design solution and process database; wherein the form and field configuration information is associated with the node information according to the process definition key; The code generation module is used to pass the form and field configuration information and the process node configuration table as parameters to the preset Velocity template engine, so that the Velocity template engine dynamically generates backend interface code and frontend page code.

9. A flowable-based front-end and back-end code automatic generation device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the computer program is loaded into the processor, the steps of the method for automatically generating front-end and back-end codes based on flowable are implemented according to claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of a method for automatically generating front-end and back-end codes based on flowable are implemented according to claims 1 to 7.

Citation Information

Cited By

  • Front-end form generation method, product, equipment and storage medium

    CN120560655A