Workflow execution method and device, electronic equipment and storage medium

By using hook functions to call dynamic code snippets in the workflow event listener, the problem of coupling between business logic and workflow nodes is solved, the hot deployment and external definition of business logic is realized, and the development efficiency is improved.

CN119512655APending Publication Date: 2025-02-25PEOPLE'S INSURANCE COMPANY OF CHINA
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411441734.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

In the prior art, business logic is coupled to the code of the workflow node, resulting in the need to modify the code and recompile and package when the requirements change, and the hot deployment of business logic cannot be realized.

Method used

By adding hook functions to the workflow's event listener, when the workflow flows to the process node and configures dynamic code snippets, the dynamic code snippets configured by the process node are injected through the hook function call in the event listener, and the corresponding business logic is implemented by executing the dynamic code snippets.

Benefits of technology

Decoupling business logic from workflow nodes, realizing external definition and hot deployment of business logic, reducing the complexity of business logic modification and improving workflow development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512655A_ABST
    Figure CN119512655A_ABST
Patent Text Reader

Abstract

The invention provides a workflow execution method and device, electronic equipment and a storage medium, and the method comprises the steps: responding to a condition that a first workflow flows to a first process node, and determining whether the first process node is configured with a dynamic code snippet or not; in response to the dynamic code snippets configured by the first process node, calling the first dynamic code snippets of the injection configuration through a hook function in an event monitor associated with the first process node; and implementing corresponding business logic by executing the first dynamic code snippet. According to the method, the business logic can be decoupled from the workflow node, external definition of the business logic is realized, hot deployment of the business logic is realized, and when requirements change, codes do not need to be modified and re-compiled and re-packaged, so that the complexity of business logic modification can be reduced, and the development efficiency of the workflow can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a workflow execution method, device, electronic device and storage medium. Background Art

[0002] Workflow can refer to the automation of part or all of a business process in a computer application environment. It is an abstract and general description of the business rules between the workflow and its various operation steps.

[0003] In related technologies, workflows can be visually constructed through graphical construction. Users can complete the definition of process nodes and the relationships between process nodes by dragging and dropping, and can embed business logic code in each process node to implement specific business functions. Summary of the invention

[0004] The present application aims to solve one of the technical problems in the related art at least to some extent.

[0005] To this end, the first purpose of the present application is to propose a workflow execution method to achieve hot deployment of business logic of process nodes.

[0006] The second objective of the present application is to provide a workflow execution device.

[0007] The third objective of the present application is to provide an electronic device.

[0008] A fourth objective of the present application is to provide a computer-readable storage medium.

[0009] A fifth object of the present application is to provide a computer program product.

[0010] To achieve the above-mentioned purpose, the first embodiment of the present application proposes a workflow execution method, including:

[0011] In response to the first workflow flowing to the first process node, determining whether the first process node is configured with a dynamic code snippet;

[0012] In response to the first process node being configured with a dynamic code snippet, calling the first dynamic code snippet injected with the configuration through a hook function in an event listener associated with the first process node;

[0013] The corresponding business logic is implemented by executing the first dynamic code snippet.

[0014] To achieve the above-mentioned purpose, the second embodiment of the present application proposes a workflow execution device, including:

[0015] A first determination module, configured to determine whether a dynamic code snippet is configured at a first process node in response to the first workflow flowing to the first process node;

[0016] A calling module, configured to call the first dynamic code snippet injected into the configuration through a hook function in an event listener associated with the first process node in response to the dynamic code snippet being configured in the first process node;

[0017] An execution module is used to implement corresponding business logic by executing the first dynamic code snippet.

[0018] To achieve the above-mentioned purpose, the third aspect of the present application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;

[0019] The memory stores computer-executable instructions;

[0020] The processor executes the computer-executable instructions stored in the memory to implement the method as described in the embodiment of the first aspect.

[0021] To achieve the above-mentioned purpose, the fourth aspect embodiment of the present application proposes a computer-readable storage medium, in which computer-readable storage medium is stored computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement the method described in the first aspect embodiment.

[0022] To achieve the above-mentioned purpose, the fifth aspect of the present application proposes a computer program product, including a computer program, which implements the method described in the first aspect when executed by a processor.

