Disclosure of Invention
Based on this, the present invention provides a workflow engine system, an implementation method, a storage medium and a computer device, and aims to solve the technical problem in the prior art that a plurality of sub-services use their own workflow engine to process services under the application of a micro-service architecture, which results in a reduction in management efficiency.
A first aspect of the present invention provides a workflow engine system comprising:
the system comprises a plurality of independently deployed engine service sides, a plurality of independent deployed engine service sides and a plurality of workflow processing servers, wherein each engine service side is used for automatically creating form structure data and integrating role information in the form structure data to create a workflow;
the client adapter is used for calling the service interface of the workflow provided by the engine server and waiting for the feedback of a calling result by the engine server;
the registry is used for distributing the workflow to the client-side adapter according to a preset load strategy and a flow request;
in the workflow engine system, when the workflow is circulated, if a trigger event and a path condition judgment exist, the corresponding business application is informed to execute a corresponding event according to an application identifier bound when the workflow is created, and whether the workflow continues to be circulated or not is determined according to an execution result.
According to one aspect of the above technical solution, the engine server includes a metadata management unit, a role configuration unit, and a model management unit; wherein
The metadata management unit is used for automatically creating form structure data and updating the version of the form structure data after the form structure data is created;
the role configuration unit is used for acquiring organization personnel and role information and integrating the organization personnel and the role information into the form structure data;
the model management unit is used for designing and configuring the workflow through a graphic designer and publishing a model as a workflow definition to create the workflow.
According to one aspect of the above technical solution, the client adapter includes a service invocation unit and a feedback data management unit; wherein
The service calling unit is used for calling a service interface of a workflow provided by the engine service end so as to establish communication connection between a client and the engine service end;
the feedback data management unit is used for acquiring a service calling result and a communication connection result between the client adapter and the engine server.
According to one aspect of the above technical solution, the registry includes a flow request receiving unit and a workflow distributing unit; wherein
The flow request receiving unit is used for acquiring a flow request sent by the client and distributing the workflow through the workflow distributing unit based on a preset load strategy.
According to an aspect of the foregoing technical solution, the workflow engine system further includes a flow event triggering unit, specifically configured to:
judging whether a trigger event exists or not and judging a path condition in the circulation process of the workflow;
if yes, notifying the corresponding business application to execute the corresponding event according to the application identifier bound when the workflow is created, and determining whether the workflow continues to circulate according to an execution result.
According to an aspect of the above technical solution, in the workflow engine system:
after the whole flow circulation is completed, inquiring the information of the current workflow to be dealt with, and returning the inquiry result to the client;
and after the client application receives the result, writing the result data back into the database of the service connection for joint check of the subsequent application data and the information to be handled.
The second aspect of the present invention provides a method for implementing a workflow engine system, the method comprising:
creating form structure data through an engine server, and integrating role information in the form structure data to create a workflow;
calling a service interface of the workflow provided by the engine server through a client adapter, and acquiring a calling result of the service interface;
based on a registry, distributing the workflow to the client adapter according to a preset load strategy and a circulation request;
judging whether a trigger event exists or not and judging the path condition when the workflow circulates;
if yes, notifying the corresponding business application to execute the corresponding event according to the application identifier bound when the workflow is created, and determining whether the workflow continues to circulate according to an execution result.
According to one aspect of the above technical solution, the step of creating the form structure data through the engine server and integrating the role information in the form structure data to create the workflow specifically includes:
the method comprises the steps that automatic creation of form structure data is executed through a preset metadata management unit, and version updating is conducted on the form structure data after the form structure data are created;
acquiring organization personnel and role information through a preset role configuration unit, and integrating the organization personnel and the role information into the form structure data;
and designing and configuring the workflow based on a graphic designer through a preset model management unit, and publishing the model as a workflow definition to create the workflow.
A third aspect of the present invention is to provide a storage medium, on which computer instructions are stored, which instructions, when executed by a processor, implement the steps of the method of the above-mentioned solution.
A fourth aspect of the present invention provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method according to the above technical solution when executing the program.
Compared with the prior art, the workflow engine system, the implementation method, the storage medium and the computer equipment have the advantages that:
1) The table structure automatic creation and updating function in the invention can ensure the correctness of the table structure and data in the initial stage of engine deployment and subsequent iterative updating, and is convenient for operation and maintenance personnel to manage;
2) The client and the engine server are separately deployed, so that the difficulty in use under a micro-service architecture can be reduced, the invasion to business application is small, and the workload brought by integration is reduced;
3) The integrated role information in the invention can be quickly accessed to different third-party organizer structures on the premise of not modifying a program, thereby reducing the development workload brought by adaptation personnel.
Detailed Description
To facilitate an understanding of the invention, the invention will now be described more fully hereinafter with reference to the accompanying drawings. Several embodiments of the invention are shown in the drawings. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
Example one
Referring to fig. 1, a first embodiment of the present invention provides a workflow engine system, including: a plurality of independently deployedengine servers 10,client adapters 20,registries 30. The workflow engine system is developed based on standard BPMN2.0 specifications, and can be compatible with other workflow model files generated based on the specifications to be directly imported and used.
The workflow engine system shown in this embodiment mainly provides distributed workflow services for business applications in the form of micro services, so that business processing logic and business logic are decoupled, and unified management of business processes accessed to the engine is realized through the model management unit and the instance management unit, thereby really solving the problem that management is difficult when process data is scattered in each business service under the current micro service architecture, improving the operation efficiency of the business processes, and ensuring service availability by distributed deployment.
In this embodiment, each of theengine servers 10 is configured to perform automatic creation of form structure data, and integrate role information in the form structure data to create a workflow.
Eachengine server 10 is provided with a metadata management unit, a role configuration unit and a model management unit. The metadata management unit is used for automatically creating form structure data and updating the version of the form structure data after the form structure data is created; the role configuration unit is used for acquiring organization personnel and role information and integrating the organization personnel and the role information into the form structure data; the model management unit is used for designing and configuring the workflow through a graphic designer and publishing a model as a workflow definition to create the workflow.
Specifically, the metadata management unit is configured to automatically detect a connected database type and a metadata version during an engine starting process, automatically perform table building and data initialization operations according to the detected database type if a table structure required by the workflow engine does not exist in a data source, and automatically update the table structure if the detected versions are inconsistent.
Further, the role configuration unit is used for configuring organization, personnel and role information used in the workflow engine by using files, and inquiring a database or calling an external interface to obtain the information.
Furthermore, the model management unit is used for managing model information of all business processes accessed to the workflow engine, and then combining and configuring the process elements by using a graphic designer to finally form a model file to be embodied in the model management unit.
In this embodiment, theclient adapter 20 is configured to invoke a service interface of the workflow provided by theengine server 10, and the service interface is integrated into a business application that needs to use the workflow in a form of a plug-in, provide an interface needed for operating the workflow to the business application through the adapter, and wait for theengine server 10 to feed back a call result.
Specifically, theclient adapter 20 includes a service call unit and a feedback data management unit. The service calling unit is used for calling a service interface of a workflow provided by theengine server 10 so as to establish a communication connection between a client and theengine server 10; the feedback data management unit is configured to obtain a service invocation result and a communication connection result between the client adapter and theengine server 10.
In this embodiment, theregistry 30 is configured to distribute the workflow to the client adapter according to a preset load policy and a flow request.
Specifically, theregistry 30 includes a circulation request receiving unit and a workflow distributing unit; the flow request receiving unit is configured to obtain a flow request sent by the client, and distribute the workflow through the workflow distributing unit based on a preset load policy.
In this embodiment, in the workflow engine system, during a circulation process of the workflow, if a trigger event and a path condition exist for judgment, a corresponding service application is notified to execute a corresponding event according to an application identifier bound when the workflow is created, and whether the workflow continues to circulate is determined according to an execution result.
Specifically, the workflow engine further comprises a flow event triggering unit, during the workflow circulation process, different types of events can be triggered before and after specific operation, the client is informed of executing the events and returns execution results through a remote calling mode, and the event triggering unit executes subsequent circulation operation according to the feedback results.
Theengine server 10 further includes a flow decision unit, which notifies the service application to execute a corresponding condition and returns to execute, and the flow decision unit may determine whether to continue to execute the flow operation according to a return result.
In some embodiments of the present invention, theengine server 10 further includes a flow log recording unit, which is capable of recording a flow event, a flow type, an operator, an operation time, and an operation content in the workflow flow.
In some embodiments of the present invention, after the whole flow is completed, the current workflow information to be handled is queried, and the query result is returned to the client;
and after the client application receives the result, writing the result data back into the database of the service connection for joint check of the subsequent application data and the information to be handled.
Compared with the prior art, the workflow engine system shown in the embodiment has the advantages that:
1) The table structure automatic creation and updating function in the embodiment can ensure the correctness of the table structure and data in the initial stage and the subsequent iteration updating of engine deployment, and is convenient for operation and maintenance personnel to manage;
2) The client and the engine server in the embodiment are separately deployed, so that the difficulty in use under a micro-service architecture can be reduced, the intrusion on service application is small, and the workload caused by integration is reduced;
3) The integrated role information in the embodiment can be quickly accessed to different third-party organization personnel structures on the premise of not modifying the program, and the development workload brought by adaptation personnel is reduced.
Example two
Referring to fig. 2, a second embodiment of the present invention provides a method for implementing a workflow engine system, where the method includes steps S01-S05:
and S01, creating form structure data through an engine server, and integrating role information in the form structure data to create a workflow.
Each engine server is provided with a metadata management unit, a role configuration unit and a model management unit. The metadata management unit is used for automatically creating form structure data and updating the version of the form structure data after the form structure data is created; the role configuration unit is used for acquiring organization personnel and role information and integrating the organization personnel and the role information into the form structure data; the model management unit is used for designing and configuring the workflow through a graphic designer and publishing a model as a workflow definition to create the workflow.
Specifically, the metadata management unit is configured to automatically detect a connected database type and a metadata version during an engine starting process, automatically perform table building and data initialization operations according to the detected database type if a table structure required by the workflow engine does not exist in a data source, and automatically update the table structure if the detected versions are inconsistent.
Further, the role configuration unit is used for configuring organization, personnel and role information used in the workflow engine by using files, and inquiring a database or calling an external interface to obtain the information.
Furthermore, the model management unit is used for managing all the model information of the business process accessed to the workflow engine, and then combining and configuring the process elements by using a graphic designer to finally form a model file to be embodied in the model management unit.
Step S02, calling a service interface of the workflow provided by the engine server through a client adapter, and acquiring a calling result of the service interface;
specifically, the client adapter includes a service invocation unit and a feedback data management unit. The service calling unit is used for calling a service interface of a workflow provided by the engine service end so as to establish communication connection between a client and the engine service end; the feedback data management unit is used for acquiring a service calling result and a communication connection result between the client adapter and the engine server.
Step S03, based on the registry, distributing the workflow to the client adapter according to a preset load strategy and a flow request;
specifically, the registration center comprises a circulation request receiving unit and a workflow distributing unit;
the flow request receiving unit is configured to obtain a flow request sent by the client, and distribute the workflow through the workflow distributing unit based on a preset load policy.
Step S04, judging whether a triggering event and a path condition exist or not during the circulation process of the workflow;
if so, the method of this embodiment proceeds to step S05.
And step S05, notifying corresponding business applications to execute corresponding events according to the bound application identifiers when the workflow is created, and determining whether the workflow continues to circulate according to an execution result.
Specifically, the workflow engine further comprises a flow event triggering unit, different types of events can be triggered before and after a specific operation in the workflow circulation process, a client is informed of executing the events and returning an execution result in a remote calling mode, and the event triggering unit executes subsequent circulation operation according to the feedback result.
In this embodiment, the creating, by an engine server, form structure data, and integrating role information in the form structure data to create a workflow step specifically includes:
executing automatic creation of form structure data through a preset metadata management unit, and updating the version of the form structure data after the form structure data is created;
acquiring organization personnel and role information through a preset role configuration unit, and integrating the organization personnel and the role information into the form structure data;
and designing and configuring the workflow based on a graphic designer through a preset model management unit, and publishing the model as a workflow definition to create the workflow.
Compared with the prior art, the implementation method of the workflow engine system shown in the embodiment has the following beneficial effects:
1) The table structure automatic creation and updating function in the embodiment can ensure the correctness of the table structure and data in the initial stage and subsequent iteration updating of engine deployment, and is convenient for operation and maintenance personnel to manage;
2) The client and the engine server in the embodiment are separately deployed, so that the difficulty in use under a micro-service architecture can be reduced, the intrusion on service application is small, and the workload caused by integration is reduced;
3) The integrated role information in the embodiment can be quickly accessed to different third-party organization personnel structures on the premise of not modifying the program, and the development workload brought by adaptation personnel is reduced.
EXAMPLE III
A third embodiment of the present invention provides a storage medium, on which computer instructions are stored, and the instructions, when executed by a processor, implement the steps of the implementation method of the workflow engine system in the above-described embodiments.
Example four
A fourth embodiment of the invention provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method for implementing a workflow engine system when executing the program.
Those of skill in the art will understand that the logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be viewed as implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In the description of the specification, reference to the description of "one embodiment," "some embodiments," "an example," "a specific example," or "some examples" or the like means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.