Method, device, equipment and medium for creating approval task based on graph structureTechnical Field
The invention relates to the field of workflow configuration, in particular to a method, a device, equipment and a medium for creating an approval task based on a graph structure.
Background
At present, in an approval process system used in the market, different approval processes are generally predefined in the system in advance for a user to select, so as to meet the requirements of different approval tasks corresponding to the different approval processes. However, the way of predefining the approval process has the following disadvantages in practical application:
1. different companies have different internal management specifications, and the approval processes based on the internal management specifications are definitely different from each other in a greater or lesser degree, for example, the same leave-for-application and the approval processes are different from each other, and at this time, the predefined approval processes cannot meet the different requirements of different companies for the same approval type.
2. Besides general approval processes, some companies also have unique approval processes related to the properties of the companies, and predefined approval processes cannot be defined in advance for the unique approval processes, so that personalized requirements during creation of the approval processes cannot be met.
3. For the requirements of differentiation or individuation of the approval process, a commonly adopted solution is that a development policy additionally develops a separate approval system for different requirements. This solution has the following problems: the developer needs to develop and maintain different approval systems at the same time, so that the development and maintenance cost is high, and the cost for the user to use the approval system is correspondingly increased; the process approval system is developed again if the requirement change occurs during the development period, so that the development period is prolonged, time and labor cost are wasted, and the efficiency is low.
Disclosure of Invention
In order to overcome the defects of the prior art, one of the purposes of the invention is to provide an approval task creating method based on a graph structure, which can realize dynamic and custom configuration of a task approval process, is simple in configuration method, can be rapidly put into use, and meets the requirements of differentiation and individuation of approval process tasks.
One of the purposes of the invention is realized by adopting the following technical scheme:
a method for creating an approval task based on a graph structure comprises the following steps:
obtaining a custom approval process, and representing the approval process by a graph structure;
storing the graph structure as an approval task creation template;
and calling the approval task creation template to create an approval task, and executing an approval process corresponding to the approval task.
Further, the steps of the custom approval process are as follows:
establishing the starting and ending of the examination and approval process and each process node passing through the middle of the examination and approval process;
and creating a jump relation of the process nodes on each process node, and setting information to be filled or confirmed by a user.
Further, the approval process is represented by a graph structure, and includes: sequentially representing the process nodes of the approval process as vertexes in a graph structure; the jumps among the flow nodes are represented as edges in a graph structure; information that needs to be filled in or confirmed by the user is represented as attribute information of the edge.
Further, after the approval task template is created, the approval process is dynamically modified according to the change of the requirement, and the approval steps of the modified approval process are stored by using a graph structure.
Further, the storage of the graph structure is completed by using a database storage and a file storage.
The second purpose of the present invention is to provide an approval task creation device based on a graph structure, which can realize the custom configuration of the task approval process, and the configuration method is simple, and can be quickly and instantly put into use.
The second purpose of the invention is realized by adopting the following technical scheme:
the examination and approval task creation method and device based on the graph structure comprise the following steps:
the diagram structure representation module is used for acquiring a custom approval process and representing the approval process as a diagram structure;
the template storage module is used for storing the graph structure as an approval task creation template;
and the approval task creating module is used for calling the approval task creating template to create an approval task and executing an approval process corresponding to the approval task.
Furthermore, the system also comprises an approval process definition module which is used for customizing the approval process.
It is a further object of the present invention to provide an electronic device for performing one of the above objects, comprising a processor, a storage medium, and a computer program stored in the storage medium, wherein the computer program, when executed by the processor, implements the above-mentioned approval task creation method based on a graph structure.
It is a fourth object of the present invention to provide a computer-readable storage medium storing one of the objects of the present invention, on which a computer program is stored, which, when executed by a processor, implements the above-described approval task creation method based on a graph structure.
Compared with the prior art, the invention has the beneficial effects that:
according to the invention, a specific approval process of an approval task is not required to be defined in advance, when the approval task template is used, the approval task template is created in real time according to the self-defined requirements, the approval process corresponding to the approval task template is stored by using a graph structure after the customized configuration of the approval process, and the approval process corresponding to the approval task can be normally used only by calling the approval task template when the approval task is created in real time, so that the requirements of different companies on the differentiation and individuation of the approval process tasks are met. The invention can also dynamically adjust the specific approval process of the approval task template according to the change of the requirement, has simple configuration method and avoids secondary development.
Drawings
FIG. 1 is a flow chart of an approval task creation method based on graph structure according to the present invention;
FIG. 2 is a block diagram showing the structure of an approval task creation means according to the graph structure of embodiment 2;
fig. 3 is a block diagram of the electronic apparatus of embodiment 3.
Detailed Description
The present invention will now be described in more detail with reference to the accompanying drawings, in which the description of the invention is given by way of illustration and not of limitation. The various embodiments may be combined with each other to form other embodiments not shown in the following description.
Example 1
The embodiment provides an approval task creating method based on a graph structure, and aims to solve the problem that a predefined approval process cannot meet individuation and differentiation requirements of an approval task.
According to the principle, the method for creating the approval task based on the graph structure is introduced, and as shown in fig. 1, the method for creating the approval task based on the graph structure specifically comprises the following steps:
obtaining a custom approval process, and representing the approval process by a graph structure;
storing the graph structure as an approval task creation template;
and calling the approval task creation template to create an approval task, and executing an approval process corresponding to the approval task.
In this embodiment, when an approval task needs to be created, an approval process can be predefined for each type of approval task according to actual requirements, each process node and jump relation of the predefined approval process are stored in a graph structure, the graph structure is stored as an approval task template, and when the system is used subsequently, the approval task template is called according to actual use requirements so as to create a specific approval task, and then the corresponding approval process can be directly executed.
Preferably, the steps of the customized approval process are as follows:
establishing the starting and ending of the examination and approval process and each process node passing through the middle of the examination and approval process;
and creating a jump relation of the process nodes on each process node, and setting information to be filled or confirmed by a user.
Preferably, the approval process is represented by a graph structure, and includes: sequentially representing the process nodes of the approval process as vertexes in a graph structure; the jumps among the flow nodes are represented as edges in a graph structure; and information to be filled in or confirmed by the user is represented as attribute information of the edge. The graph structure is a common data structure-graph, which is composed of a finite non-empty set of vertices and a set of edges between the vertices, and is common knowledge in the art, and is not described herein again. The invention adopts a graph structure to completely represent each process node of the whole examination and approval process and the jump relationship among the nodes, can meet the use requirement only by calling the corresponding examination and approval task template when actually creating the examination and approval task, and has flexible configuration and convenient use.
And when the approval task is used, selecting the approval task template, namely entering an approval process corresponding to the approval task.
In practical application, the specific operation steps of creating an approval task mentioned in this embodiment are as follows:
1. and clicking to create an approval task template in a background management system, and realizing the custom configuration of the approval process of the approval task template for subsequent use.
2. Clicking the add button creates the various process nodes that start, end, and pass in between in the approval process.
3. And clicking an adding button on each node to create the trend of each flow node from the starting position to the ending position, and determining the jump between the flow nodes.
4. And after the confirmation is correct, the click takes effect, and the practical construction is realized.
5. When the examination and approval task template is actually used, the examination and approval task creation is clicked, keywords are input into a search frame to search for the created examination and approval task template, the examination and approval task template is called, and the examination and approval task template can enter an examination and approval process corresponding to the examination and approval task template after selection and click determination, so that response of the examination and approval process is realized.
Preferably, after the approval task template is created, the approval process can be dynamically modified according to the change of the requirement, the modified approval process is stored by using a graph structure to form a new approval task template, and then the approval task can be normally created and the corresponding approval process can be executed only by normally calling the approval task template, so that the operation is convenient and secondary development is not needed.
Preferably, the graph structure is stored by using a database storage and a file storage, and the database storage can be implemented by mysql and derivative databases, mongodb and tiDB, but the storage is not limited to the above mentioned databases, and in other embodiments, other data can be used to implement the storage of the graph structure.
Example 2
Embodiment 2 discloses a device corresponding to the method for creating an approval task based on a graph structure according to embodiment 1, and as shown in fig. 2, the device includes:
the diagramstructure representation module 210 is configured to obtain a custom approval process, and represent the approval process as a diagram structure;
thetemplate storage module 220 is configured to store the graph structure as an approval task creation template;
the approvaltask creating module 230 is configured to invoke the approval task creating template to create an approval task, and execute an approval process corresponding to the approval task.
Preferably, an approval process definition module (not depicted in the figure) is further included for customizing the approval process.
Example 3
Fig. 3 is a schematic structural diagram of an electronic device according to embodiment 3 of the present invention, as shown in fig. 3, the electronic device includes aprocessor 310, amemory 320, aninput device 330, and anoutput device 340; the number of theprocessors 310 in the computer device may be one or more, and oneprocessor 310 is taken as an example in fig. 3; theprocessor 310, thememory 320, theinput device 330 and theoutput device 340 in the electronic apparatus may be connected by a bus or other means, and the connection by the bus is exemplified in fig. 3.
Thememory 320 is a computer-readable storage medium, and can be used for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the method for creating an approval task based on a graph structure according to the embodiment of the present invention (for example, the graphstructure representation module 210, thetemplate storage module 220, and the approvaltask creation module 230 in the apparatus for creating an approval task based on a graph structure). Theprocessor 310 executes various functional applications and data processing of the electronic device by executing software programs, instructions and modules stored in thememory 320, that is, implements the diagram structure-based approval task creation method of embodiment 1.
Thememory 320 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, thememory 320 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, thememory 320 may further include memory located remotely from theprocessor 310, which may be connected to the electronic device through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Theinput device 330 can input various process nodes and jump relationships of the approval process, etc. Theoutput device 340 is used for outputting and displaying the approval process corresponding to the approval task creation template.
Example 4
Embodiment 4 of the present invention further provides a storage medium containing computer-executable instructions, where the computer-executable instructions, when executed by a computer processor, are configured to implement a method for creating an approval task based on a graph structure, where the method includes:
obtaining a custom approval process, and representing the approval process by a graph structure;
storing the graph structure as an approval task creation template;
and calling the approval task creation template to create an approval task, and executing an approval process corresponding to the approval task.
Of course, the storage medium containing the computer-executable instructions provided by the embodiments of the present invention is not limited to the method operations described above, and may also perform related operations in the method for creating an approval task based on a graph structure provided by any embodiments of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes instructions for enabling an electronic device (which may be a mobile phone, a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the approval task creating device based on the graph structure, the included units and modules are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
Various other modifications and changes may be made by those skilled in the art based on the above-described technical solutions and concepts, and all such modifications and changes should fall within the scope of the claims of the present invention.