[0023] The workflow execution method, device, electronic device and storage medium provided by the present application, by adding a hook function in the event listener of the workflow, when the workflow flows to the process node and the dynamic code snippet is configured, the dynamic code snippet configured by injecting the process node is called through the hook function in the event listener, and the corresponding business logic is implemented by executing the dynamic code snippet. In this way, the business logic can be decoupled from the workflow node, the externalized definition of the business logic can be realized, and the hot deployment of the business logic can be realized. When the demand changes, there is no need to modify the code and recompile and package, thereby reducing the complexity of business logic modification and improving the development efficiency of the workflow.

[0024] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0026] Figure 1 A flowchart of a workflow execution method provided in an embodiment of the present application;

[0027] Figure 2 A flowchart of another workflow execution method provided in an embodiment of the present application;

[0028] Figure 3 A flowchart of another workflow execution method provided in an embodiment of the present application;

[0029] Figure 4 A schematic diagram of the structure of a workflow execution device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0031] The workflow execution method and apparatus according to the embodiments of the present application are described below with reference to the accompanying drawings.

[0032] Figure 1 A flowchart of a workflow execution method provided in an embodiment of the present application.

[0033] In related technologies, workflows can be visually constructed through graphical construction. Users can complete the definition of process nodes and the relationships between process nodes by dragging and dropping, and can embed business logic code in each process node to implement specific business functions.

[0034] However, in this way, the business logic is coupled to the code of the workflow node. Once the requirements change, the code needs to be modified and recompiled, packaged and deployed, and hot deployment of the business logic cannot be achieved.

[0035] To address this problem, an embodiment of the present application provides a workflow execution method, which realizes hot deployment of business logic by decoupling business logic from process nodes. Exemplarily, the workflow execution method of the embodiment of the present application can be executed by a low-code platform. It should be noted that the workflow execution method of the embodiment of the present application can also be executed by other platforms or electronic devices, without limitation.

[0036] like Figure 1 As shown, the workflow execution method includes the following steps:

[0037] Step 101 : in response to a first workflow flowing to a first process node, determining whether a dynamic code snippet is configured in the first process node.

[0038] In the present application, a workflow may include multiple process nodes, and the workflow starts to flow from the first process node until it flows to the last process node, thereby completing the entire workflow.

[0039] In the present application, if the first workflow flows to the first process node, it can be determined whether the first process node is configured with a dynamic code snippet. The first process node can be any process node in the first workflow, and the dynamic code snippet can refer to a code snippet for implementing business logic.

[0040] Exemplarily, the workflow configuration information may be queried to determine whether the workflow configuration information indicates that the first process node is configured with a dynamic code snippet, and based on the indication information, whether the first process node is configured with a dynamic code snippet may be determined.

[0041] It should be noted that in the present application, some or all process nodes in the workflow may be configured with dynamic code snippets. In addition, a process node may be configured with one dynamic code snippet or multiple dynamic code snippets, which is not limited.

[0042] Step 102 : In response to the first process node being configured with a dynamic code snippet, the first dynamic code snippet injected into the configuration is called through a hook function in an event listener associated with the first process node.

[0043] In this application, a hook function can be added to the event listener of the workflow, and the hook function searches for the dynamic code snippet configured for the current process node. There can be various event listeners in the workflow, and a process node can have one or more event listeners, which is not limited.

[0044] If the first process node is configured with a dynamic code snippet, the first dynamic code snippet injected with the configuration may be called through a hook function in an event listener associated with the first process node.

[0045] Step 103: Implement corresponding business logic by executing the first dynamic code snippet.

[0046] In the present application, the corresponding business logic can be implemented by executing the first dynamic code snippet, thereby realizing the corresponding business function.

[0047] In the workflow execution method of the embodiment of the present application, the dynamic code snippet of the business logic can be searched and executed by the hook function, which is no longer strongly coupled with the event listener. The change of the business logic code is transformed into the change of the process node configuration, and the function is provided by the page, and there is no need to package and publish. Moreover, the hook function is still in the context of the event listener, and the processing ability of the process data such as process variables, handlers, etc. is not attenuated.

[0048] In the embodiment of the present application, by adding a hook function in the event listener of the workflow, when the workflow flows to the process node and the dynamic code snippet is configured, the dynamic code snippet configured by injecting the process node is called through the hook function in the event listener, and the corresponding business logic is realized by executing the dynamic code snippet. In this way, the business logic can be decoupled from the workflow node, the externalized definition of the business logic can be realized, and the hot deployment of the business logic can be realized. When the demand changes, there is no need to modify the code and recompile and package, thereby reducing the complexity of business logic modification and improving the development efficiency of the workflow.

