Method and system for adding process approvers based on Activiti

By dynamically adding approvers during system processes execution, the problem of fixed configuration of process approvers in the existing technology is solved, and more flexible and efficient approval process management is achieved, and the complexity of system maintenance is reduced.

CN119250765BActive Publication Date: 2025-03-25FAIRYLANDS ENVIRONMENTAL SCI TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411775712.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-03-25
Estimated Expiration
2044-12-05

AI Technical Summary

Technical Problem

The existing technology has limitations when adding process approvers. The configuration of process approvers is fixed and it is difficult to dynamically adjust according to business needs, resulting in frequent modification and redeployment of process definitions, which increases maintenance complexity and reduces flexibility.

Method used

By dynamically adding approvers during system process execution, creating new user task nodes, and updating the egress flow collection of system process nodes, the new user task node becomes the source node of the egress flow, and dynamic management of approvers is realized.

Benefits of technology

It avoids rigid process design, improves the flexibility of the approval process, reduces system maintenance costs, improves the continuity of the process, supports multi-level approval processes, and is suitable for complex approval scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119250765B_ABST
    Figure CN119250765B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of computer technology, and specifically relates to a method and system for adding a process approver based on Activiti, including: creating a new user task node as a newly added approver node; calling the export flow set of the current system process node, and updating the source node of each export flow to the created new user task node; taking the current system process node as the starting point and the created new user task node as the end point, connecting and updating the system process to obtain an updated system process for adding approvers; based on the updated system process, automatically laying out the BPMN model, generating a flow chart, and storing it. By dynamically adding approvers when the system process is executed, the rigid design of the process is avoided, the flexibility of the approval process is improved, and there is no need to redesign and deploy the process definition, which reduces the system maintenance cost and complexity and improves the continuity of the process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer technology, and in particular relates to a method and system for adding process approvers based on Activiti. Background Art

[0002] In the current OA system, the Activiti process engine has been widely used in the automated management of business processes.

[0003] However, existing technologies also have certain limitations when adding process approvers. In existing processes, the configuration of process approvers is mostly fixed and is performed during the process definition phase. There is a lack of the ability to dynamically add approvers according to business needs, which leads to frequent modification and redeployment of process definitions, increasing maintenance complexity and reducing flexibility. In complex approval scenarios, existing workflow engines support multi-level approval processes, but it is difficult to flexibly add approvers during operation. When multiple roles and approval levels are involved, existing technologies are difficult to efficiently support flexible adjustments of approvers, affecting the continuity and efficiency of the approval process. Summary of the invention

[0004] The present invention provides a method and system for adding process approvers based on Activiti, which avoids the rigid design of the process and improves the flexibility of the approval process by dynamically adding approvers when the system process is executed, and does not require redesigning and deploying the process definition, thereby reducing the system maintenance cost and improving the continuity of the process. Moreover, through interface calls, users do not need to enter the background to manually modify the process definition, and dynamic management of approvers can be achieved, thereby reducing the complexity of system maintenance.

[0005] A method for adding process approvers based on Activiti, including:

[0006] Create a new user task node as a new approver node;

[0007] Call the export flow set of the current system process node, and update the source node of each export flow to the created new user task node;

[0008] Taking the current system process node as the starting point and the newly created user task node as the end point, connect and update the system process to obtain the updated system process for adding approvers;

[0009] Based on the updated system process, the BPMN model is automatically laid out, a flow chart is generated, and stored.

[0010] By dynamically adding approvers during system process execution, the rigid design of the process is avoided, the flexibility of the approval process is improved, and there is no need to redesign and deploy the process definition, which reduces the system maintenance cost and improves the continuity of the process. Through interface calls, users do not need to enter the background to manually modify the process definition to achieve dynamic management of approvers, reducing the complexity of system maintenance.

[0011] Furthermore, after creating a new user task node, the process also includes setting the user task node name and specifying a task assignor to determine the identification of the approval node and the attribution of approval responsibility.

[0012] Furthermore, after creating a new user task node, the step further includes adding the created new user task node to the system process object.

[0013] Furthermore, calling the export flow set of the current system process node and updating the source node of each export flow to the created new user task node includes:

[0014] Use the getOutgoingFlows() method to obtain all the outgoing flow connections of the current process node;

[0015] Traverse all the outgoing flow lines and remove them from the system flow;

[0016] Based on all the removed outgoing flow links, their source nodes are set to the created new user task nodes, and the updated links are re-added to the system flow.

[0017] Furthermore, based on the updated system process, the execute() method of BpmnAutoLayout is called to automatically layout the BPMN model.

[0018] Furthermore, when the flowchart is generated, the BaseDynamicSubProcessInjectUtil method is called to perform process injection on the system process elements and to generate and store the flowchart.

[0019] Furthermore, it also includes the addition of a multi-level approval process under the current system process node, including:

[0020] Create a first user task node, insert it between the current system process node and its exit flow, and use the first user task node as the task node of the first-level approver;

[0021] Create a second user task node, insert it between the first user task node and its exit flow, and use the second user task node as the task node of the second-level approver to build a multi-level approval process.

[0022] It can dynamically adjust the approver configuration according to real-time needs, support multi-level approval processes, ensure a smooth approval process, and is suitable for complex approval scenarios.

[0023] A system for adding a process approver based on Activiti, including:

[0024] The creation module is used to create a new user task node as a new approver node;

[0025] The processing module is used to call the export flow set of the current system process node, and update the source node of each export flow to the newly created user task node; with the current system process node as the starting point and the newly created user task node as the end point, connect and update the system process to obtain the updated system process of adding approvers;

[0026] The generation and storage module is used to automatically layout the BPMN model based on the updated system process, generate a flow chart, and store it.

[0027] An electronic device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the above method when executing the computer program.

[0028] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.

[0029] The beneficial effects of the present invention are:

[0030] The present invention avoids the rigid design of the process by dynamically adding approvers when the system process is executed, improves the flexibility of the approval process, and does not require redesigning and deploying the process definition, reducing the system maintenance cost and improving the continuity of the process. Through interface calls, users do not need to enter the background to manually modify the process definition, and can achieve dynamic management of approvers, reducing the complexity of system maintenance. It can dynamically adjust the approver configuration according to real-time needs, support multi-level approval processes, ensure smooth approval process, and is suitable for complex approval scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 is a flow chart of the present invention;

[0032] Figure 2 This is a schematic diagram of the system flow without adding user task nodes;

[0033] Figure 3 A schematic diagram of the system flow for adding a user task node;

[0034] Figure 4 A schematic diagram of the system flow for adding multiple user task nodes;

[0035] Figure 5 It is a structural schematic diagram of the device in the present invention;

[0036] Figure 6 A schematic diagram of a computer device. DETAILED DESCRIPTION

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

[0038] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement a device and / or practice a method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.

[0039] In addition, in the following description, specific details are provided to facilitate a thorough understanding of the examples, and a person of ordinary skill in the art can understand the specific meanings of the above terms in this application under specific circumstances.

[0040] Example 1

[0041] Figure 1 The following is a method for adding approvers to a process based on Activiti. By dynamically adding approvers when the system process is executed, the rigid design of the process is avoided, the flexibility of the approval process is improved, and there is no need to redesign and deploy the process definition, which reduces the system maintenance cost and improves the continuity of the process. Through interface calls, users do not need to enter the background to manually modify the process definition, and can achieve dynamic management of approvers, reducing the complexity of system maintenance. The specific steps include the following:

[0042] S1: Create a new user task node UserTask as a new approver node;

[0043] In this embodiment, after creating a new user task node UserTask, the ID, name and designated task assignee of the user task node are set to determine the identification of the approval node and the attribution of approval responsibility.

[0044] In this embodiment, after the creation of the new user task node UserTask is completed, the created new user task node UserTask is added to the system process process object.

[0045] S2: Call the export flow set of the current system flow node currentFlowElement, and update the source node of each export flow to the created new user task node UserTask;

[0046] S21: Use the getOutgoingFlows() method to obtain all the outgoing flow connections of the current flow node currentFlowElement;

[0047] S22: traverse all the export flow lines and remove them from the system process;

[0048] S23: Based on all the removed outgoing flow links, their source nodes are set to the created new user task node UserTask, and the updated links are re-added to the system process process.

[0049] S3: With the current system flow node currentFlowElement as the starting point and the newly created user task node UserTask as the end point, a new connection SequenceFlow is created to connect and update the system flow process to obtain the updated system flow process with added approvers;

[0050] S4: Based on the updated system process, the BPMN model is automatically laid out, a flow chart is generated, and stored.

[0051] S41: Call the execute() method of BpmnAutoLayout to automatically layout the BPMN model;

[0052] S42: Based on the BPMN model after automatic layout, the BaseDynamicSubProcessInjectUtil method is called to inject the system process elements into the process and generate and store the flowchart.

[0053] Figure 2 The diagram shown is a schematic diagram of a system flow in which no user task node is added between the current system flow node A and its outlet flow B; Figure 3 What is shown is a schematic diagram of a system flow in which a user task node C is added between the current system flow node A and its outlet flow B.

[0054] In this embodiment, a multi-level approval process is also added under the current system process node, including:

[0055] T1: Create the first user task node, insert it between the current system process node and its exit flow, and use the first user task node as the task node of the first-level approver;

[0056] T2: Create a second user task node, insert it between the first user task node and its exit flow, and use the second user task node as the task node of the second-level approver to build a multi-level approval process.

[0057] Figure 4 What is shown is a schematic diagram of a system flow in which a user task node C and a user task node D are added between the current system flow node A and its outlet flow B.

