Method and system for distributing and publishing authority of workflow
Through multi-layer nested loop traversal of automation tools and Python scripts, the problem of low efficiency in workflow permission allocation is solved, automatic permission allocation and release of workflow nodes is realized, efficiency and accuracy are improved, and the management process is simplified.
Patent Information
- Application Number
- CN202410721768.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2024-09-20
AI Technical Summary
When faced with a large number of modules, entities and workflow nodes, existing workflow permission allocation technology has low efficiency and poor accuracy in permission allocation, and lacks automated solutions, resulting in cumbersome and inefficient manual operations.
Automation tools are used to obtain the permission configuration information of business modules, entities and workflow nodes through multi-layer nested loop traversal and specific positioning methods to achieve automated permission allocation and release. The Playwright library and the Python script of the Pytest testing framework are used for interactive operations.
It realizes the automated allocation of workflow node permissions, improves operational accuracy and efficiency, reduces manual errors, significantly improves the efficiency of workflow publishing and permission allocation, and simplifies the management process.
Smart Images

Figure CN118673516A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of workflow authority management, and in particular to a workflow authority allocation and publishing method and system. Background Art
[0002] Workflow is a common business form on web pages. It organizes a series of work task flows according to specific rules to complete a specific business process or workflow. Workflow can involve the collaborative work of multiple participants, multiple links, and multiple systems to complete a task or business. In the microservice architecture, multiple modules coexist, and each module contains multiple entities, and each entity contains multiple workflows. This has become a common application scenario.
[0003] However, one of the major challenges facing current workflow management is the efficiency of node permission allocation. Existing workflow permission allocation technologies, such as workflow-related configuration schemes or permission inheritance, have met the needs of permission management to a certain extent, but these technologies do not involve automatic allocation of permissions to each node in the workflow, and fail to solve the problem of fast and accurate allocation of permissions to all workflow nodes when there are many workflows.
[0004] In addition, the traditional workflow publishing method also has certain limitations. The traditional workflow publishing method mainly includes creating a target project, converting and publishing the target workflow to the target scheduling system. It mainly focuses on the release of workflows and the replacement of historical versions, but fails to achieve automatic allocation of workflow node permissions. When faced with a large number of modules, entities, and workflow nodes, relying on manual operations to allocate permissions is particularly cumbersome and inefficient. Summary of the invention
[0005] 1. Technical issues to be resolved
[0006] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides a method and system for allocating and publishing permissions of a workflow, which solves the technical problems of slow speed, poor accuracy and low automation in allocating and publishing permissions of a workflow.
[0007] (II) Technical solution
[0008] In order to achieve the above object, the main technical solutions adopted by the present invention include:
[0009] In a first aspect, an embodiment of the present invention provides a method for allocating and publishing permissions of a workflow, including:
[0010] Use automation tools to obtain the list of business module elements from the module configuration page of the web page;
[0011] Loop through each business module element in the business module element list, and locate a specific business module element to obtain an entity element list of each business module;
[0012] Perform a multi-layer nested loop traversal on each entity element in the entity element list, and obtain the permission configuration information of each participant by locating the text of the participant tab of the workflow in the entity element;
[0013] According to the permission configuration information and the participant permission information, corresponding permissions are assigned to each workflow node in each workflow, and the workflow is released after the permission assignment is completed.
[0014] Optionally, obtaining a list of business module elements from a module configuration page of a web page using an automated tool includes:
[0015] Control the module configuration page of the automation tool to open the web page;
[0016] Use XPath to locate the inline element tags with specific attribute values in the module configuration page to obtain the business module element list;
[0017] The automation tool is a Python script that includes the Playwright library and the Pytest testing framework.
[0018] Optionally, looping through each business module element in the business module element list and locating a specific business module element to obtain an entity element list of each business module includes:
[0019] Loop through each business module element in the business module element list, and control the automation tool to click on the business module elements one by one to obtain an entity list of each business module;
[0020] The business module elements with specific tag name values in the entity list are positioned by CSS to obtain the entity element list of each business module.
[0021] Optionally, a multi-layer nested loop is performed on each entity element in the entity element list, and the permission configuration information of each participant is obtained by text positioning on the participant tab of the workflow in the entity element, including:
[0022] Perform a first-level nested loop traversal on each entity element in the entity element list, and obtain a workflow element list for each entity by performing CSS positioning on specific entity elements;
[0023] Perform a nested second-level loop traversal on each workflow element in the workflow element list, and obtain a workflow node element list for each workflow by performing Xpath positioning on a specific workflow element;
[0024] A nested third-level loop traverses each workflow node element in the workflow node element list, and the permission configuration information of each participant is obtained by text positioning on the participant tab in the workflow node.
[0025] Optionally, each entity element in the entity element list is nested in a first-level loop traversal, and a workflow element list for each entity is obtained by performing CSS positioning on a specific entity element, including:
[0026] Performing a first-level nested loop traversal on each attribute element in the attribute element list, and controlling the automation tool to double-click the attribute elements one by one to obtain an attribute edit list of each attribute element;
[0027] Using text positioning to obtain the workflow interface list and workflow history version data from the entity edit list;
[0028] Perform CSS positioning on the workflow elements with specific tag name values in the workflow interface list to obtain a list of workflow elements for each entity.
[0029] Optionally, a nested second-level loop traversal is performed on each workflow element in the workflow element list, and by performing Xpath positioning on a specific workflow element, a workflow node element list of each workflow is obtained, including:
[0030] Perform a nested second-level loop traversal on each workflow element in the workflow element list, and control the automation tool to double-click the workflow elements one by one to obtain a workflow configuration page for each workflow;
[0031] Perform XPath positioning on the workflow elements with specific attribute values in the workflow configuration page to obtain a list of workflow node elements for each workflow.
[0032] Optionally, a nested third-level loop traversal is performed on each workflow node element in the workflow node element list, and the permission configuration information of each participant is obtained by text positioning on the participant tab in the workflow node, including:
[0033] Perform a nested third-level loop traversal on each workflow node element in the workflow node element list, and control the automation tool to double-click the workflow node elements one by one to obtain a workflow node configuration page for each workflow node;
[0034] The participant tabs in the workflow node are text-located to obtain the permission configuration information of each workflow node.
[0035] Optionally, assigning corresponding permissions to each workflow node in each workflow according to the permission configuration information and the participant permission information, and publishing the workflow after the permission assignment is completed includes:
[0036] According to the permission configuration information and the participant permission information, determine whether the participant permissions of the workflow node have been fully assigned;
[0037] In the case that the participant rights of the workflow node are not fully assigned, the corresponding rights are assigned to the workflow node based on the participant rights information and combined with text positioning;
[0038] After traversing the permission assignment work of the workflow nodes in the workflow, the control automation tool publishes the workflow.
[0039] Optionally, after assigning corresponding permissions to each workflow node in each workflow according to the permission configuration information and the participant permission information, and publishing the workflow after the permission assignment is completed, the method further includes:
[0040] Based on the workflow historical version data, obtain the page number of the workflow element list;
[0041] When the number of pages in the workflow element list is greater than 1, the workflow section authority allocation and workflow publishing work are performed on the workflows in each page of the workflow element list;
[0042] Control the automation tool to return from the current workflow element list to the attribute element list, and obtain the page number of the attribute element list;
[0043] When the page number of the entity element list is greater than 1, the control automation tool opens the workflow element list of all entities in each page in turn, and performs workflow section authority allocation and workflow publishing work on the workflows in the list of all workflow elements corresponding to each entity.
[0044] In a second aspect, an embodiment of the present invention provides a system for allocating and publishing permissions for a workflow, including:
[0045] Automation tools for performing interactive operations on web pages;
[0046] A controller connected to the automation tool, used to execute the permission allocation and release method of the workflow as described in claims 1-9;
[0047] The automation work is a Python script that includes the Playwright library and the Pytest testing framework.
[0048] (III) Beneficial effects
[0049] The beneficial effects of the present invention are: due to the use of multi-layer nested loop traversal logic, the present invention realizes the loop traversal operation of all business modules, entities, workflows and workflow nodes in the module configuration page, and can assign permissions to workflow nodes. In this process, for different page elements, the present invention adopts a specific positioning method and realizes interactive operations through automated tools. Compared with the prior art, this innovative method brings the following beneficial effects:
[0050] Firstly, the present invention realizes the automatic allocation of workflow node permissions: the present invention realizes the automatic allocation of workflow node permissions, reduces the involvement of manual operations, and improves the accuracy and efficiency of operations.
[0051] Secondly, by comprehensively looping through all business modules, entities and workflows, the present invention achieves complete coverage of authority allocation, which ensures that each workflow node is correctly assigned authority, improves fault tolerance, reduces the possibility of errors in human operations, and makes operations more stable and reliable.
[0052] Furthermore, the present invention utilizes automated tools for interactive operations, which significantly improves work efficiency. This automated processing method saves manpower and time costs, making the workflow publishing and authority allocation process more efficient and faster.
[0053] Finally, in addition to optimizing the permission allocation process, the present invention also realizes the automatic publishing function of the workflow. Further innovation further simplifies the workflow management process and improves management efficiency. Through automated publishing, the need for manual intervention is reduced, ensuring that the workflow can be deployed to the production environment in a timely and accurate manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 A flowchart of a method for allocating and publishing permissions for a workflow provided by an embodiment of the present invention;
[0055] Figure 2 A workflow diagram of a method for allocating and publishing permissions for a workflow provided by an embodiment of the present invention;
[0056] Figure 3 A schematic diagram of a service module element list provided in an embodiment of the present invention;
[0057] Figure 4 A schematic diagram of a list of entity elements provided by an embodiment of the present invention;
[0058] Figure 5 A schematic diagram of a workflow element list provided by an embodiment of the present invention;
[0059] Figure 6A schematic diagram of a workflow node element list provided by an embodiment of the present invention;
[0060] Figure 7 A schematic diagram of a workflow node configuration page provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0061] In order to better explain the present invention and facilitate understanding, the present invention is described in detail below through specific implementation modes in conjunction with the accompanying drawings.
[0062] refer to Figure 1 As shown, a method for assigning and publishing permissions for a workflow proposed in an embodiment of the present invention includes: first, using an automated tool to obtain a list of business module elements from a module configuration page of a web page. Secondly, looping through each business module element in the list of business module elements, and locating a specific business module element to obtain a list of entity elements for each business module. Next, performing a multi-layer nested loop traversal on each entity element in the list of entity elements, and locating the text of the participant tab of the workflow in the entity element to obtain the permission configuration information of each participant. Finally, assigning corresponding permissions to each workflow node in each workflow according to the permission configuration information and the participant permission information, and publishing the workflow after the permission assignment is completed.
[0063] The present invention adopts multi-layer nested loop traversal logic, realizes the loop traversal operation of all business modules, entities, workflows and workflow nodes in the module configuration page, and can assign permissions to workflow nodes. In this process, the present invention adopts a specific positioning method for different page elements and realizes interactive operations through automated tools. Compared with the prior art, this innovative method brings the following beneficial effects:
[0064] Firstly, the present invention realizes the automatic allocation of workflow node permissions: the present invention realizes the automatic allocation of workflow node permissions, reduces the involvement of manual operations, and improves the accuracy and efficiency of operations.
[0065] Secondly, by comprehensively looping through all business modules, entities and workflows, the present invention achieves complete coverage of authority allocation, which ensures that each workflow node is correctly assigned authority, improves fault tolerance, reduces the possibility of errors in human operations, and makes operations more stable and reliable.
[0066] Furthermore, the present invention utilizes automated tools for interactive operations, which significantly improves work efficiency. This automated processing method saves manpower and time costs, making the workflow publishing and authority allocation process more efficient and faster.
[0067] Finally, in addition to optimizing the permission allocation process, the present invention also realizes the automatic publishing function of the workflow. Further innovation further simplifies the workflow management process and improves management efficiency. Through automated publishing, the need for manual intervention is reduced, ensuring that the workflow can be deployed to the production environment in a timely and accurate manner.
[0068] In order to better understand the above technical solution, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a clearer and more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
[0069] Specifically, an embodiment of the present invention provides a method for allocating and publishing permissions of a workflow, including:
[0070] S1. Use an automated tool to obtain a list of business module elements from a module configuration page of a web page.
[0071] In one embodiment, the automation tool may use a Python script including the Playwright library and the Pytest test framework. That is, the Python script interacts with the web page and opens the module configuration page of the web page. The use of the automated Python script for interactive operations on the web page reduces the degree of involvement of manual operations in the web page and improves the timeliness, accuracy and fault tolerance of the authority allocation.
[0072] Further, step S1 includes:
[0073] S11. The control automation tool opens a module configuration page of a web page.
[0074] When the automation tool uses Python scripts, it first controls the Python script to start the web page through the Playwright library, and then controls the Python script to open the module configuration page of the web page. At the same time, the Playwright library provides a rich set of APIs (Application Programming Interface) for automated web page operations. These APIs cover multiple aspects such as web page startup, page navigation, element positioning, and interactive operations. Therefore, the Python script implements the required automation functions by calling the APIs in the Playwright library.
[0075] S12. Perform XPath positioning on inline element tags with specific attribute values in the module configuration page to obtain a business module element list.
[0076] In one embodiment, a Python script is used to obtain a list of elements starting with ec_module_Tree_ in the id attribute value of the span tag from the module configuration page using Xpath positioning as a business module element list, such as Figure 3 shown.
[0077] S2. Loop through each business module element in the business module element list, and locate a specific business module element to obtain an entity element list of each business module.
[0078] Further, step S2 includes:
[0079] S21. Loop through each business module element in the business module element list, and control the automation tool to click on the business module elements one by one to obtain an entity list of each business module.
[0080] In one embodiment, the outermost for loop traverses each business module element in the business module element list, and opens the entity list corresponding to each business module element by clicking the business module elements one by one through the control Python script. By comprehensively looping through all business modules, the complete coverage of the business module permission allocation is achieved, ensuring that the workflow of each entity in each business module is correctly assigned permissions, improving fault tolerance, reducing the possibility of errors in human operations, and making the operation more stable and reliable.
[0081] S22. Perform CSS positioning on the business module elements with a specific tag name value in the entity list to obtain a list of entity elements for each business module.
[0082] In one embodiment, a Python script is used to obtain a list of elements with a tag name value of undefinednameInternational from an entity list using CSS positioning as an entity element list, such as Figure 4 shown.
[0083] S3. Perform a multi-layer nested loop traversal on each entity element in the entity element list, and obtain the permission configuration information of each participant by text positioning on the participant tab of the workflow in the entity element.
[0084] Further, step S3 includes:
[0085] S31. Perform a nested first-level loop traversal on each entity element in the entity element list, and obtain a workflow element list for each entity by performing CSS positioning on specific entity elements. This step is specifically as follows: First, perform a nested first-level loop traversal on each entity element in the entity element list, and control the automation tool to double-click the entity elements one by one to obtain the entity editing list of each entity element. Then, use text positioning to obtain the workflow interface list and workflow history version data from the entity editing list. Finally. Perform CSS positioning on the workflow elements with specific tag name values in the workflow interface list to obtain a workflow element list for each entity.
[0086] In one embodiment, first, a nested first-level for loop is performed on each entity element in the entity element list, and each entity element is double-clicked one by one by controlling the Python script to open the entity edit list. By performing a nested first-level for loop traversal on all entities, complete coverage of permission allocation in the entity is achieved, ensuring that each workflow in each entity is correctly assigned permissions, improving fault tolerance, reducing the possibility of errors in human operations, and making operations more stable and reliable. Then, using the text positioning of the playwright library in the Python script, the workflow interface list and workflow history data are obtained from the entity edit list respectively. Finally, the Python script is used to obtain a list of all elements with a tag name value of undefinednameInternational from the workflow interface list using CSS positioning as a workflow element list, such as Figure 5 shown.
[0087] S32, perform a nested second-level loop traversal on each workflow element in the workflow element list, and obtain a workflow node element list for each workflow by performing Xpath positioning on a specific workflow element. This step is specifically as follows: first, perform a nested second-level loop traversal on each workflow element in the workflow element list, and control the automation tool to double-click the workflow elements one by one to obtain a workflow configuration page for each workflow. Then, perform Xpath positioning on the workflow elements with specific attribute values in the workflow configuration page to obtain a workflow node element list for each workflow.
[0088] In one embodiment, first, a nested second-level for loop is performed on each workflow element in the workflow element list, and each workflow element is double-clicked one by one by controlling the Python script to open the workflow configuration page. By performing a nested second-level for loop traversal on all workflows, complete coverage of the authority allocation of each workflow node in the workflow is achieved, ensuring that each workflow is correctly assigned authority, improving fault tolerance, reducing the possibility of errors in human operations, and making operations more stable and reliable. Then, a Python script is used to obtain a list of elements with data-element-id attribute values starting with TaskEvent from the workflow configuration page as a list of workflow node elements, such as Figure 6 shown.
[0089] S33, perform a nested third-level loop traversal on each workflow node element in the workflow node element list, and obtain the permission configuration information of each participant by text positioning on the participant tab in the workflow node. This step is specifically as follows: first, perform a nested third-level loop traversal on each workflow node element in the workflow node element list, and control the automation tool to double-click the workflow node elements one by one to obtain the workflow node configuration page of each workflow node. Then, perform text positioning on the participant tab in the workflow node to obtain the permission configuration information of each workflow node.
[0090] In one embodiment, first, a nested third-level for loop is performed on each workflow node element in the workflow node element list, and each workflow node element is double-clicked one by one through the Python script to open the workflow node configuration page. By performing a nested third-level for loop traversal on all workflows, complete coverage of workflow node permission allocation is achieved, ensuring that each workflow node is correctly assigned permissions, improving fault tolerance, reducing the possibility of errors in human operations, and making operations more stable and reliable. Then, by controlling the Python script to double-click each workflow node element one by one, the workflow node configuration page is opened, such as Figure 7 As shown. Secondly, the text positioning of the playwright library in the Python script is used to determine the participant tab in the workflow node from the workflow node configuration page. Finally, CSS positioning is used to obtain the permission configuration information of each participant in the participant tab.
[0091] S4. Assign corresponding permissions to each workflow node in each workflow according to the permission configuration information and the participant permission information, and publish the workflow after the permission assignment is completed.
[0092] Further, step S4 includes:
[0093] S41. Determine whether all participant permissions of the workflow node have been allocated based on the permission configuration information and the participant permission information.
[0094] S42: When the rights of the participants of the workflow node are not fully allocated, corresponding rights are allocated to the workflow node based on the participant rights information and in combination with text positioning.
[0095] S43. After traversing the authority allocation work of the workflow nodes in the workflow, control the automation tool to publish the workflow.
[0096] Furthermore, after step S4, the method further includes:
[0097] S51. Based on the workflow history version data, obtain the page number of the workflow element list.
[0098] S52: When the number of pages in the workflow element list is greater than 1, workflow section authority allocation and workflow publishing are performed on the workflows in each page of the workflow element list.
[0099] S53: Control the automation tool to return from the current workflow element list to the entity element list, and obtain the page number of the entity element list.
[0100] S54. When the page number of the entity element list is greater than 1, the control automation tool opens the workflow element list of all entities in each page in turn, and performs workflow section authority allocation and workflow publishing work on the workflows in the workflow element list corresponding to each entity.
[0101] In one embodiment, first, the page number of the workflow element list where the workflow history version is located is obtained; secondly, when the page number of the workflow element list is greater than 1, the Python script is controlled to click the page turning window in the workflow element list, and complete the workflow section authority allocation and workflow publishing work for the workflow in each page of the workflow element list; secondly, the Python script is controlled to click the window returning to the entity element list, so that the web page returns from the current workflow element list to the entity element list; then, the style attribute value in the entity element list is used to obtain the page number of the current entity element list; finally, when the page number of the entity element list is greater than 1, the Python script is controlled to click all entities in each page in turn to open the workflow element list corresponding to each entity, and perform workflow section authority allocation and workflow publishing work for the workflows in all opened workflow element lists.
[0102] On the other hand, the present invention also proposes a workflow authority allocation and publishing system, comprising:
[0103] Automation tools for performing interactive operations on web pages;
[0104] A controller connected to the automation tool, used to execute the permission allocation and release method of the workflow as described in claims 1-9;
[0105] The automation work is a Python script that includes the Playwright library and the Pytest testing framework.
[0106] In a specific embodiment, referring to Figure 2 As shown, the Python language is combined with the Playwright library and the Pytest test framework to realize the automatic allocation and release of permissions for manual activity nodes (workflow nodes) in the workflow configuration page through automated scripts. The specific process is as follows:
[0107] Step 1: Launch the web page using the Playwright library in the Python script and open the module configuration page.
[0108] Step 2: Use Python script to use Xpath positioning to obtain the element list starting with ec_module_Tree_ from the module configuration page with the id attribute value of the span tag as the business module element list (such as Figure 3 As shown), the outermost for loop traverses each business module element in the business module element list, and clicks each business module element one by one by controlling the Python script to open the entity list, where the entity list contains all entities corresponding to the business module.
[0109] Step 3: Use Python script to use CSS positioning to obtain the element list with the tag name value of undefinednameInternational from the entity list as the entity element list (such as Figure 4 As shown), the nested first-level for loop iterates over each attribute element in the attribute element list, and double-clicks each attribute element one by one to open the attribute edit list by controlling the Python script.
[0110] Step 4: Use the text positioning of the playwright library in the Python script to obtain the workflow interface list and workflow history version data from the entity edit list.
[0111] Step 5: Use Python script to obtain all elements with the tag name value of undefinednameInternational from the workflow interface list using CSS positioning as the workflow element list (such as Figure 5As shown), the nested second-level for loop iterates over each workflow element in the workflow element list, and double-clicks each workflow element one by one to open the workflow configuration page by controlling the Python script.
[0112] Step 6: Use Python script to obtain a list of all elements with data-element-id attribute values starting with TaskEvent from the workflow configuration page using Xpath positioning as a list of workflow node elements (such as Figure 6 As shown), that is, the list of manual activity control elements, the nested third-level for loop traverses each workflow node element in the workflow node element list, and controls the Python script to double-click each workflow node element one by one to open the workflow node configuration page (as shown Figure 7 shown).
[0113] Step 7: Use the text positioning of the playwright library in the Python script to determine the participant tab in the workflow node from the workflow node configuration page, and use CSS positioning to determine whether the participant to be assigned permissions in the participant tab has been assigned permissions. If permissions have been assigned, skip the permission assignment operation of this workflow node and continue to loop. If permissions have not been assigned, use the text positioning of the playwright library to assign operation permissions to the participants in the participant tab.
[0114] Step 8: After all workflow nodes are traversed, control the Python script to click the workflow publishing window to complete the workflow publishing.
[0115] Step 9: After the workflow of the current page is published, use the workflow history version data to obtain the page number in the current workflow element list. If the page number is greater than 1, control the Python script to click the page turning window in the workflow element list, and open the workflow configuration page of each workflow in each page of the workflow element list and repeat steps 6-8.
[0116] Step 10: When the workflow element list page is turned, control the Python script to click the window to return to the entity element list, so that the web page returns from the current workflow element list to the entity element list.
[0117] Step 11: Use the style attribute value in the entity element list to obtain the page number of the entity element list. If the page number is greater than 1, control the Python script to click the page turning window in the entity element list, and open the entity editing list of each entity in each page of the entity element list to repeat steps 4-9.
[0118] Step 12: When the entity element list is turned over, continue to execute the loop of step 2 until the loop ends, the permissions of workflows in all business modules are allocated, and all workflows are published.
[0119] In summary, the present invention provides a method and system for assigning and publishing permissions for a workflow. The method implements a loop traversal of all business modules, entities, workflows, and workflow nodes in a module configuration page through multi-layer nested loop traversal logic, and can assign permissions to workflow nodes. During the entire loop traversal process, different page elements are positioned using a positioning method including XPath, CSS, and text positioning; and a Python script including the Playwright library and the Pytest test framework is used to interact with the web page. The present invention reduces the degree of manual involvement in the allocation and release of workflow permissions, and improves the timeliness, accuracy, and fault tolerance of permission allocation. An automated permission allocation process that fully covers business modules, entities, and workflows is implemented to help users simplify operating procedures and improve work efficiency.
[0120] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may 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-ROM, optical storage, etc.) containing computer-usable program code.
[0121] The present invention is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present invention. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions.
[0122] It should be noted that in the claims, any reference numerals placed between brackets shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention may be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In the claims enumerating several means, several of these means may be embodied by the same hardware. The use of the words first, second, third, etc., is for convenience of expression only and does not indicate any order. These words may be understood as part of the component name.
[0123] In addition, it should be noted that, in the description of this specification, the description of the terms "one embodiment", "some embodiments", "embodiment", "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 invention. 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, unless they are contradictory.
[0124] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments after knowing the basic creative concept. Therefore, the claims should be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present invention.
[0125] Obviously, those skilled in the art can make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention should also include these modifications and variations.
Claims
1. A method for assigning and publishing permissions for a workflow, characterized in that: include: Use automation tools to obtain the list of business module elements from the module configuration page of the web page; Loop through each business module element in the business module element list, and locate a specific business module element to obtain an entity element list of each business module; Perform a multi-layer nested loop traversal on each entity element in the entity element list, and obtain the permission configuration information of each participant by locating the text of the participant tab of the workflow in the entity element; According to the permission configuration information and the participant permission information, corresponding permissions are assigned to each workflow node in each workflow, and the workflow is released after the permission assignment is completed.
2. The workflow authority allocation and publishing method according to claim 1, characterized in that: Using automated tools to obtain a list of business module elements from the module configuration page of a web page includes: Control the module configuration page of the automation tool to open the web page; Use XPath to locate the inline element tags with specific attribute values in the module configuration page to obtain the business module element list; The automation tool is a Python script that includes the Playwright library and the Pytest testing framework.
3. The workflow authority allocation and publishing method according to claim 1, characterized in that: Each business module element in the business module element list is traversed in a loop, and a specific business module element is located to obtain a list of entity elements of each business module, including: Loop through each business module element in the business module element list, and control the automation tool to click on the business module elements one by one to obtain an entity list of each business module; The business module elements with specific tag name values in the entity list are positioned by CSS to obtain the entity element list of each business module.
4. The workflow authority allocation and publishing method according to claim 1, characterized in that: Perform a multi-layer nested loop traversal on each entity element in the entity element list, and locate the text of the participant tab of the workflow in the entity element to obtain the permission configuration information of each participant, including: Perform a first-level nested loop traversal on each entity element in the entity element list, and obtain a workflow element list for each entity by performing CSS positioning on specific entity elements; Perform a nested second-level loop traversal on each workflow element in the workflow element list, and obtain a workflow node element list for each workflow by performing Xpath positioning on a specific workflow element; A nested third-level loop traverses each workflow node element in the workflow node element list, and the permission configuration information of each participant is obtained by text positioning on the participant tab in the workflow node.
5. The method for assigning and publishing permissions for a workflow according to claim 4, characterized in that: The first layer of nesting loop is traversed for each entity element in the entity element list, and by performing CSS positioning on specific entity elements, a workflow element list for each entity is obtained, including: Performing a first-level nested loop traversal on each attribute element in the attribute element list, and controlling the automation tool to double-click the attribute elements one by one to obtain an attribute edit list of each attribute element; Using text positioning to obtain the workflow interface list and workflow history version data from the entity edit list; Perform CSS positioning on the workflow elements with specific tag name values in the workflow interface list to obtain a list of workflow elements for each entity.
6. The method for assigning and publishing permissions for a workflow as claimed in claim 4, characterized in that: Perform a nested second-level loop traversal on each workflow element in the workflow element list, and locate the specific workflow element by Xpath, to obtain a workflow node element list for each workflow, including: Perform a nested second-level loop traversal on each workflow element in the workflow element list, and control the automation tool to double-click the workflow elements one by one to obtain a workflow configuration page for each workflow; Perform XPath positioning on the workflow elements with specific attribute values in the workflow configuration page to obtain a list of workflow node elements for each workflow.
7. The method for assigning and publishing permissions for a workflow as claimed in claim 4, characterized in that: Perform a nested third-level loop traversal on each workflow node element in the workflow node element list, and locate the text of the participant tab in the workflow node to obtain the permission configuration information of each participant, including: Perform a nested third-level loop traversal on each workflow node element in the workflow node element list, and control the automation tool to double-click the workflow node elements one by one to obtain a workflow node configuration page for each workflow node; The participant tabs in the workflow node are text-located to obtain the permission configuration information of each workflow node.
8. The workflow authority allocation and publishing method according to claim 1, characterized in that: According to the permission configuration information and the participant permission information, the corresponding permissions are assigned to each workflow node in each workflow. After the permission assignment is completed, the workflow is released, including: According to the permission configuration information and the participant permission information, determine whether the participant permissions of the workflow node have been fully assigned; In the case that the participant rights of the workflow node are not fully assigned, the corresponding rights are assigned to the workflow node based on the participant rights information and combined with text positioning; After traversing the permission assignment work of the workflow nodes in the workflow, the control automation tool publishes the workflow.
9. The workflow authority allocation and publishing method according to claim 1, characterized in that: According to the permission configuration information and the participant permission information, corresponding permissions are assigned to each workflow node in each workflow, and after the permission assignment is completed, the workflow is published, and the following is further included: Based on the workflow historical version data, obtain the page number of the workflow element list; When the number of pages in the workflow element list is greater than 1, the workflow section authority allocation and workflow publishing work are performed on the workflows in each page of the workflow element list; Control the automation tool to return from the current workflow element list to the attribute element list, and obtain the page number of the attribute element list; When the page number of the entity element list is greater than 1, the control automation tool opens the workflow element list of all entities in each page in turn, and performs workflow section authority allocation and workflow publishing work on the workflows in the workflow element list corresponding to each entity.
10. A workflow authority allocation and publishing system, characterized in that: include: Automation tools for performing interactive operations on web pages; A controller connected to the automation tool, used to execute the permission allocation and release method of the workflow as described in claims 1-9; The automation work is a Python script that includes the Playwright library and the Pytest testing framework.