[0049] Figure 2 A flowchart of another workflow execution method provided in an embodiment of the present application.

[0050] like Figure 2 As shown, the workflow execution method may include the following steps:

[0051] Step 201 : in response to a first workflow flowing to a first process node, obtaining configuration metadata of the first process node.

[0052] In the present application, a configuration metadata may be defined for each process node, and the configuration metadata may include dynamic code configuration indication information, and the dynamic code configuration indication information may be used to indicate whether the process node is configured with a dynamic code script fragment.

[0053] Exemplarily, the value of the field of the dynamic code configuration indication information can be used to indicate whether the dynamic code snippet is configured. For example, "0" indicates that the dynamic code snippet is not configured, and "1" indicates that the dynamic code snippet is configured. For another example, "00" indicates that the dynamic code snippet is not configured, and "01" indicates that the dynamic code snippet is configured.

[0054] If the first workflow flows to the first process node, the configuration metadata of the first process node may be obtained from the database.

[0055] Step 202: Acquire dynamic code configuration indication information by querying configuration metadata.

[0056] In the present application, dynamic code configuration indication information of the first process node can be obtained by querying the configuration metadata information, and the dynamic code configuration indication information can be used to indicate whether the first process node is configured with a dynamic code snippet.

[0057] Step 203: Determine whether the first process node is configured with a dynamic code snippet according to the dynamic code configuration indication information.

[0058] In the present application, if the dynamic code configuration indication information indicates that the first process node is configured with a dynamic code snippet, it can be determined that the first process node is configured with a dynamic code snippet; if the dynamic code configuration indication information indicates that the first process node is not configured with a dynamic code snippet, it can be determined that the first process node is not configured with a dynamic code snippet.

[0059] Step 204 , in response to the first process node being configured with a dynamic code snippet, the first dynamic code snippet injected with the configuration is called through a hook function in an event listener associated with the first process node.

[0060] Step 205: Implement corresponding business logic by executing the first dynamic code snippet.

[0061] In the present application, step 204-step 205 can be implemented in any of the embodiments of the present application, so they will not be described in detail here.

[0062] In an embodiment of the present application, dynamic code configuration indication information can be obtained from the configuration metadata of the process node to which the workflow is currently flowing, and then based on the dynamic code configuration indication information, it is determined whether the process node to which the workflow is currently flowing is configured with a dynamic code snippet, thereby improving the accuracy of the judgment.

[0063] Optionally, the process definition file of the first workflow can also be parsed to obtain the configuration information of each process node in the first workflow, and the configuration information of the first process node can be found from the configuration information of each process node, and the information on whether the first process node is configured with a dynamic code script fragment contained in the configuration information of the first process node can be used to determine whether the first process node is configured with a dynamic code fragment. Thus, based on the process node configuration information, it is determined whether the process node is configured with a dynamic code fragment, which improves the accuracy of the judgment and enriches the judgment method.

[0064] Optionally, the judgment result of whether the process node is configured with a dynamic code snippet determined based on the configuration metadata of the process node can be combined with the judgment result of whether the process node is configured with a dynamic code snippet determined based on the configuration information of the process node to determine the final judgment result, thereby improving the accuracy of the judgment.

[0065] For example, if the results of two judgments are that the process node is configured with a dynamic code snippet, it can be finally determined that the process node is configured with a dynamic code snippet. If the two judgment results are inconsistent, the judgment can be made again.

[0066] In the related art, since the business logic is coupled in the code of the workflow node, it is necessary to build a complete process environment to test the business logic, and it is impossible to perform isolated testing on the business logic of a single process node. Based on this, in one embodiment of the present application, after coding or modifying the dynamic code snippet of a single process node, a test framework that simulates the process context can be combined to implement unit testing of the business logic. Figure 3 To explain, Figure 3 A flowchart of another workflow execution method provided in an embodiment of the present application.

[0067] like Figure 3 As shown, the workflow execution method may further include the following steps:

[0068] Step 301, obtain the flow data of the second workflow, and simulate the construction process runtime environment according to the flow data.

[0069] Since the dynamic code snippet embedded in the process node generally involves operations on the data of the process node itself, if the written dynamic code snippet needs to be tested, the flow data of the existing second workflow can be obtained, and the build process runtime environment can be simulated based on the flow data.

[0070] The workflow flow data may include but is not limited to workflow control data, workflow related data, business data, etc.