[0058] It should be noted that in actual applications, the number of approvers can be dynamically adjusted according to real-time needs to build a multi-level approval process.

[0059] Example 2

[0060] Based on the same design concept, Figure 5 As shown, this embodiment provides an Activiti-based process approver adding system, including a creation module, a processing module, and a generation and storage module.

[0061] Specifically, the creation module is used to create a new user task node as a new approver node;

[0062] Specifically, the processing module is used to call the export flow set of the current system process node, and update the source node of each export flow to the created new user task node; with the current system process node as the starting point and the created new user task node as the end point, connect and update the system process to obtain the updated system process for adding approvers;

[0063] Specifically, the generation and storage module is used to automatically layout the BPMN model based on the updated system process, generate a flow chart, and store it.

[0064] Example 3

[0065] Based on the same technical concept, the embodiment of the present application also provides a computer device, including a memory 1 and a processor 2, such as Figure 6As shown, the memory 1 stores a computer program, and the processor 2 implements any of the above-mentioned methods when executing the computer program.

[0066] Among them, the memory 1 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 1 can be an internal storage unit of the process approver adding system based on Activiti, such as a hard disk. In other embodiments, the memory 1 can also be an external storage device of the process approver adding system based on Activiti, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Further, the memory 1 can also include both the internal storage unit of the process approver adding system based on Activiti and an external storage device. The memory 1 can not only be used to store application software and various types of data installed in the process approver adding system based on Activiti, such as the code of the process approver adding system program based on Activiti, but also can be used to temporarily store data that has been output or is to be output.

[0067] In some embodiments, the processor 2 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip, and is used to run the program code stored in the memory 1 or process data, such as executing an Activiti-based process approver adding system program.

[0068] The disclosed embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to perform the steps of the method described in the above method embodiment. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0069] The computer program product of the application page content refresh method provided in the disclosed embodiment of the present invention includes a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the steps of the method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.

[0070] The disclosed embodiment of the present invention further provides a computer program, which implements any one of the methods of the aforementioned embodiments when executed by a processor. The computer program product can be implemented in hardware, software, or a combination thereof. In an optional embodiment, the computer program product is specifically embodied as a computer storage medium, and in another optional embodiment, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.

[0071] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.

[0072] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "plurality" refers to at least two.

[0073] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention 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 those skilled in the art to which the embodiments of the present invention belong.

[0074] It should be understood that the various parts of the present invention 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.

[0075] 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.

[0076] In addition, each functional unit in each embodiment of the present invention 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.

[0077] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0078] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" 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 invention. In this specification, the schematic representation of the above terms does 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.

[0079] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A method for adding process approvers based on Activiti, characterized in that: include: Create a new user task node as a new approver node; Call the export flow set of the current system process node, and update the source node of each export flow to the created new user task node; Taking the current system process node as the starting point and the newly created user task node as the end point, connect and update the system process to obtain the updated system process for adding approvers; Based on the updated system process, the BPMN model is automatically laid out, a flow chart is generated, and stored; The calling of the export flow set of the current system process node and updating the source node of each export flow to the created new user task node includes: Use the getOutgoingFlows() method to obtain all the outgoing flow lines of the current flow node currentFlowElement; Traverse all the outgoing flow lines and remove them from the system flow; Based on all the removed outgoing flow lines, set their source nodes to the created new user task nodes, and re-add the updated lines to the system process; It also includes the addition of multi-level approval processes under the current system process node, including: Create a first user task node, insert it between the current system process node and its exit flow, and use the first user task node as the task node of the first-level approver; Create a second user task node, insert it between the first user task node and its exit flow, and use the second user task node as the task node of the second-level approver to build a multi-level approval process.

2. According to the method for adding process approvers based on Activiti according to claim 1, it is characterized in that: After creating a new user task node, the user task node name and the designated task assignor are set to determine the identification of the approval node and the ownership of the approval responsibility.

3. According to the method for adding process approvers based on Activiti according to claim 1, it is characterized in that: After creating a new user task node, the method further includes adding the created new user task node to the system process object.

4. According to the method for adding process approvers based on Activiti according to claim 1, it is characterized in that: Based on the updated system process, the execute() method of BpmnAutoLayout is called to automatically layout the BPMN model.

5. According to the method for adding process approvers based on Activiti according to claim 1, it is characterized in that: When the flowchart is generated, the BaseDynamicSubProcessInjectUtil method is called to inject the system process elements into the process and generate and store the flowchart.

6. A system for the Activiti-based process approver adding method according to claim 1, characterized in that: include: The creation module is used to create a new user task node as a new approver node; A processing module, which is used to call the export flow set of the current system process node and update the source node of each export flow to the created new user task node; Taking the current system process node as the starting point and the newly created user task node as the end point, connect and update the system process to obtain the updated system process for adding approvers; The generation and storage module is used to automatically layout the BPMN model based on the updated system process, generate a flow chart, and store it.

7. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 5 when executing the computer program.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.