A workflow management system developed based on Flowable process engine
Through the workflow management system developed based on the Flowable process engine, combined with the rule engine and the conversion control system, the problem of tight coupling between the workflow engine and the rule engine is solved, simplified workflow definition and operation is achieved, and development complexity and maintenance are reduced. Cost, suitable for complex business rules scenarios.
Patent Information
- Application Number
- CN202211716870.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-28
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2042-12-28
AI Technical Summary
In the prior art, the workflow engine is tightly coupled with the rule engine, resulting in a large development workload, and the Activiti workflow engine has many versions, unstable, high learning costs, and does not conform to the usage rules and learning habits of ordinary people.
Design a workflow management system developed based on Flowable process engine, combines the rule engine and the conversion control system, realizes plug-in expansion through CDI containers, simplifies workflow definition and operation, supports the rule engine for process direction control and intermediate value calculation, and combines the Flowable workflow engine integration.
It realizes the definition and operation of workflows, reduces the difficulty of implementing business logic and maintenance costs, supports dynamic transformation of complex business rules, simplifies integration with CDI containers, is suitable for complex business rule scenarios, and reduces development complexity.
Smart Images

Figure CN115964072B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of engineering management software, and in particular to a workflow management system developed based on a Flowable process engine. Background Art
[0002] At present, in financial enterprises, such as banking enterprises and insurance enterprises, most of their business processes have been automated in a computer application environment by combining workflow engines. However, in some specific scenarios, such as credit approval business, complex logical calculations and flexible rule changes are usually required. However, workflow is essentially a process of transferring documents, information or tasks between multiple participants according to certain predefined rules. The workflow engine is not suitable for complex and changeable business rule application scenarios. Therefore, it is necessary to introduce a component for the workflow engine that can reduce the difficulty of business logic implementation and reduce maintenance and scalability costs. This component is the rule engine, which is suitable for scenarios with complex business rules and frequent and dynamic changes in rules.
[0003] At present, in the research of workflow technology based on rule engines, the mainstream traditional technology is to introduce ECA rules. ECA (Event Condition Action) originated from active database technology. It uses events, conditions, and behaviors to describe business logic, and defines the rule condition judgment and behavior processing content that meets the conditions when an event occurs. The mature products of workflow technology based on ECA rules on the market are mainly developed by combining the open source workflow engine Activiti with the Drools rule engine.
[0004] Activiti is the most widely used open source workflow engine in enterprises. It supports multiple process definition specifications such as BPMN2.0, XPDL, jPDL, etc., standardizes the design and development of business processes, and improves work efficiency. The Activiti workflow engine requires professional developers to design and deploy processes, and secondary development is required to connect to the rule engine. Drools is also an open source rule engine project. It uses the Rate algorithm to match the rules in the rule library and the data in the fact library, and draws corresponding conclusions and performs corresponding actions. The Drools rule engine defines and encapsulates business logic with rule files, saves program data with objects, and realizes the separation of business logic and data. However, it also requires professional developers to write and maintain rule files, and can only connect to the Activiti workflow engine in a hard-coded form.
[0005] Among them, the workflow engine is generally used to complete the definition and operation of the workflow of the workflow platform, and plays an important role in the workflow platform. However, the Activiti workflow engine has many versions, is unstable and has a high learning cost. The most important thing is that it does not conform to the usage rules and learning habits of ordinary people, and does not conform to the workflow system of general business processes. Summary of the invention
[0006] The purpose of the present invention is to provide a workflow management system developed based on the Flowable process engine to solve the technical problems in the prior art that the workflow engine and the rule engine are tightly coupled and the development workload is large.
[0007] The present invention provides a workflow management system developed based on a Flowable process engine. The workflow management system is used in a workflow platform. The workflow platform includes a workflow engine ZWE, a rule engine ZRE and a conversion control system ZTran. The workflow management system corresponds to the workflow engine ZWE. The workflow management system is mainly used to complete the definition and operation of the workflow of the workflow platform. The workflow platform also includes a background management system ZAdmin, which is used for users to log in to the background of the conversion control system ZTran through SSO authorization, including collecting ZAdmin data. The workflow management system defines a series of activities, and after reading the ZAdmin data, specifies execution roles, form data, etc. for the activities. The workflow management system is developed based on Flowable plug-in extension. The plug-in communicates with ZTran for extension and is associated with a CDI scope. The process activity types of rule-based gateways, manual tasks and automatic tasks are realized through the plug-in, so as to achieve extended functions such as controlling the direction of the process with rules and performing intermediate value calculation and external data reading with the rule engine.
[0008] Furthermore, through the system integration of the Flowable process engine and the Spring framework, the engine core class ProcessEngine can be configured as a common Java Bean, that is, org.flowable.spring.ProcessEngineFactoryBean is used as the entry class to handle the configuration of the process engine, and the ProcessEngine engine instance is created using the Spring dependency injection feature.
[0009] Furthermore, the ProcessEngine instance creates a process model based on the process definition file in XML format designed by the front-end, and persists it to the database for subsequent creation of process instances and submission to the ZTran workflow warehouse.
[0010] Furthermore, by developing a Java Servlet application service that complies with the CDI specification as a plug-in for the workflow engine to communicate with ZTran, when the workflow engine needs to integrate the conversion control system ZTran, the interface description file of this plug-in can be added to the META-INF / services / path of the workflow engine project and the plug-in Jar package can be added to the project.
[0011] Furthermore, after the plug-in is introduced, when the workflow engine ZWE is started, the Spring container first starts the workflow engine Servlet application service according to the configuration, and then starts the plug-in Servlet application service. After the plug-in Servlet application service is started, the CDI container will be initialized. The container starts class registration according to the interface description file. The class path entries in the file will be scanned and all classes will be parsed and registered as "Java Beans". The life cycle of these beans will be managed by the CDI container.
[0012] Furthermore, the plug-in instantiates the engine finder, workflow deployment service, rule invocation service, and consumers based on the CDI event mechanism through the context injection feature of the CDI container. First, configure the engine search strategy based on JTA management transactions. The CDI container can find the engine instance in the workflow engine Servlet application service, generate the corresponding instance image, start the process instance through the image start process method, and associate the process instance with the context environment of the CDI container.
[0013] Furthermore, by configuring a CDI event listener in the workflow engine ZWE to listen to all active events in the process instance that is already in the CDI scope, the CDI event bus consumer in the plug-in can receive the active events of the process instance. The consumer then sends the form data to the corresponding data source service of ZTran through the rule service. ZTran then encapsulates the data and forwards it to the rule engine, thereby achieving rule-based processing flow direction judgment, intermediate value calculation, etc.
[0014] Furthermore, the conversion control system ZTran can also be responsible for the deployment and update of workflows: first, by receiving the process definition file in XML format from the workflow engine, it is converted into a dedicated object ZNode, and the ZNode includes basic information of the activity, such as name, KEY, type, form, and flow direction, and is saved in the workflow warehouse of the conversion control system ZTran; then the workflow deployment module of the conversion control system ZTran deploys the process according to the ZNode information, calls the workflow deployment service of the plug-in, and the plug-in uses the workflow engine instance image to start the process instance according to the ZNode information and initialize / updates the event mapping cache in the CDI event consumer.
[0015] Furthermore, this plug-in can be integrated with any workflow engine developed based on a Web server that supports a CDI container through simple system configuration.
[0016] Compared with the prior art, the beneficial effects of the present invention are:
[0017] In the prior art, workflow engines are generally used to complete the definition and operation of workflows on workflow platforms, and play an important role in workflow platforms. However, the Activiti workflow engine has many versions, is unstable, and has a high learning cost. The most important thing is that it does not conform to the usage rules and learning habits of ordinary people, and does not conform to the workflow system of general business processes. In response to such problems, we have developed a new workflow management system that can effectively complete the definition and operation of workflows, that is, define a series of activities and specify execution roles for the activities, read ZAdmin data, form data, etc., and then submit the workflow to the conversion control system ZTran, which is converted into an extended model by the system, and provides form data, activity task data, etc. to the rule engine. The rule engine can be used to configure rules for activities to achieve conditional transfer and dynamic assignment, and can be embedded in the Flowable workflow engine as a plug-in. It can be integrated with any workflow engine developed based on a Web server that supports CDI containers through simple system configuration. At the same time, since the mainstream workflow engines on the market are basically developed based on JBPMN4, including Activiti, Flowable, Camunda, etc., for workflow engines of the same source, only simple modifications to the plug-in are required to complete the integration with ZTran, which is more convenient and quick. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 It is a schematic diagram of the association of the workflow engine to the CDI scope in the present invention;
[0020] Figure 2 It is a schematic diagram of the system flow of the workflow platform in the present invention;
[0021] Figure 3 A schematic diagram of a workflow platform in the present invention defining a business process;
[0022] Figure 4 This is a schematic diagram of the business process deployed on the workflow platform of the present invention. DETAILED DESCRIPTION
[0023] The technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Specific embodiment 1:
[0025] like Figure 1 As shown, an embodiment of the present invention provides a workflow management system developed based on the Flowable process engine, the so-called Flowable CDI extension is developed based on the contextual process execution model. A BPMN business process is usually a long-running interactive action, including user and system tasks. At runtime, the process is divided into a collection of independent work units, which are operated by users and / or application logic. In flowable-cdi, a process instance can be associated with a CDI scope, representing a work unit. It is particularly useful when the work unit is very complex, such as when a user task consists of a complex sequence of multiple different forms, and needs to maintain a "non-process-scoped" state during the interaction.
[0026] In this embodiment, the workflow management system is used in a workflow platform, which includes a workflow engine ZWE, a rule engine ZRE and a conversion control system ZTran. The workflow management system corresponds to the workflow engine ZWE. The workflow management system is mainly used to complete the definition and operation of the workflow of the workflow platform. The workflow platform also includes a background management system ZAdmin, which is used for users to log in to the background of the conversion control system ZTran through SSO authorization, including collecting ZAdmin data. The workflow management system defines a series of activities, and after reading the ZAdmin data, specifies execution roles, form data, etc. for the activities. The workflow management system is developed based on the Flowable plug-in extension. The plug-in communicates with ZTran for extension and is associated with the CDI scope. The process activity types of rule-based gateways, manual tasks and automatic tasks are realized through the plug-in, so as to achieve the extended functions of controlling the direction of the process with rules and performing intermediate value calculations and external data reading with the rule engine.
[0027] In the prior art, workflow engines are generally used to complete the definition and operation of workflows on workflow platforms, and play an important role in workflow platforms. However, the Activiti workflow engine has many versions, is unstable, and has a high learning cost. The most important thing is that it does not conform to the usage rules and learning habits of ordinary people, and does not conform to the workflow system of general business processes. In response to such problems, we have developed a new workflow management system that can effectively complete the definition and operation of workflows, that is, define a series of activities and specify execution roles for the activities, read ZAdmin data, form data, etc., and then submit the workflow to the conversion control system ZTran, which is converted into an extended model by the system, and provides form data, activity task data, etc. to the rule engine. The rule engine can be used to configure rules for activities to achieve conditional transfer and dynamic assignment, and can be embedded in the Flowable workflow engine as a plug-in. It can be integrated with any workflow engine developed based on a Web server that supports CDI containers through simple system configuration. At the same time, since the mainstream workflow engines on the market are basically developed based on JBPMN4, including Activiti, Flowable, Camunda, etc., for workflow engines of the same source, only simple modifications to the plug-in are required to complete the integration with ZTran, which is more convenient and quick.
[0028] In this embodiment, through the system integration of Flowable process engine and Spring framework, the engine core class ProcessEngine can be configured as a common Java Bean, that is, org.flowable.spring.ProcessEngineFactoryBean is used as the entry class to process the configuration of the process engine, and the ProcessEngine engine instance is created by using the Spring dependency injection feature;
[0029] The ProcessEngine engine instance creates a process model based on the XML process definition file designed by the front-end, and persists it to the database for subsequent creation of process instances and submission to the ZTran workflow warehouse;
[0030] By developing a Java Servlet application service that complies with the CDI specification as a plug-in for the workflow engine to communicate with ZTran, when the workflow engine needs to integrate the conversion control system ZTran, the interface description file of this plug-in can be added to the META-INF / services / path of the workflow engine project and the plug-in Jar package can be added to the project:
[0031] After the plugin is introduced, when the workflow engine ZWE is started, the Spring container first starts the workflow engine Servlet application service according to the configuration, and then starts the plugin Servlet application service. After the plugin Servlet application service is started, the CDI container will be initialized. The container starts class registration according to the interface description file. The class path entries in the file will be scanned and all classes will be parsed and registered as "Java Beans". The life cycle of these beans is managed by the CDI container;
[0032] The plug-in instantiates the engine finder, workflow deployment service, rule invocation service, and consumers based on the CDI event mechanism through the context injection feature of the CDI container. First, configure the engine search strategy based on JTA management transactions. The CDI container can find the engine instance in the workflow engine Servlet application service, generate the corresponding instance image, start the process instance through the image start process method, and associate the process instance with the context environment of the CDI container;
[0033] By configuring CDI event listeners in the workflow engine ZWE to listen to all active events in the process instance already in the CDI scope, the CDI event bus consumer in the plug-in can receive the active events of the process instance. The consumer then sends the form data to the corresponding data source service of ZTran through the rule service. ZTran then encapsulates the data and forwards it to the rule engine, so as to achieve the process direction judgment and intermediate value calculation based on the rule processing.
[0034] The conversion control system ZTran can also be responsible for the deployment and update of workflows: first, by receiving the process definition file in XML format from the workflow engine, it is converted into a dedicated object ZNode. The ZNode includes basic information of the activity, such as name, key, type, form, and flow direction, and is saved in the workflow warehouse of the conversion control system ZTran; then the workflow deployment module of the conversion control system ZTran deploys the process according to the ZNode information, calls the workflow deployment service of the plug-in, and the plug-in uses the workflow engine instance image to start the process instance according to the ZNode information and initialize / update the event mapping cache in the CDI event consumer:
[0035] This plug-in can be integrated with any workflow engine developed based on a web server that supports the CDI container through simple system configuration. Specific embodiment 2:
[0037] The previous embodiment is a workflow management system developed based on the workflow platform of this embodiment, and the workflow platform is as follows Figure 2-4 As shown, the following steps are included:
[0038] Define metadata, which can be divided into form data, interface data and pushed data according to the data source. The form data is designed with a visual form UI in the form design module of the workflow engine, and the form model can be automatically generated after the design is completed. After the form data is submitted to ZTran, it will be converted into a general data output model for use by the rule engine; interface data refers to the data that this system actively pulls from the external system. According to the input and output of the external data interface defined in ZTran, ZTran generates the corresponding client call code and the general data output model. The event triggers the client to call the external interface to obtain data for use by the rule engine: Push data refers to the data that this system passively receives pushed by the external system. The input data structure is defined in ZTran as the input data of the rule engine;
[0039] After completing the metadata definition, you can define the workflow model in the workflow engine, including defining the active nodes of the process, the flow path (sequential flow), and the form for configuring the node. The node form can select form data and interface data. Selecting form data will automatically render the UI interface for manual data input according to the form model. Selecting interface data will directly display it according to the interface data model for reviewers to review.
[0040] After saving the process model, the system will generate an XML file that complies with the BPMN2.0 standard, and submit the process definition basic information and XML file to ZTran for conversion into workflow warehouse data. ZTran parses the XML activity node information to generate the corresponding ZNode object. The main attributes of this object include node category, event key (trigger rule matching), metadata (input and output), and transfer node (child ZNode), etc., and automatically generates the business event object of the rule engine, which is used by the subsequent rule engine to configure rules for process activities;
[0041] After selecting a business event in the rule engine, the entire workflow can be rendered by associating ZNodes, and then the activity nodes that need to be configured with rules, such as gateway nodes, rule nodes, dynamic assignment nodes, etc., can be selected to add / modify rules for the nodes. The rule engine submits rules and business event data to ZTran, which saves the rule warehouse and updates the association between the workflow warehouse data and the rule flow warehouse data.
[0042] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A workflow management system developed based on the Flowable process engine, which is used in a workflow platform. The workflow platform includes a workflow engine ZWE, a rule engine ZRE and a conversion control system ZTran. The workflow management system corresponds to the workflow engine ZWE. In order to complete the definition and operation of the workflow of the workflow platform, the workflow management system is characterized by: The workflow platform also includes a background management system ZAdmin, which is used for user SSO authorization to log in to the background of the conversion control system ZTran, including collecting ZAdmin data. The workflow management system defines a series of activities, and after reading the ZAdmin data, specifies the execution role and form data for the activities. The workflow management system is developed based on the Flowable plug-in extension. The plug-in communicates with ZTran for extension and is associated with the CDI scope. The plug-in implements the process activity types of rule-based gateways, manual tasks and automatic tasks, so as to achieve the functions of controlling the process direction with rules and using the rule engine for intermediate value calculation and external data reading extension. Define metadata, which is divided into form data, interface data and push data according to the data source. The form data is designed with a visual form UI in the form design module of the workflow engine. After the design is completed, the form model is automatically generated. After the form data is submitted to ZTran, it will be converted into a general data output model for use by the rule engine; interface data refers to the data that this system actively pulls from the external system. According to the input and output of the external data interface, it is defined in ZTran. ZTran generates the corresponding client call code and the general data output model. The event triggers the client to call the external interface to obtain data for use by the rule engine; push data refers to the data that this system passively receives from the external system. The input data structure is defined in ZTran as the input data of the rule engine; After saving the process model, the system will generate an XML file that complies with the BPMN2.0 standard. The process definition basic information and the XML file will be submitted to ZTran for conversion into workflow warehouse data. ZTran will parse the XML activity node information to generate the corresponding ZNode object. The object attributes include node category, event key, metadata, and transfer node. It will also automatically generate the business event object of the rule engine, which will be used by the subsequent rule engine to configure rules for process activities. After the rule engine selects a business event, it renders the entire workflow by associating ZNodes, then selects the activity node that needs to configure rules, adds or modifies rules for the node, and the rule engine submits the rules and business event data to ZTran. ZTran saves the rule warehouse and updates the association between the workflow warehouse data and the rule flow warehouse data.
2. According to claim 1, a workflow management system developed based on the Flowable process engine is characterized in that: Through the system integration of Flowable process engine and Spring framework, the core class of the engine ProcessEngine is configured as a common Java Bean, that is, org.flowable.spring.ProcessEngineFactoryBean is used as the entry class to handle the configuration of the process engine, and the ProcessEngine engine instance is created by using the Spring dependency injection feature.
3. According to claim 1, a workflow management system developed based on the Flowable process engine is characterized in that: After the plug-in is introduced, when the workflow engine ZWE is started, the Spring container first starts the workflow engine Servlet application service according to the configuration, and then starts the plug-in Servlet application service. After the plug-in Servlet application service is started, the CDI container will be initialized. The container starts class registration according to the interface description file. The class path entries in the file will be scanned and all classes will be parsed and registered as "Java Beans". The life cycle of these beans will be managed by the CDI container.
4. According to claim 1, a workflow management system developed based on the Flowable process engine is characterized in that: By configuring a CDI event listener in the workflow engine ZWE, all active events in the process instance that are already in the CDI scope are listened to. The CDI event bus consumer in the plug-in receives the active events of the process instance. The consumer then sends the form data to the corresponding data source service of ZTran through the rule service. ZTran then encapsulates the data and forwards it to the rule engine, thereby achieving rule-based processing flow direction judgment and intermediate value calculation.
5. According to claim 1, a workflow management system developed based on the Flowable process engine is characterized in that: The conversion control system ZTran is responsible for the deployment and update of workflows: first, it receives the process definition file in XML format from the workflow engine and converts it into a dedicated object ZNode, which includes basic information, forms and flow directions of the activity and is saved in the workflow warehouse of the conversion control system ZTran; Then the workflow deployment module of the conversion control system ZTran deploys the process according to the ZNode information and calls the workflow deployment service of the plug-in. The plug-in starts the process instance and initializes or updates the event mapping cache in the CDI event consumer using the workflow engine instance image according to the ZNode information.
6. According to claim 1, a workflow management system developed based on the Flowable process engine is characterized in that: This plug-in is integrated with any workflow engine developed based on a web server that supports a CDI container.
Citation Information
Patent Citations
System and method for realizing visual development of workflow task interface
CN101819529A
Cloud workflow implementation method capable of supporting various engines
CN106251071A
Implementation method of business rule engine library system of power marketing system
CN113568610A
Automated workflow manager
US20120227044A1
Workflow-based application generator
US20140075413A1