[0071] Among them, workflow control data is used to describe and manage the execution status and related information of process instances and their activities, such as the status, execution time, executor, etc. of process instances; workflow-related data is the business application data that the workflow system relies on to carry out process flow, which may include business condition data, set timeout time, etc.; business data is the business object supported by the process flow, which contains actual business information related to the business process.

[0072] Exemplarily, virtual process instances, nodes, states, etc. can be created based on flow data to initialize a simulated process runtime environment. The simulated process runtime environment can be restored to a specific historical state, or the simulation can be started from the starting point of the workflow.

[0073] Step 302: Execute the first dynamic code snippet in the process runtime environment based on each user role information in the first workflow to test the first dynamic code snippet.

[0074] Taking the first dynamic code snippet as an example, the existing flow data of the second workflow can be obtained, and the construction process runtime environment is simulated according to the flow data, and the first dynamic code snippet is tested in the simulated construction process runtime environment.

[0075] Exemplarily, the first dynamic code snippet may be deployed or injected into the process runtime environment, and according to the test requirements, the system triggers a specific event or operation in the workflow to simulate user interaction or process flow.

[0076] Exemplarily, the process runtime environment can capture instructions such as return, print, log output, exception throwing, etc. in the dynamic code snippet, and is used to output the code running results to the front end to help users test the dynamic code snippet.

[0077] Therefore, the workflow context can be simulated based on the flow data of the existing workflow. Combined with the simulated workflow context, the business logic of a single process node in other workflows can be tested, thereby achieving isolated testing of the business logic of a single process node and improving the security of the test.

[0078] Since different user roles are usually involved in a workflow, different user roles may have different corresponding permissions. Therefore, in order to improve the accuracy of business logic testing, in this application, based on each user role information in the first workflow, the first dynamic code snippet can be executed in the process runtime environment to test the first dynamic code snippet. Different user role information corresponds to different user permissions.

[0079] Therefore, by simulating different operations on process nodes by users with different permissions in the process, dynamic code snippets can be tested under different permissions to ensure the comprehensiveness of the test and improve the accuracy of business logic testing.

[0080] In one embodiment of the present application, based on the above embodiment, multiple process nodes can reuse the same dynamic code snippet. For example, the dynamic code snippet is managed at the granularity of function method, and can be called in the process node by simply referencing the function method name. Therefore, a public function library can be maintained for each process node to call, without the need for repeated writing in multiple process nodes, thereby improving development efficiency.

[0081] Exemplarily, if the first workflow flows to the second process node, it can be determined whether the second process node is configured with a dynamic code snippet. If the second process node is configured with a dynamic code snippet, the first dynamic code snippet and the second dynamic code snippet injected can be called through a hook function in an event listener associated with the second process node, and the corresponding business logic can be implemented by respectively executing the first dynamic code snippet and the second dynamic code snippet.

[0082] It can be seen that the second process node and the first process node are both configured with the first dynamic code snippet, that is, the first dynamic code snippet is reused, thereby eliminating the need to repeatedly write the dynamic code snippet, thereby improving the development efficiency of the workflow.

[0083] In addition, the second process node is also configured with a second dynamic code snippet, so that the business function of the process node can be implemented by executing multiple dynamic code snippets, thereby improving the flexibility of business logic implementation.

[0084] In one embodiment of the present application, if the third process node to which the first workflow flows is bound is bound to an approval form, the form data of the approval form can be obtained, and the form data can be parsed to obtain the target form component and the data corresponding to the target form component contained in the form data, and then the data corresponding to the target form component is mapped to the corresponding column in the database table according to the predefined mapping relationship between the form component and the database table column name. Thus, for the process node bound to the approval form, automatic mapping can be supported according to the form component name and the database table column name.

[0085] This application can be combined with a low-code platform to provide code writing, testing, and publishing capabilities during the construction of workflow applications.

[0086] Among them, low-code platforms can provide standard applications such as process approval, reporting, data ledgers, and research. In the process of writing dynamic code snippets, you can use pre-made tool classes to call up the configuration and data of other workflows to simplify the configuration. Low-code platforms can provide the following types of tools.

[0087] (1) Database operation class

[0088] The low-code platform can manage data source connection information. If you need to operate the data source in the workflow, you can pass in the data source ID and the corresponding SQL. For adding, deleting, modifying, querying, etc., only one line of code is needed.

[0089] The process node can support binding approval forms, automatically mapping form component names with database table column names, and dumping with one click.

[0090] (2) Interface and script execution class

