Disclosure of Invention
In view of this, embodiments of the present invention provide a dynamic flow generation method and apparatus, which can solve the problems of high cost and complex flow of a new online flow.
In order to achieve the above object, according to an aspect of the embodiments of the present invention, there is provided a dynamic flow generation method, including generating, by a predefined node, a predefined node list grouped based on application scenario categories; the predefined nodes are nodes which are created in advance according to the process engine specification and used for constructing the process; receiving a predefined node selected by a user according to the predefined node list, further forming a process, and generating a corresponding process number; and calling an interface of the flow engine to transmit the flow for deployment, generating a flow template based on the flow engine specification, and starting a corresponding workflow through the flow engine.
Optionally, the method further comprises:
the predefined nodes are generated in the process engine in advance in a buried number mode.
Optionally, receiving a predefined node selected by a user according to the predefined node list, and further forming a process, including:
receiving a predefined node selected by a user by inquiring the predefined node list and an adjusted predefined node sequence;
and forming a flow based on the generated starting node and the generated ending node.
Optionally, generating a corresponding flow number includes:
and sequentially combining the code value fields of the predefined nodes to generate corresponding process numbers.
Optionally, before the interface for calling the process engine is introduced into the process, the method includes:
initializing the routing condition of each predefined node in the process, and setting a predefined node return function and a multi-instance function;
and the routing condition of the last predefined node in the flow is 1, and the routing conditions of other predefined nodes are 0.
Optionally, the interface for calling the process engine is introduced into the process for deployment, and generates a process template based on the process engine specification, including:
calling an interface of a process engine to transmit the process, and generating a process template record based on a dynamic process template table;
and defining a process number and a node relation according to the dynamic process node definition table, and further generating a routing relation among the process nodes.
Optionally, the method further comprises:
and providing a RepositoryService service for calling to deploy the process.
In addition, the invention also provides a dynamic flow generation device, which comprises a setting module, a setting module and a control module, wherein the setting module is used for generating a predefined node list which is grouped based on the application scene category through predefined nodes; the predefined nodes are nodes which are created in advance according to the process engine specification and used for constructing the process;
the receiving module is used for receiving the predefined nodes selected by the user according to the predefined node list, further forming a process and generating corresponding process numbers;
and the processing module is used for calling an interface of the process engine to transmit the process to be deployed, generating a process template based on the process engine specification, and further starting a corresponding workflow through the process engine.
One embodiment of the above invention has the following advantages or benefits: because the method generates the predefined node list grouped based on the application scene category through the predefined nodes; the predefined nodes are nodes which are created in advance according to the process engine specification and used for constructing the process; receiving a predefined node selected by a user according to the predefined node list, further forming a process, and generating a corresponding process number; the technical means that the interface of the flow engine is called to transmit the flow to carry out deployment, a flow template based on the flow engine specification is generated, and then the corresponding workflow is started through the flow engine is adopted, so that the technical problems of high cost and complex flow of a new on-line flow in the prior art are solved, the dynamic change and immediate effect of the flow during operation are realized, an application program does not need to be updated, and the technical effect of service influence caused by shutdown is avoided.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a main flow of a dynamic flow generation method according to a first embodiment of the present invention, and as shown in fig. 1, the dynamic flow generation method includes:
step S101, through predefined nodes, generating a predefined node list grouped based on application scene categories.
The predefined nodes are nodes which are created in advance according to the process engine specification and used for constructing the process.
In some embodiments, the predefined nodes are pre-generated into the flow engine in a buried number manner. Wherein, the embedding number refers to providing an sql (structured query language) script to generate a predefined node data record.
Step S102, receiving the predefined nodes selected by the user according to the predefined node list, further forming a process, and generating corresponding process numbers.
In some embodiments, a user is received querying a list of predefined nodes to select a predefined node, and an adjusted order of the predefined nodes. And forming a flow based on the generated starting node and the generated ending node. In a further embodiment, the code value fields of the predefined nodes are combined in sequence to generate the corresponding flow numbers.
Step S103, an interface of the process engine is called to transfer the process to be deployed, a process template based on the process engine specification is generated, and then the corresponding workflow is started through the process engine.
In some embodiments, before the interface for invoking the flow engine is passed into the flow, the method comprises:
initializing the routing condition of each predefined node in the process, and setting a predefined node rollback function and a multi-instance function. And the routing condition of the last predefined node in the flow is 1, and the routing conditions of other predefined nodes are 0. The routing condition refers to a condition that the flow is transferred from one node to another node, therouting condition 1 represents that the flow is stopped, the flow is transferred from the current node to the end node, and therouting condition 0 represents that the flow is normally transferred to the next designated node according to the flow definition.
As another preferred embodiment, the interface for invoking the process engine passes the process into the process for deployment, comprising:
and calling an interface of the flow engine to transmit the flow, and generating a flow template record based on the dynamic flow template table. And defining a process number and a node relation according to the dynamic process node definition table, and further generating a routing relation among the process nodes.
It is worth noting that a reposoryservice service is provided for invocation to deploy the process. Wherein, the reproducibility service provides a series of APIs (interfaces) for managing the process deployment and process definition.
In summary, the dynamic process generation method of the present invention can avoid the problem of expensive cost in the production operation and maintenance process, once the process needs to be adjusted, the process needs to be newly designed, then deployed, tested and the version is on-line. Moreover, the invention realizes the dynamic adjustment of the process in the program operation, and the business personnel directly drag and arrange the process on the interface according to the predefined nodes through a group of predefined nodes, thereby designing a process meeting the business requirements, realizing what you see is what you get and taking effect instantly, and the whole process does not need to apply a new version for testing and deployment, thus having very high practical value.
Fig. 2 is a schematic structural diagram of a dynamic process generation method according to an embodiment of the present invention, and as shown in fig. 2, in node predefining, an sql script predefined by nodes, that is, a predefined node, may be generated by a script definition, that is, an sql script, where the predefined node refers to a group of nodes that are created in advance according to a process engine specification and are used to construct a process. The nodes can be grouped according to application scene types, so that dynamic processes suitable for various scenes are constructed in practical application. The page configuration is a predefined node list page, and a user can drag the predefined node definition to generate a process template, namely the process definition.
Preferably, the predefined nodes are generated in the process engine in advance mainly in a buried number mode.
It should be noted that, in order to distinguish the predefined node from the common link node in the process engine, three fields, namely, a predefined field flag, a class to which the predefined node belongs, and a predefined node code value field, are added in the link node definition table of the process engine. The node is a predefined node when the value of the predefined field flag is 1, and the node is a common flow link node when the value of the predefined field flag is 0 or null. And the class value of the predefined node cannot be null, otherwise, the predefined node is classified as default. The predefined node code value field is a two-bit character, which can be generally defined from 00-99, and the code value of the predefined node ensures that it is not repeated.
In some embodiments, the list of predefined nodes may be provided to the client operation, i.e., the user may perform queries, node orchestration, process naming, and permission settings for the predefined nodes. Wherein, the authority setting defines that each node formulates a handler or a candidate to process.
Preferably, a user flow template definition page may be provided, which queries all predefined node lists (i.e., predefined node queries) according to user requirements. The user selects corresponding predefined nodes according to the service requirement, and adjusts the sequence of the predefined nodes in a dragging mode, so that the sequential predefined nodes form a process (namely node arrangement).
The user may define a unique process template name (i.e., process name) for the process being orchestrated. The mode of sequentially combining the predefined node code value fields can be adopted, and each group of sequential nodes is ensured to have unique process numbers.
As an embodiment, as shown in fig. 3, taking a, B, C, D, E5 predefined nodes as an example, assuming that four nodes, i.e., ABDE, are selected to generate a dynamic flow, the start node and the end node of the flow are automatically generated by the system, JV ═ 0 and JV ═ 1 are both routing conditions of the corresponding routes, and these JV parameters are passed to the engine interface by the application when the flow engine task submission interface is called. By default each node proposes JV-0. When a certain condition is met and the current node needs to be ended, JV may be set to 1.
Each predefined node only supports the rollback function of the previous level, each predefined node supports multiple instances (for example, a rechecker R1 under the rechecked predefined node can provide for a rechecker R2 to recheck), and the rollback function between multiple instances (for example, a rollback R2 is provided for a rechecker R1 to recheck).
In addition, after the user lays out the predefined nodes on the interface, the interface of the flow engine needs to be called for deployment before the template is saved, and a flow template (i.e., flow definition) meeting the flow engine specification is generated. After deployment, the corresponding workflow may be launched via the flow engine (i.e., flow launch). Preferably, the flow definition in the flow engine can be performed by a flow designer. And, flow management may be performed on the flows in the flow engine. And the task submission refers to the completion of the node, and the flow can be transferred from the current node to the next node. The task query refers to a query of a proxy task or a processed task.
The present invention provides a RepositoryService service provisioning call to deploy dynamic processes. The specific deployment implementation process comprises the following steps:
calculating a flow number, judging whether a flow code exists, if so, not deploying, if not, calling an interface of a flow engine to transmit the flow, and generating a flow template record based on a dynamic flow template table. And defining a process number and a node relation according to the dynamic process node definition table, and further generating a routing relation among the process nodes. Thus, the dynamic deployment of the flow definition is completed. When calculating the process number, the calculation may be performed according to a specified rule, and the rule may be specified by a service parameter.
Fig. 4 is a schematic diagram of a main flow of a dynamic flow generation method according to a second embodiment of the present invention, and as shown in fig. 4, the dynamic flow generation method includes:
step S401, through the predefined nodes, generating a predefined node list grouped based on the application scene category.
The predefined nodes are nodes which are created in advance according to the process engine specification and used for constructing the process.
Step S402, receiving the predefined nodes selected by the user by inquiring the predefined node list and the adjusted predefined node sequence.
In step S403, a flow is further configured based on the generated start node and end node.
And S404, sequentially combining the code value fields of the predefined nodes to generate corresponding process numbers.
Step S405, initializing a routing condition of each predefined node in the process, and setting a predefined node fallback function and a multi-instance function.
And the routing condition of the last predefined node in the flow is 1, and the routing conditions of other predefined nodes are 0.
Step S406, an interface of the process engine is called to transfer the process, and a process template record is generated based on the dynamic process template table.
Step S407, defining the process number and the node relation according to the dynamic process node definition table, and further generating the routing relation among the process nodes.
Step S408, a corresponding workflow is started by the process engine.
In summary, the present invention predefines a set of process link nodes, so that a user can select and arrange nodes on a process template page, thereby generating a process template suitable for the business process, and an application can immediately create a corresponding process instance based on the process template (process definition). Therefore, compared with the common process which designs the business process definition in advance according to the process designer, the method and the system can better and flexibly meet the requirements of customers on business process processing under different business scenes, and have higher application value.
Fig. 5 is a schematic diagram of main blocks of a dynamic flow generation apparatus according to an embodiment of the present invention, and as shown in fig. 5, the dynamicflow generation apparatus 500 includes asetting module 501, a receivingmodule 502, and aprocessing module 503. Thesetting module 501 generates a predefined node list grouped based on application scene categories through predefined nodes. The predefined nodes are nodes which are created in advance according to the process engine specification and used for constructing the process. The receivingmodule 502 receives the predefined nodes selected by the user according to the predefined node list, further forms a process, and generates a corresponding process number. Theprocessing module 503 calls an interface of the process engine to transfer the process to the process for deployment, generates a process template based on the process engine specification, and then starts a corresponding workflow through the process engine.
Preferably, thesetting module 501 may generate the predefined node into the flow engine in advance by using a number-burying method.
In some embodiments, the receivingmodule 502 receives a predefined node selected by a user according to a predefined node list, thereby forming a process including:
receiving a predefined node selected by a user by inquiring the predefined node list and an adjusted predefined node sequence; and forming a flow based on the generated starting node and the generated ending node.
In a further embodiment, the receivingmodule 502 generates the corresponding flow number by sequentially combining the code value fields of the predefined nodes.
As another embodiment, before the interface of theprocessing module 503 calls the flow engine to transfer into the flow, the method includes:
initializing the routing condition of each predefined node in the process, and setting a predefined node return function and a multi-instance function; and the routing condition of the last predefined node in the flow is 1, and the routing conditions of other predefined nodes are 0.
In a further embodiment, theprocessing module 503 calls an interface of the process engine to transfer the process to the process for deployment, and generates a process template based on the process engine specification, including:
calling an interface of a process engine to transmit the process, and generating a process template record based on a dynamic process template table; and defining a process number and a node relation according to the dynamic process node definition table, and further generating a routing relation among the process nodes.
It is worth noting that a reposoryservice service is provided for invocation to deploy the process.
It should be noted that the dynamic flow generation method and the dynamic flow generation apparatus according to the present invention have corresponding relationships in the specific implementation contents, and therefore, the repeated contents are not described again.
Fig. 6 illustrates anexemplary system architecture 600 to which the dynamic flow generation method or apparatus of an embodiment of the present invention may be applied.
As shown in fig. 6, thesystem architecture 600 may includeterminal devices 601, 602, 603, anetwork 604, and aserver 605. Thenetwork 604 serves to provide a medium for communication links between theterminal devices 601, 602, 603 and theserver 605.Network 604 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use theterminal devices 601, 602, 603 to interact with theserver 605 via thenetwork 604 to receive or send messages or the like. Theterminal devices 601, 602, 603 may have installed thereon various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
Theterminal devices 601, 602, 603 may be various electronic devices having dynamic flow generating screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
Theserver 605 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using theterminal devices 601, 602, 603. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the dynamic flow generation method provided by the embodiment of the present invention is generally executed by theserver 605, and accordingly, the computing device is generally disposed in theserver 605.
It should be understood that the number of terminal devices, networks, and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 7, shown is a block diagram of acomputer system 700 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 7, thecomputer system 700 includes a Central Processing Unit (CPU)701, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from astorage section 708 into a Random Access Memory (RAM) 703. In theRAM 703, various programs and data necessary for the operation of thecomputer system 700 are also stored. TheCPU 701, theROM 702, and theRAM 703 are connected to each other via abus 704. An input/output (I/O)interface 705 is also connected tobus 704.
The following components are connected to the I/O interface 705: aninput portion 706 including a keyboard, a mouse, and the like; anoutput section 707 including components such as a Cathode Ray Tube (CRT), a liquid crystal dynamic flow generator (LCD), and the like, and a speaker; astorage section 708 including a hard disk and the like; and acommunication section 709 including a network interface card such as a LAN card, a modem, or the like. Thecommunication section 709 performs communication processing via a network such as the internet. Adrive 710 is also connected to the I/O interface 705 as needed. Aremovable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on thedrive 710 as necessary, so that a computer program read out therefrom is mounted into thestorage section 708 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through thecommunication section 709, and/or installed from theremovable medium 711. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 701.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a setup module, a receive module, and a processing module. Wherein the names of the modules do not in some cases constitute a limitation of the module itself.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include generating, by predefined nodes, a list of predefined nodes grouped based on application context categories; the predefined nodes are nodes which are created in advance according to the process engine specification and used for constructing the process; receiving a predefined node selected by a user according to the predefined node list, further forming a process, and generating a corresponding process number; and calling an interface of the flow engine to transmit the flow for deployment, generating a flow template based on the flow engine specification, and starting a corresponding workflow through the flow engine.
According to the technical scheme of the embodiment of the invention, the problems of high cost and complex flow of a new online process can be solved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.