Workflow control method and device and electronic equipment
By encapsulating common and custom operation logic in workflow components, and based on field coding and button correspondence, the problem of repetitive logic implementation in workflow forms is solved, enabling logic reuse and centralized management, and improving system maintainability and development efficiency.
Patent Information
- Application Number
- CN202511801981.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-02
- Publication Date
- 2026-02-27
AI Technical Summary
In existing workflow electronic devices, the same common business logic is repeatedly implemented in different workflow forms, making modification and maintenance cumbersome, resulting in code redundancy and reduced system stability.
When generating workflow forms, the target field code is determined based on the correspondence between common function buttons and field codes. Common operation logic and customized operation logic are encapsulated in the workflow component to achieve logic reuse and centralized management. Modifications can be made only in the workflow component.
It enables the reuse of business logic across different workflow forms, reduces repetitive modification operations, improves system maintainability and development efficiency, and ensures consistent user experience and system flexibility.
Smart Images

Figure CN121581608A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a workflow control method and device and electronic equipment. BACKGROUND
[0002] In the current workflow electronic equipment, the workflow forms of each functional module are usually implemented in a separate development manner. For each different workflow form, the developer needs to write a complete front-end interface code for it, including the layout and rendering logic of all form items (such as input boxes, selection boxes, etc.), and hard-codes the corresponding front-end interaction logic and back-end interface call for each function button (such as submit, save, delete, etc.).
[0003] However, in the existing workflow electronic equipment, the same public business logic is repeatedly implemented in different workflow forms, and when the public business logic needs to be modified, each workflow form needs to be modified one by one, which is cumbersome. SUMMARY
[0004] The present application provides a workflow control method and device and electronic equipment to solve the problem of repeated implementation of public business logic in different workflow forms in the prior art.
[0005] In a first aspect, the present application provides a workflow control method, comprising: generating a workflow form of a target process instance in response to the operation of at least one function button in the business module selected by the user; in response to the operation of a target function button on the workflow form by the user, determining a target field code corresponding to the target function button based on a first correspondence relationship between public function buttons and field codes in a case where the target function button is determined to be a public function button, wherein the public function button is a function button existing in all business modules; determining the public operation logic corresponding to the target function button based on a second correspondence relationship between field codes and public operation logic and the target field code; in a case where it is determined that the public operation logic has associated custom operation logic, invoking a workflow component to execute the public operation logic and the custom operation logic, wherein the public operation logic and the custom operation logic are encapsulated in the workflow component.
[0006] The control method of the workflow provided in the application first generates a workflow form of a target process instance in response to an operation of at least one function button in a service module selected by a user, secondly, in response to an operation of a target function button on the workflow form, determines a target field code corresponding to the target function button based on a first correspondence relationship between the public function button and the field code, and determines a public operation logic corresponding to the target function button in the workflow component based on a second correspondence relationship between the field code and the public operation logic and the customized operation logic, and finally, in the case where the public operation logic has associated customized operation logic, invokes the public operation logic and the customized operation logic encapsulated in the workflow component. The above method encapsulates the public operation logic and the customized operation logic in the workflow component, and based on the correspondence relationship between the public function button and the field code and the correspondence relationship between the field code and the public operation logic, so that different workflow forms can reuse the same business logic, and when the public business logic needs to be modified, it only needs to be modified once in the workflow component to take effect in all related forms, avoiding the tedious operation of modifying each workflow form one by one.
[0007] In a possible implementation, the generating the workflow form of the target process instance in response to the operation of at least one function button in the service module selected by the user comprises: For each function button in the at least one function button, determining a field code corresponding to the function button based on the first correspondence relationship or a third correspondence relationship between the function button and the field code; Generating form configuration information based on the determined field code, and taking the generated form configuration information as the workflow form.
[0008] In a possible implementation, the customized operation logic comprises first customized operation logic and / or second customized operation logic, and the invoking the workflow component to execute the public operation logic and the customized operation logic comprises: In the case where the customized operation logic comprises the first customized operation logic, executing the first customized operation logic before executing the public operation logic; In the case where the customized operation logic comprises the second customized operation logic, executing the second customized operation logic after executing the public operation logic; In the case where the customized operation logic comprises the first customized operation logic and the second customized operation logic, executing the first customized operation logic before executing the public operation logic, and executing the second customized operation logic after executing the public operation logic.
[0009] In a possible implementation, before the executing the common operation logic, the method further includes: In the process of executing the first customized operation logic, a first return value of the first customized operation logic is detected; If the first return value is a first asynchronous identifier, it is determined that the first customized operation logic is an asynchronous operation; If the first return value is a first completion identifier, it is determined that the first customized operation logic is a synchronous operation.
[0010] In a possible implementation, before the executing the second customized operation logic, the method further includes: In the process of executing the common operation logic, a second return value of the common operation logic is detected; If the second return value is a second asynchronous identifier, it is determined that the common operation logic is an asynchronous operation; If the second return value is a second completion identifier, it is determined that the common operation logic is a synchronous operation.
[0011] In a possible implementation, the first customized operation logic and the second customized operation logic are both hook functions.
[0012] In a second aspect, the present application provides a workflow control apparatus, including: A form generation module configured to generate a workflow form of a target process instance in response to a user's operation on at least one function button in a selected business module; A processing module configured to, in response to a user's operation on a target function button on the workflow form, determine a target field code corresponding to the target function button based on a first correspondence relationship between common function buttons and field codes in a case where the target function button is determined to be a common function button, wherein the common function button is a function button existing in all business modules; and determine a common operation logic corresponding to the target function button based on a second correspondence relationship between field codes and common operation logics and the target field code. A workflow component configured to execute the common operation logic and a customized operation logic associated with the common operation logic in a case where the common operation logic is determined to exist the customized operation logic; and encapsulate the common operation logic and the customized operation logic.
[0013] In a possible implementation, the form generation module is specifically configured to: For each function button in the at least one function button, determine a field code corresponding to the function button based on the first correspondence relationship or a third correspondence relationship between function buttons and field codes. Based on the determined field encoding, form configuration information is generated, and the generated form configuration information is used as the workflow form.
[0014] In a possible implementation, the customized operation logic includes first customized operation logic and / or second customized operation logic, and the workflow component is specifically configured to: In the case where the customized operation logic includes the first customized operation logic, the first customized operation logic is executed before the common operation logic is executed. In the case where the customized operation logic includes the second customized operation logic, the second customized operation logic is executed after the common operation logic is executed. In the case where the customized operation logic includes the first customized operation logic and the second customized operation logic, the first customized operation logic is executed before the common operation logic is executed, and the second customized operation logic is executed after the common operation logic is executed.
[0015] In a possible implementation, before the common operation logic is executed, the workflow component is further configured to: In the process of executing the first customized operation logic, a first return value of the first customized operation logic is detected. If the first return value is a first asynchronous identifier, it is determined that the first customized operation logic is an asynchronous operation. If the first return value is a first completion identifier, it is determined that the first customized operation logic is a synchronous operation.
[0016] In a possible implementation, before the second customized operation logic is executed, the workflow component is further configured to: In the process of executing the common operation logic, a second return value of the common operation logic is detected. If the second return value is a second asynchronous identifier, it is determined that the common operation logic is an asynchronous operation. If the second return value is a second completion identifier, it is determined that the common operation logic is a synchronous operation.
[0017] In a possible implementation, the first customized operation logic and the second customized operation logic are both hook functions.
[0018] In a third aspect, the present application provides an electronic device, comprising: a memory configured to store program instructions; a processor configured to invoke the program instructions stored in the memory and perform steps included in the method according to any one of the first aspect according to the obtained program instructions; a display configured to respond to user operations.
[0019] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, the computer program comprising program instructions, which when executed by a computer, cause the computer to perform the method of any one of the first aspect.
[0020] In a fifth aspect, the present application provides a computer program product, which comprises computer program code, which when run on a computer, causes the computer to perform the method of any one of the first aspect. BRIEF DESCRIPTION OF DRAWINGS
[0021] Figure 1 A structural schematic diagram of an exhibition hall management system provided by an embodiment of the present application; Figure 2 A schematic diagram of a display interface provided by an embodiment of the present application; Figure 3 A schematic diagram of another display interface provided by an embodiment of the present application; Figure 4 A flowchart of a control method of a workflow provided by an embodiment of the present application; Figure 5 A schematic diagram of a mapping relationship between a function button and a field code provided by an embodiment of the present application; Figure 6 A workflow schematic diagram of a workflow component provided by an embodiment of the present application; Figure 7 A workflow schematic diagram of another workflow component provided by an embodiment of the present application; Figure 8 A flowchart of another control method of a workflow provided by an embodiment of the present application; Figure 9 A structural schematic diagram of a control device of a workflow provided by an embodiment of the present application; Figure 10 A structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to make the objectives, technical solutions and advantages of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application. The embodiments in the present application and the features in the embodiments can be combined with each other in a non-conflicting manner. Moreover, although a logical sequence is shown in the flowchart, in some cases, the steps shown or described can be performed in an order different from the one shown here.
[0023] The terms "first" and "second" in the specification and claims of the present application and the above drawings are used to distinguish different objects, rather than to describe a specific sequence. In addition, the term "comprising" and any variations thereof are intended to cover non-exclusive protection. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but can optionally include steps or units not listed, or can optionally include other steps or units inherent to the process, method, product or device. "Multiple" in the present application can mean at least two, for example, can be two, three or more, and the embodiments of the present application are not limited.
[0024] The exemplary embodiments of the present application are described below with reference to the accompanying drawings, including various details of the embodiments of the present application to help understanding. They should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the present disclosure. Also, for the sake of clarity and conciseness, the description below omits the description of well-known functions and structures. It should be noted that in the embodiments of the present application, some software, components, models and other industry solutions can be mentioned, which should be considered as exemplary, and the purpose is only to illustrate the feasibility of the implementation of the technical solutions of the present application, but does not mean that the applicant has or must have used the solutions.
[0025] In the technical solutions of the present application, the acquisition, transmission, storage and use of data comply with the requirements of relevant national laws and regulations.
[0026] Before introducing the workflow control method provided by the embodiments of the present application, in order to facilitate understanding, the technical background of the embodiments of the present application will be described in detail first.
[0027] Currently, most electronic devices and management systems equipped with workflow functions adopt a decentralized form development mode, that is, the workflow forms of each functional module are customized and developed, resulting in that the same business components in different workflow forms cannot be effectively reused, and a large amount of code redundancy is generated. In addition, when the public business logic needs to be adjusted, the developer must perform repeated modification operations in all related workflow forms, which not only has a huge workload, but also is prone to omissions and inconsistent logic. In addition, since different functional modules are implemented by different developers, the differences in code style and implementation manner of the developers make it difficult for the system to maintain unified business logic implementation, thereby reducing the stability and maintainability of the system.
[0028] For example, as shown in Figure 1 , a structure diagram of an exhibition hall management system provided by an embodiment of the present application is shown, which includes a core business module of reservation application 11, and is divided into five sub-modules of regular visit 111, large-scale activity 112, propaganda and play 113, site use 114 and resource sharing 115. Each sub-module includes a respective workflow form, although the business scenarios of these workflow forms are different, but a group of same function buttons are included, wherein the function buttons include but are not limited to submit, settle, cancel settlement, retrieve and delete, wherein the submit is used to save and promote the process, the settlement realizes the process archiving, the cancel settlement is used to restart the process, the retrieve is used to realize the process rollback, and the delete is used to remove the form. For example, as shown in Figure 2 and Figure 3 , a display interface provided by an embodiment of the present application is shown, Figure 2 is a display interface corresponding to the propaganda and play sub-module, Figure 3 , the function of the display interface is to reserve an activity, and a group of same function buttons are included, that is, save and submit.
[0029] However, the above same function buttons are repeated developed five times in the five different sub-modules. The front-end verification logic, back-end interface calling logic and return parameter processing logic of the above buttons are independently implemented in each module. If the verification rules of the submit button need to be optimized, the developer must modify the corresponding code in the five sub-modules respectively, and if the interface calling mode of the settlement button needs to be adjusted, the same modification needs to be repeated in the five sub-modules, which is not only cumbersome, but also wastes development resources.
[0030] In order to solve the above problems, the present application provides a workflow control method, device and electronic equipment. In order to facilitate understanding, the workflow control method, device and electronic equipment provided by the present application will be described in detail below with reference to the accompanying drawings.
[0031] As shown in Figure 4As shown, a flowchart of a workflow control method provided by an embodiment of the present application is shown, and the details are as follows: S401: In response to the operation of at least one function button in the service module selected by the user, a workflow form of a target process instance is generated. S402: In response to the operation of the target function button on the workflow form by the user, in a case where the target function button is a public function button, a target field code corresponding to the target function button is determined based on a first correspondence relationship between the public function button and the field code, wherein the public function button is a function button existing in all service modules. S403: A public operation logic corresponding to the target function button is determined based on a second correspondence relationship between the field code and the public operation logic and the target field code. S404: In a case where the public operation logic has an associated customized operation logic, the public operation logic and the customized operation logic encapsulated in the workflow component are invoked to execute the public operation logic and the customized operation logic.
[0032] The workflow control method provided by the present application first generates a workflow form of a target process instance in response to the operation of at least one function button in the service module selected by the user, then in a case where the target function button is a public function button, a target field code corresponding to the target function button is determined based on a first correspondence relationship between the public function button and the field code in response to the operation of the target function button on the workflow form by the user, and then a public operation logic corresponding to the target function button is determined in the workflow component based on a second correspondence relationship between the field code and the public operation logic and the customized operation logic. Finally, in a case where the public operation logic has an associated customized operation logic, the public operation logic and the customized operation logic encapsulated in the workflow component are invoked. The above method, because the public operation logic and the customized operation logic are encapsulated in the workflow component, and based on the correspondence relationship between the public function button and the field code and the correspondence relationship between the field code and the public operation logic, different workflow forms can reuse the same business logic, and when the public business logic needs to be modified, it only needs to be modified once in the workflow component to take effect in all related forms, avoiding the tedious operation of modifying each workflow form one by one.
[0033] In the embodiment of the present application, the mapping relationship between all function buttons and field codes is pre-stored in the workflow component instead of being scattered in each service module, including the first correspondence relationship (i.e. the correspondence relationship between the public function button and the field code, wherein the public function button is a function button existing in all service modules) and the third correspondence relationship (i.e. the correspondence relationship between the private function button of each service module and the field code), for example, as shown inFigure 5 As shown in the figure, the function button "My side main leader - delete" corresponds to the field code "deleteOurLeader", the function button "Cancel archiving" corresponds to the field code "cancelFinish", the function button "Opposite side main leader - delete" corresponds to the field code "deleteTargetLeader", the function button "My side main leader - add leader" corresponds to the field code "isShowOurLeadersBtn", the function button "Delete this form" corresponds to the field code "deleteForm", the function button "Archive" corresponds to the field code "finish", the function button "Close" corresponds to the field code "close", the function button "Visit content - view" corresponds to the field code "handleView", the function button "View rehearsal" corresponds to the field code "viewRehearsal", the function button "Opposite side main leader - add out-of-line leader" corresponds to the field code "isShowOutLeadersBtn", the function button "View flow" corresponds to the field code "viewFlow", the function button "Contact - select" corresponds to the field code "isShowContactBtn", the function button "Cancel activity" corresponds to the field code "cancel", the function button "Opposite side main leader - add in-line leader" corresponds to the field code "isShowTargetLeadersBtn", the function button "Visit content - select" corresponds to the field code "handleChoose", the function button "Save" corresponds to the field code "save", the function button "Guide - select" corresponds to the field code "isShowGuidenBtn", the function button "Export leader list" corresponds to the field code "exportLeaderList", and the function button "Submit" corresponds to the field code "confirm".
[0034] When a workflow form of a target process instance needs to be generated, a user selects at least one function button in a business module, wherein the at least one button includes, but is not limited to, common operation buttons such as submit, save, delete, and private function buttons of each business module.
[0035] For each of the at least one function button, the workflow component is used to identify the function button, and when the function button is determined to be a common function button, the field code corresponding to the function button is determined in the first corresponding relationship, and when the function button is determined to be a private function button of a specific business module, the field code corresponding to the function button is determined in the third corresponding relationship. After obtaining the field codes corresponding to the user-selected function buttons, a structured form configuration information is generated based on the codes, which describes all the field elements required by the final form.
[0036] Finally, the generated form configuration information is used as a parameter to generate a workflow form through a workflow component. Specifically, the workflow component encapsulates a field type library, which defines a plurality of common form item types (e.g., input box, single selection box, check box, date selector, etc.). The workflow component matches the corresponding element types from the field type library according to the received form configuration information and performs rendering, thereby generating a complete and fully functional workflow form on the user interface. In this way, the business module itself does not need to care about the specific construction logic of the form, and the separation of business logic and interface presentation is achieved.
[0037] Taking the propaganda playing sub-module as an example, when the user selects its private function buttons "email reminder" and "cancel", a query is initiated to the workflow component. The workflow component finds the field codes corresponding to the "email reminder" and "cancel" buttons in the third corresponding relationship stored in the workflow component and specially configured for the propaganda playing module. Then, the form configuration information is generated using these codes, and the workflow component is used for rendering, thereby automatically generating the workflow form as shown in Figure 2 on the display interface.
[0038] Similarly, taking the regular visit sub-module as an example, when the user operates the reservation activity business, the system queries the private function buttons of the module, such as the field codes corresponding to "our main leaders-add leaders" and "opponent main leaders-add leaders". The workflow component generates the corresponding form configuration information according to these codes and automatically renders the workflow form as shown in Figure 3 , which contains these specific function buttons and corresponding form items.
[0039] The above method unifies the public operation logic and the customized operation logic in the workflow component, establishes the first corresponding relationship between the public function buttons and the field codes and the third corresponding relationship between the private function buttons of each business module and the field codes, thereby achieving high reuse and standardized management of business logic. Not only is the business module decoupled from the form generation logic, but also through the centralized configuration management mechanism, modification of the public business logic only needs to be adjusted in the workflow component, which greatly improves the maintainability and development efficiency of the system. At the same time, the architecture has strong applicability, and new business functions only need to be configured with new mapping relationships for quick integration, effectively reducing the complexity and development cost of system function expansion, and ensuring the consistency of user experience between different business modules.
[0040] In one embodiment, after generating the workflow form of the target process instance, when responding to the user's operation on the target function button on the workflow form, if the target function button is determined to be a public function button, the target field code corresponding to the target function button is determined based on the first correspondence between public function buttons and field codes. Based on the second correspondence between field codes and common operation logic, the common operation logic corresponding to the target function button is determined through the target field codes that have been confirmed above. If it is determined that there is no associated custom operation logic for the common operation logic, then the workflow component is invoked to execute the common operation logic.
[0041] This application's embodiments establish a mapping relationship between field codes and common operation logic, and execute the common operation logic corresponding to the target function button based on this mapping relationship, achieving high reusability and unified management of common business logic. When it is necessary to modify the common business logic, it only needs to be modified once in the workflow component to take effect in all related forms, effectively solving the problem of needing to modify each workflow form one by one in the prior art. This configuration mapping-based execution mechanism significantly improves code reusability, system maintainability, and development efficiency while ensuring system flexibility, and at the same time ensures the consistency of the execution logic of the same function button in different business scenarios, providing a highly efficient, stable, and easy-to-maintain technical solution for workflow management systems.
[0042] In another embodiment, after determining the common operation logic corresponding to the target function button, if it is determined that there is associated customized operation logic in the common operation logic, the workflow component is invoked to execute the common operation logic and the customized operation logic. The common operation logic and the customized operation logic are encapsulated in the workflow component, and the customized operation logic represents the logic that is preset in the target process instance and associated with the common operation logic. Specifically, the custom operation logic includes a first custom operation logic and / or a second custom operation logic. The first custom operation logic refers to the custom logic executed before the execution of the common operation logic, and is usually implemented in the form of hook functions, such as functions in the form of "beforeXX". The second custom operation logic refers to the custom logic executed after the execution of the common operation logic, and is also implemented in the form of hook functions, such as functions in the form of "afterXX".
[0043] The design of hook functions makes workflow components highly scalable, allowing customized business logic to be flexibly inserted into different process instances to meet the individual needs of each process instance, while maintaining the stability and reusability of common operation logic.
[0044] In the case that the customized operation logic comprises the first customized operation logic, i.e., the target function button is associated with the first customized operation logic and the common operation logic, the workflow component executes according to the following flow, as shown in Figure 6 FIG. 1 is a schematic diagram of a workflow of a workflow component according to an embodiment of the present application, and specifically: S601: execute the first customized operation logic; S602: in the process of executing the first customized operation logic, detect a first return value of the first customized operation logic; S603: if the first return value is a first asynchronous identifier, determine that the first customized operation logic is an asynchronous operation, and continue to execute the first customized operation logic while executing the common operation logic; S604: if the first return value is a first completion identifier, determine that the first customized operation logic is a synchronous operation and that the first customized operation logic has been completed, and then execute the common operation logic.
[0045] For example, the first customized operation logic corresponding to the target function button "submit" is "beforeConfirm", which is used for personalized data processing before submission, such as converting an array type to a string type; and the common operation logic corresponding to the target function button "submit" is "doConfirm", which is used for executing a standard submission operation.
[0046] First, call the workflow component to execute "beforeConfirm"; If a Promise object (i.e., the first asynchronous identifier) is returned in the process of executing "beforeConfirm", the workflow component determines that "beforeConfirm" is an asynchronous operation. At this time, the asynchronous task of "beforeConfirm" continues to be executed in the background, and the workflow component immediately starts to execute "doConfirm", and the two are processed in parallel, improving the execution efficiency.
[0047] If "beforeConfirm" is executed and a normal result (i.e., the first completion identifier) that is not a Promise is returned, the workflow component determines that "beforeConfirm" is a synchronous operation and that "beforeConfirm" has been completed, and then starts to execute "doConfirm", ensuring the sequential execution of business logic.
[0048] The embodiment of the application realizes intelligent identification and parallel processing of synchronous and asynchronous operations by detecting the return state of the first customized operation logic in real time during execution, in the case that the target function button is associated with the first customized operation logic and the common operation logic. For asynchronous operation, the subsequent logic is continued to be executed in a non-blocking manner, thereby improving the overall execution efficiency; for synchronous operation, the sequential execution is maintained, thereby ensuring the correctness of the business logic.
[0049] In the case that the customized operation logic includes the second customized operation logic and the common operation logic, that is, the target function button is associated with the second customized operation logic and the common operation logic, the workflow component executes according to the following flow, as shown in Figure 7 Another workflow process diagram of a workflow component provided by the embodiment of the application is shown in FIG. 7B, and the specific process is as follows: S701: Execute the common operation logic; S702: Detect the second return value of the common operation logic during execution of the common operation logic; S703: If the second return value is the second asynchronous identifier, it is determined that the common operation logic is asynchronous operation, at this time, the common operation logic is continued to be executed, and the second customized operation logic is executed at the same time; S704: If the second return value is the second completion identifier, it is determined that the common operation logic is synchronous operation and the common operation logic has been completed, and then the second customized operation logic is executed.
[0050] For example, the second customized operation logic corresponding to the target function button "submit" is "afterConfirm", which is used for personalized data processing after submission, such as data type conversion, page jump and the like; the common operation logic corresponding to the target function button "submit" is "doConfirm", which is used for executing the standard submission operation.
[0051] First, the workflow component is called to execute "doConfirm"; If a Promise object (that is, the second asynchronous identifier) is returned during execution of "doConfirm", the workflow component determines that "doConfirm" is asynchronous operation. At this time, the asynchronous task of "doConfirm" continues to be executed in the background, and the workflow component immediately starts to execute "afterConfirm", and the two are processed in parallel, thereby improving the execution efficiency.
[0052] If "doConfirm" is executed and a normal result (that is, the second completion identifier) other than the Promise is returned, the workflow component determines that "doConfirm" is synchronous operation and "doConfirm" has been completed, and then "afterConfirm" is executed, thereby ensuring the sequential execution of the business logic.
[0053] The embodiment of the application realizes intelligent identification and parallel processing of synchronous and asynchronous operations by detecting the return state of the common operation logic in real time during execution when the target function button is associated with the second customized operation logic and the common operation logic. For asynchronous operations, the subsequent logic is continued to be executed in a non-blocking manner, thereby improving the overall execution efficiency; for synchronous operations, the sequential execution is maintained, thereby ensuring the correctness of the business logic.
[0054] In the case where the customized operation logic includes the first customized operation logic and the second customized operation logic, that is, the target function button is associated with the first customized operation logic, the second customized operation logic and the common operation logic, the specific workflow of the workflow component is as follows: First, the first customized operation logic is executed. During the execution of the first customized operation logic by the workflow component, the execution state and the return value thereof are monitored in real time. If it is detected that the first customized operation logic returns a first asynchronous identifier (such as a Promise object), it is determined that the first customized operation logic is an asynchronous operation, at this time, the first customized operation logic continues to be executed in the background, and at the same time, the workflow component immediately starts to execute the common operation logic, thereby realizing parallel processing; if it is detected that the first customized operation logic is executed and returns a normal result (that is, a first completion identifier) other than a Promise, it is determined that the first customized operation logic is a synchronous operation and the first customized operation logic has been completed, and then the execution of the common operation logic is started; During the execution of the common operation logic, the execution state and the return value thereof are monitored in real time. If it is detected that the common operation logic returns a second asynchronous identifier (such as a Promise object), it is determined that the common operation logic is an asynchronous operation, at this time, the common operation logic continues to be executed in the background, and at the same time, the workflow component immediately starts to execute the second customized operation logic, thereby realizing parallel processing; if it is detected that the common operation logic is executed and returns a normal result (that is, a second completion identifier) other than a Promise, it is determined that the common operation logic is a synchronous operation and the common operation logic has been completed, and then the execution of the second customized operation logic is started; It should be noted that the first asynchronous identifier and the second asynchronous identifier can adopt a unified identifier form or different identifier forms according to different operation logics, and the application does not limit this.
[0055] In an embodiment, the same function button realizes differentiated business logic in different business scenarios through parameterized configuration. Specifically, although the same function button (such as a submit button) is used in each business module, different parameter combinations are configured for each business module, so that the button executes the common operation logic in different scenarios in accordance with the respective business requirements.
[0056] The parameter combination includes the transaction code, method name ID, and request parameters for each business module. The transaction code is used to identify the backend interface number of the specific business operation, the method ID is used to define the processing method identifier of the frontend or backend, and the request parameters contain specific data required for business execution.
[0057] Taking the "Submit" button as an example, the submit button for a regular visitor form sets the transaction code to 005 and the method ID to visitConfirm; the submit button for a promotional broadcast form sets the transaction code to 006 and the method ID to broadcastConfirm. When a user clicks the submit button in different business modules, although the same field code and common operation logic entry point are triggered, the actual business logic executed will automatically adapt to the corresponding backend interface and processing method due to the different pre-configured parameter combinations of each module.
[0058] This application's embodiments utilize a parameterized configuration mechanism to enable the same function button to intelligently adapt to the specific needs of different business scenarios. This design significantly improves system flexibility and maintainability while maintaining system architectural uniformity and reusability of common operational logic. Each business module can differentiate its business logic simply by configuring different parameter combinations, eliminating the need for redundant development of similar functions and effectively improving development efficiency and system scalability.
[0059] like Figure 8 The diagram shown is a flowchart illustrating another workflow control method provided in this application embodiment, as detailed below: S801: Generate a workflow form for the target process instance; S802: After responding to the user's operation on the target function button on the workflow form, determine the target field code corresponding to the target function button based on the workflow form; S803: Based on the first correspondence between field encoding and common operation logic, after determining the common operation logic corresponding to the target function button, determine the customized operation logic corresponding to the target function button, wherein the customized operation logic includes the first customized operation logic and the second customized operation logic. S804: Execute the first operation logic; S805: Determine whether the first return value of the first customized operation logic is the first asynchronous identifier. If yes, execute S806; if no, execute step S807. S806: Executes common operation logic; S807: After the first customized operation logic is determined, execute S806; S808: Determine whether the second return value of the common operation logic is the second asynchronous identifier. If yes, execute step S809; if no, execute step S810. S809: executing second customized operation logic; S810: determining that the public operation logic is completed, and executing S809.
[0060] Based on the same inventive concept, the embodiments of the present application further provide a workflow control device, which has a similar implementation principle to the workflow control method, and the specific implementation of the workflow control device can be referred to the foregoing method embodiments, and the repeated parts will not be described herein.
[0061] As shown in FIG. 9, a structural schematic diagram of a workflow control device provided by an embodiment of the present application includes: Figure 9 a form generation module 91 configured to generate a workflow form of a target process instance in response to an operation of at least one function button in a selected business module; a processing module 92 configured to determine a target field code corresponding to a target function button based on a first correspondence relationship between public function buttons and field codes in a case where the target function button is determined to be a public function button, wherein the public function button is a function button existing in all business modules; and determine public operation logic corresponding to the target function button based on a second correspondence relationship between field codes and public operation logic and the target field code in response to an operation of the target function button on the workflow form; a workflow component 93 configured to execute the public operation logic and customized operation logic in a case where the public operation logic is determined to have associated customized operation logic; and encapsulate the public operation logic and the customized operation logic.
[0062] In an embodiment, the form generation module 91 is specifically configured to: determine, for each function button in the at least one function button, a field code corresponding to the function button based on the first correspondence relationship or a third correspondence relationship between function buttons and field codes; generate form configuration information based on the determined field code, and use the generated form configuration information as the workflow form.
[0063] In an embodiment, the customized operation logic includes first customized operation logic and / or second customized operation logic, and the workflow component 94 is specifically configured to: in a case where the customized operation logic includes first customized operation logic, execute the first customized operation logic before executing the public operation logic; in a case where the customized operation logic includes second customized operation logic, execute the second customized operation logic after executing the public operation logic. In the case where the customized operation logic includes a first customized operation logic and a second customized operation logic, the first customized operation logic is executed before the common operation logic is executed, and the second customized operation logic is executed after the common operation logic is executed.
[0064] In one embodiment, before executing the common operation logic, the workflow component 94 is further configured to: During the execution of the first customized operation logic, the first return value of the first customized operation logic is detected; If the first return value is the first asynchronous identifier, then the first customized operation logic is determined to be an asynchronous operation; If the first return value is the first completion identifier, then the first customized operation logic is determined to be a synchronous operation.
[0065] In one embodiment, before executing the second customized operation logic, the workflow component 94 is further configured to: During the execution of the common operation logic, the second return value of the common operation logic is detected; If the second return value is the second asynchronous identifier, then the common operation logic is determined to be an asynchronous operation; If the second return value is the second completion identifier, then the common operation logic is determined to be a synchronous operation.
[0066] In one embodiment, both the first customized operation logic and the second customized operation logic are hook functions.
[0067] Based on the same inventive concept, this application also provides an electronic product. The implementation principle of the electronic product is similar to that of the enterprise service bus system. The specific implementation method of the electronic product can be found in the aforementioned enterprise service bus system embodiments, and the repeated parts will not be described again.
[0068] like Figure 10 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this application, comprising: Memory 101 is used to store program instructions; Processor 102 is configured to call program instructions stored in the memory and execute the following steps according to the obtained program instructions: In response to the user's selection of at least one function button in the business module, generate a workflow form for the target process instance; In response to a user operation on a target function button on the workflow form, in a case where the target function button is determined to be a common function button, a target field code corresponding to the target function button is determined based on a first correspondence relationship between common function buttons and field codes, wherein the common function button is a function button existing in all business modules; A common operation logic corresponding to the target function button is determined based on a second correspondence relationship between field codes and common operation logics and the target field code; In a case where the common operation logic is determined to have an associated customized operation logic, the common operation logic and the customized operation logic are invoked to be executed by a workflow component, wherein the common operation logic and the customized operation logic are encapsulated in the workflow component; a display 103 configured to display information in response to a user operation.
[0069] In an embodiment, the processor 102 is specifically configured to: For each of the at least one function button, a field code corresponding to the function button is determined based on the first correspondence relationship or a third correspondence relationship between function buttons and field codes; Based on the determined field code, form configuration information is generated, and the generated form configuration information is taken as the workflow form.
[0070] In an embodiment, the customized operation logic includes a first customized operation logic and / or a second customized operation logic, and the processor 102 is specifically configured to: In a case where the customized operation logic includes the first customized operation logic, the first customized operation logic is executed before the common operation logic is executed; In a case where the customized operation logic includes the second customized operation logic, the second customized operation logic is executed after the common operation logic is executed; In a case where the customized operation logic includes the first customized operation logic and the second customized operation logic, the first customized operation logic is executed before the common operation logic is executed, and the second customized operation logic is executed after the common operation logic is executed.
[0071] In an embodiment, before the common operation logic is executed, the processor 102 is further configured to: During execution of the first customized operation logic, a first return value of the first customized operation logic is detected; If the first return value is a first asynchronous identifier, it is determined that the first customized operation logic is an asynchronous operation; If the first return value is a first completion identifier, it is determined that the first customized operation logic is a synchronous operation.
[0072] In an embodiment, before the executing the second customized operation logic, the processor 92 is further configured to: detecting a second return value of the common operation logic in the process of executing the common operation logic; if the second return value is a second asynchronous identifier, determining that the common operation logic is an asynchronous operation; if the second return value is a second completion identifier, determining that the common operation logic is a synchronous operation.
[0073] In an embodiment, the first customized operation logic and the second customized operation logic are both hook functions.
[0074] Based on the same inventive concept, the embodiments of the present application further provide a computer readable storage medium, and the implementation principle of the computer readable storage medium is similar to that of the workflow control method. The specific implementation manner of the computer readable storage medium can be referred to the foregoing embodiment of the workflow control method, and no longer be described here.
[0075] Based on the same inventive concept, the embodiments of the present application further provide a computer program product, and the implementation principle of the computer program product is similar to that of the workflow control method. The specific implementation manner of the computer program product can be referred to the foregoing embodiment of the workflow control method, and no longer be described here.
[0076] The computer readable storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the workflow control method according to any one of the foregoing embodiments.
[0077] The computer program product includes computer program codes. When the computer program codes are run on a computer, the computer program codes make the computer execute the workflow control method according to any one of the foregoing embodiments.
[0078] The application provides a workflow control method and device and electronic equipment, which first generates a workflow form of a target process instance, then determines a target field code corresponding to a target function button based on the workflow form in response to user operation on the target function button, determines a public operation logic corresponding to the target function button in a workflow component based on a first correspondence relationship between the field code and the public operation logic, and finally calls the workflow component to execute the public operation logic. The above method encapsulates the public operation logic in the workflow component and establishes a correspondence relationship between the function button and the public operation logic, so that different workflow forms can reuse the same business logic, and when the public business logic needs to be modified, the modification can take effect in all related forms only once in the workflow component, avoiding the tedious operation of modifying each workflow form one by one.
[0079] Those skilled in the art will understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code.
[0080] The present application is described with reference to flowcharts and / or block diagrams according to the methods, devices (systems), and computer program products of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus produce a device that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one or more flows and / or blocks. Figure 1 The functions specified in one or more flows and / or blocks.
[0081] These computer program instructions can also be stored in a computer-readable memory that can direct the computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including instruction devices that implement the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one or more flows and / or blocks. Figure 1 The functions specified in one or more flows and / or blocks.
[0082] These computer program instructions can also be loaded into a computer or other programmable data processing devices, so that a series of operational steps are performed on the computer or other programmable data processing devices to generate computer-implemented processes, thus the instructions executed on the computer or other programmable data processing devices provide processes for implementing the functions specified in the flowchart Figure 1 one or more flows and / or blocks Figure 1 one or more blocks or steps of the functions specified in the flowchart
[0083] Obviously, those skilled in the art can make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application belong to the scope of the claims of the present application and their equivalent technologies, the present application also intends to include these modifications and variations.
Claims
1. A workflow control method, characterized in that, include: In response to the user's selection of at least one function button in the business module, generate a workflow form for the target process instance; In response to the user's operation on the target function button on the workflow form, if the target function button is determined to be a public function button, the target field code corresponding to the target function button is determined based on the first correspondence between public function buttons and field codes, wherein the public function button is a function button that exists in all business modules; Based on the second correspondence between field codes and common operation logic and the target field code, the common operation logic corresponding to the target function button is determined; If it is determined that there is an associated customized operation logic in the common operation logic, the workflow component is invoked to execute the common operation logic and the customized operation logic, wherein the common operation logic and the customized operation logic are encapsulated in the workflow component.
2. The method according to claim 1, characterized in that, The process of generating a workflow form for the target process instance in response to user-selected operation of at least one function button in the business module includes: For each of the at least one function button, the field code corresponding to the function button is determined based on the first correspondence or the third correspondence between the function button and the field code; Based on the determined field encoding, form configuration information is generated, and the generated form configuration information is used as the workflow form.
3. The method according to claim 1, characterized in that, The customized operation logic includes a first customized operation logic and / or a second customized operation logic. The step of invoking the workflow component to execute the common operation logic and the customized operation logic includes: If the customized operation logic includes a first customized operation logic, the first customized operation logic is executed before the common operation logic is executed. If the customized operation logic includes a second customized operation logic, the second customized operation logic is executed after the common operation logic is executed. In the case where the customized operation logic includes a first customized operation logic and a second customized operation logic, the first customized operation logic is executed before the common operation logic is executed, and the second customized operation logic is executed after the common operation logic is executed.
4. The method according to claim 3, characterized in that, Before executing the common operation logic, the following is also included: During the execution of the first customized operation logic, the first return value of the first customized operation logic is detected; If the first return value is the first asynchronous identifier, then the first customized operation logic is determined to be an asynchronous operation; If the first return value is the first completion identifier, then the first customized operation logic is determined to be a synchronous operation.
5. The method according to claim 4, characterized in that, Before executing the second customized operation logic, the following is also included: During the execution of the common operation logic, the second return value of the common operation logic is detected; If the second return value is the second asynchronous identifier, then the common operation logic is determined to be an asynchronous operation; If the second return value is the second completion identifier, then the common operation logic is determined to be a synchronous operation.
6. The method according to any one of claims 3 to 5, characterized in that, Both the first customized operation logic and the second customized operation logic are hook functions.
7. A workflow control device, characterized in that, include: The form generation module is used to generate a workflow form for the target process instance in response to the user's selection of at least one function button in the business module. The processing module is used to respond to the user's operation on the target function button on the workflow form. If the target function button is determined to be a common function button, the module determines the target field code corresponding to the target function button based on the first correspondence between common function buttons and field codes, wherein the common function button is a function button that exists in all business modules; and determines the common operation logic corresponding to the target function button based on the second correspondence between field codes and common operation logic and the target field code. A workflow component is used to execute the common operation logic and the customized operation logic when it is determined that there is an associated customized operation logic; and to encapsulate the common operation logic and the customized operation logic.
8. The apparatus according to claim 7, characterized in that, The form generation module is specifically used for: For each of the at least one function button, the field code corresponding to the function button is determined based on the first correspondence or the third correspondence between the function button and the field code; Based on the determined field encoding, form configuration information is generated, and the generated form configuration information is used as the workflow form.
9. The apparatus according to claim 7, characterized in that, The customized operation logic includes a first customized operation logic and / or a second customized operation logic, and the workflow component is specifically used for: If the customized operation logic includes a first customized operation logic, the first customized operation logic is executed before the common operation logic is executed. If the customized operation logic includes a second customized operation logic, the second customized operation logic is executed after the common operation logic is executed. In the case where the customized operation logic includes a first customized operation logic and a second customized operation logic, the first customized operation logic is executed before the common operation logic is executed, and the second customized operation logic is executed after the common operation logic is executed.
10. The apparatus according to claim 9, characterized in that, Before executing the common operation logic, the workflow component is also used to: During the execution of the first customized operation logic, the first return value of the first customized operation logic is detected; If the first return value is the first asynchronous identifier, then the first customized operation logic is determined to be an asynchronous operation; If the first return value is the first completion identifier, then the first customized operation logic is determined to be a synchronous operation.
11. The apparatus according to claim 10, characterized in that, Before executing the second customized operation logic, the workflow component is also used to: During the execution of the common operation logic, the second return value of the common operation logic is detected; If the second return value is the second asynchronous identifier, then the common operation logic is determined to be an asynchronous operation; If the second return value is the second completion identifier, then the common operation logic is determined to be a synchronous operation.
12. The apparatus according to any one of claims 9 to 11, characterized in that, Both the first customized operation logic and the second customized operation logic are hook functions.
13. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor is configured to invoke program instructions stored in the memory and execute the steps of the method according to any one of claims 1-6 according to the obtained program instructions; A display used to respond to user actions.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a computer, cause the computer to perform the method as described in any one of claims 1-6.
15. A computer program product, characterized in that, The computer program product includes: computer program code, which, when run on a computer, causes the computer to perform the method described in any one of claims 1-6.