[0091] In order to dynamically request third-party data in the workflow process or dynamically transmit form data to a third party to connect business processes, the low-code platform can provide a remote HTTP request calling method. Users only need to simply encapsulate the request parameters and process the response results.

[0092] Some business scenarios may also require remote calls to Linux shell scripts or window batch scripts. The low-code platform provides a proxy server deployed remotely. The call can be completed by specifying the remote address and script path in the code.

[0093] (3) Platform application metadata acquisition class

[0094] The ledgers, reports, surveys and other applications provided by the low-code platform all have SQL configurations. To avoid repeated configuration, the low-code platform can use this type of configuration as application metadata and provide tool-based access, such as obtaining the query SQL displayed in the report or the permission control SQL for the ledger data, etc., which can be written in one place and used everywhere, simplifying code writing.

[0095] When the workflow runs to a process node where a dynamic code snippet is set, the hook function can call the injected dynamic code snippet and prepare the required process context, node information and other execution environment data for the execution code. The low-code platform can provide configurable basic capabilities for transactions, timeouts, etc. during the execution process.

[0096] In addition, the low-code platform can implement microservice deployment of the execution engine, upload the script as a function to the execution engine platform, and trigger execution when needed. Due to the decoupling of the execution engine and the process, dynamic expansion of services based on process usage is achieved.

[0097] In order to implement the above embodiments, the present application also proposes a workflow execution device.

[0098] Figure 4 A schematic diagram of the structure of a workflow execution device provided in an embodiment of the present application.

[0099] like Figure 4 As shown, the workflow execution device 400 includes:

[0100] A first determination module 410 is configured to determine whether a dynamic code snippet is configured at a first process node in response to the first workflow flowing to the first process node;

[0101] A calling module 420, configured to call the first dynamic code snippet injected into the configuration through a hook function in an event listener associated with the first process node in response to the dynamic code snippet being configured in the first process node;

[0102] The execution module 430 is used to implement the corresponding business logic by executing the first dynamic code snippet.

[0103] Furthermore, in a possible implementation of the embodiment of the present application, the first determining module 410 is configured to:

[0104] Obtaining configuration metadata of the first process node;

[0105] Obtaining dynamic code configuration indication information by querying the configuration metadata;

[0106] According to the dynamic code configuration indication information, it is determined whether the first process node is configured with a dynamic code snippet.

[0107] Furthermore, in a possible implementation of the embodiment of the present application, the first determining module 410 is configured to:

[0108] Parsing the process definition file of the first workflow to obtain configuration information of each process node in the first workflow;

[0109] Searching for the configuration information of the first process node from the configuration information of each process node;

[0110] According to the configuration information of the first process node, it is determined whether the first process node is configured with a dynamic code snippet.

[0111] Furthermore, in a possible implementation of the embodiment of the present application, the device may also include:

[0112] A first acquisition module, used to acquire the flow data of the second workflow;

[0113] A construction module, used to simulate the construction process runtime environment according to the flow data;

[0114] A testing module is used to execute the first dynamic code snippet in the process runtime environment based on each user role information in the first workflow to test the first dynamic code snippet.

[0115] Furthermore, in a possible implementation of the embodiment of the present application,

[0116] The first determination module 410 is further configured to determine whether a dynamic code snippet is configured at a second process node in response to the first workflow flowing to the second process node;

[0117] The calling module 420 is further configured to call the first dynamic code snippet and the second dynamic code snippet of the injection configuration through a hook function in an event listener associated with the second process node in response to the dynamic code snippet being configured in the second process node;

[0118] The execution module 430 is further configured to implement corresponding business logic by respectively executing the first dynamic code snippet and the second dynamic code snippet.

[0119] Furthermore, in a possible implementation of the embodiment of the present application, the device may also include:

[0120] A second acquisition module is used for acquiring form data of the approval form in response to the third process node to which the first workflow flows to be bound to the approval form;

[0121] A parsing module, used for parsing the form data to obtain a target form component contained in the form data and data corresponding to the target form component;

[0122] The storage module is used to map the data corresponding to the target form component to the corresponding column in the database table according to the predefined mapping relationship between the form component and the database table column name.

[0123] It should be noted that the above explanations of the workflow execution method embodiment are also applicable to the workflow execution device of this embodiment, and will not be repeated here.

[0124] In the embodiment of the present application, by adding a hook function in the event listener of the workflow, when the workflow flows to the process node and the dynamic code snippet is configured, the dynamic code snippet configured by injecting the process node is called through the hook function in the event listener, and the corresponding business logic is realized by executing the dynamic code snippet. In this way, the business logic can be decoupled from the workflow node, the externalized definition of the business logic can be realized, and the hot deployment of the business logic can be realized. When the demand changes, there is no need to modify the code and recompile and package, thereby reducing the complexity of business logic modification and improving the development efficiency of the workflow.

[0125] In order to implement the above embodiments, the present application also proposes an electronic device, comprising: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method provided by the above embodiments.

[0126] In order to implement the above embodiments, the present application also proposes a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the methods provided by the above embodiments.

[0127] In order to implement the above embodiments, the present application also proposes a computer program product, including a computer program, which implements the methods provided by the above embodiments when executed by a processor.

[0128] The collection, storage, use, processing, transmission, provision and disclosure of user personal information involved in this application are in compliance with relevant laws and regulations and do not violate public order and good morals.

[0129] It should be noted that personal information from users should be collected for legitimate and reasonable purposes and should not be shared or sold outside of these legitimate uses. In addition, such collection / sharing should be carried out after receiving the user's informed consent, including but not limited to notifying the user to read the user agreement / user notice and sign the agreement / authorization including authorization of relevant user information before the user uses the function. In addition, any necessary steps should be taken to protect and safeguard access to such personal information data and ensure that others who have access to personal information data comply with its privacy policy and procedures.

[0130] The present application is expected to provide an implementation scheme for users to selectively block the use or access of personal information data. That is, the present disclosure is expected to provide hardware and / or software to prevent or block access to such personal information data. Once the personal information data is no longer needed, the risk can be minimized by limiting data collection and deleting the data. In addition, when applicable, such personal information is de-identified to protect the privacy of the user.

[0131] In the description of the aforementioned embodiments, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0132] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0133] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0134] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0135] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0136] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0137] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0138] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A workflow execution method, characterized in that: The following steps are involved: In response to the first workflow flowing to the first process node, determining whether the first process node is configured with a dynamic code snippet; In response to the first process node being configured with a dynamic code snippet, calling the injected configured first dynamic code snippet through a hook function in an event listener associated with the first process node; The corresponding business logic is implemented by executing the first dynamic code snippet.

2. The method according to claim 1, characterized in that The determining whether the first process node is configured with a dynamic code snippet includes: Obtaining configuration metadata of the first process node; Obtaining dynamic code configuration indication information by querying the configuration metadata; According to the dynamic code configuration indication information, it is determined whether the first process node is configured with a dynamic code snippet.

3. The method according to claim 1, characterized in that The determining whether the first process node is configured with a dynamic code snippet includes: Parsing the process definition file of the first workflow to obtain configuration information of each process node in the first workflow; Searching for the configuration information of the first process node from the configuration information of each process node; According to the configuration information of the first process node, it is determined whether the first process node is configured with a dynamic code snippet.

4. The method according to claim 1, characterized in that Also includes: Obtaining the flow data of the second workflow; According to the flow data, simulate the build process runtime environment; Based on each user role information in the first workflow, the first dynamic code snippet is executed in the process runtime environment to test the first dynamic code snippet.

5. The method according to claim 1, characterized in that Also includes: In response to the first workflow flowing to a second process node, determining whether the second process node is configured with a dynamic code snippet; In response to the second process node being configured with a dynamic code snippet, calling the first dynamic code snippet and the second dynamic code snippet of the injection configuration through a hook function in an event listener associated with the second process node; The corresponding business logic is implemented by respectively executing the first dynamic code snippet and the second dynamic code snippet.

6. The method according to claim 1, characterized in that Also includes: In response to the third process node to which the first workflow flows is transferred being bound with an approval form, acquiring form data of the approval form; Parsing the form data to obtain a target form component contained in the form data and data corresponding to the target form component; According to the predefined mapping relationship between the form component and the database table column name, the data corresponding to the target form component is mapped to the corresponding column in the database table.

7. A workflow execution device, characterized in that: include: A first determination module, configured to determine whether a dynamic code snippet is configured at a first process node in response to the first workflow flowing to the first process node; A calling module, configured to call the first dynamic code snippet injected into the configuration through a hook function in an event listener associated with the first process node in response to the dynamic code snippet being configured in the first process node; An execution module is used to implement corresponding business logic by executing the first dynamic code snippet.

8. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.

10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.

Citation Information

Cited By

  • AI programming-oriented declarative workflow generation method and system, and AI programming-oriented declarative workflow execution method and system

    CN122111395A