Process engine automatic conversion method, device, electronic medium and storage medium
By analyzing the BPMN process engine file, generating element information of the to-do drive process engine model and automatically converting it, the problem of the conversion of the BPMN standard process engine model to the to-do drive process engine model in the existing technology is solved, and the conversion efficiency is improved and accuracy.
Patent Information
- Application Number
- CN202010976892.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-16
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2040-09-16
AI Technical Summary
In the prior art, the conversion of the BPMN standard process engine model to the to-do-driven process engine model requires manual configuration, resulting in heavy reliance on manual, error-prone and inefficient.
By establishing a BPMN parser, analyzing the BPMN process engine file, generating the element information required for the to-do driver process engine model, determining the process node configuration file, and converting it into the process engine file of the to-do driver process engine model based on the conversion algorithm. Implement automatic conversion.
No manual intervention is required, which significantly improves the conversion efficiency between the BPMN standard process engine model and the to-do-driven process engine model, reduces errors, and improves the accuracy and efficiency of automated conversion.
Smart Images

Figure CN112230933B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a process engine automatic conversion method, device, electronic equipment and storage medium. Background Art
[0002] In the existing technology, the process engine model conversion is performed manually by looking at the flowchart of the BPMN process engine, and then manually judging and manually imitating the configuration process and to-do flow one by one. There is no existing technology that can automatically convert the BPMN standard process engine model into the transaction's self-developed expression-based to-do driven process engine model.
[0003] This method of migrating process engine models through manual configuration is heavily dependent on manual labor and prone to errors. On the other hand, it also involves large amounts of repetitive work and low efficiency. Summary of the invention
[0004] In view of the problems existing in the prior art, embodiments of the present invention provide a process engine automatic conversion method, device, electronic device and storage medium.
[0005] In a first aspect, an embodiment of the present invention provides a process engine automatic conversion method, comprising:
[0006] Obtain the BPMN process engine file corresponding to the BPMN process engine model;
[0007] The BPMN process engine file is parsed using a BPMN parser to obtain a parsed product; wherein the BPMN parser is a parser written in PHP based on preset parsed product requirements, and is used to parse the BPMN process engine file to generate a required parsed product; wherein the parsed product includes element information in the BPMN process engine file; the element information is process information required to establish a to-do driven process engine model; the to-do driven process engine model is a model to be converted from the BPMN process engine model;
[0008] Based on the element information, determine a process node configuration file corresponding to the to-do driven process engine model;
[0009] Converting the process node configuration file into a process engine file corresponding to the to-do driven process engine model;
[0010] Based on the process engine file corresponding to the to-do driven process engine model, the conversion from the BPMN process engine model to the to-do driven process engine model is completed.
[0011] Furthermore, the element information includes at least: to-do nodes, conditional directed edge structures and events;
[0012] Accordingly, based on the element information, a process node configuration file corresponding to the to-do driven process engine model is determined, including:
[0013] Based on the to-do nodes, the conditional directed edge structure and the events, determine the process sequence nodes corresponding to the to-do driven process engine model and the flow conditions between the nodes;
[0014] Based on the process sequence nodes, the flow conditions between the nodes and the element information, a process node configuration file corresponding to the to-do driven process engine model is determined.
[0015] Further, based on the to-do nodes, the conditional directed edge structure and the events, the process sequence nodes corresponding to the to-do driven process engine model and the flow conditions between the nodes are determined, including:
[0016] Parsing the conditional directed edge structure, and sequentially acquiring node pairs corresponding to the directed edges, wherein the node pairs consist of a start point and an end point of the corresponding edge;
[0017] According to the start event and end event, obtain the process start node and process end node;
[0018] Determine the longest sequential path from the process start node to the process end node according to the process start node, the process end node and the node pairs corresponding to the edges;
[0019] Using the longest sequential path as a process sequence node corresponding to the to-do driven process engine model;
[0020] According to the conditions in the conditional directed edge structure, the flow conditions between the nodes corresponding to the to-do driven process engine model are determined.
[0021] Furthermore, the process engine file corresponding to the to-do driven process engine model is a process configuration table in SQL format, a process node configuration table in SQL format, a process node to-do configuration table in SQL format, and a to-do flow condition configuration table in SQL format; the process node configuration file corresponding to the to-do driven process engine model includes a process configuration file in CSV format, a process node configuration file in CSV format, a process node to-do configuration file in CSV format, and a to-do flow condition configuration file in CSV format;
[0022] Accordingly, the process node configuration file corresponding to the to-do driven process engine model is determined based on the process sequence nodes, the flow conditions between the nodes and the element information, including:
[0023] Converting the process sequence nodes, the flow conditions between the nodes and the element information into array data;
[0024] According to the respective table fields of the process configuration table in SQL format, the process node configuration table in SQL format, the process node to-do configuration table in SQL format and the to-do flow condition configuration table in SQL format, the array data are traversed respectively to obtain single pieces of data corresponding to each table field one by one, and the obtained single pieces of data are written as CSV row data into the process configuration file in CSV format, the process node configuration file in CSV format, the process node to-do configuration file in CSV format and the to-do flow condition configuration file in CSV format respectively.
[0025] Further, converting the process node configuration file into a process engine file corresponding to the to-do driven process engine model includes:
[0026] According to the mapping relationship between the CSV file name and the SQL data table name, the process configuration file in CSV format, the process node configuration file in CSV format, the process node to-do configuration file in CSV format and the to-do flow condition configuration file in CSV format are converted into the process configuration table in SQL format, the process node configuration table in SQL format, the process node to-do configuration table in SQL format and the to-do flow condition configuration table in SQL format.
[0027] Furthermore, before using the BPMN parser to parse the BPMN process engine file and obtain the parsed product, the method further includes: a step of establishing the BPMN parser, specifically including:
[0028] A BPMN parser is written based on PHP according to preset parsing product requirements; wherein the BPMN parser contains element names to be parsed corresponding to the preset parsing product requirements; wherein the BPMN parser parses the BPMN process engine file according to the element names to be parsed to obtain parsing products corresponding to the preset parsing product requirements.
[0029] In a second aspect, an embodiment of the present invention provides a process engine automatic conversion device, comprising:
[0030] A first acquisition module is used to acquire a BPMN process engine file corresponding to a BPMN process engine model;
[0031] The second acquisition module is used to parse the BPMN process engine file using a BPMN parser to obtain a parsed product; wherein the BPMN parser is a parser written in PHP based on preset parsed product requirements, and is used to parse the BPMN process engine file to generate a required parsed product; wherein the parsed product includes element information in the BPMN process engine file; the element information is the process information required to establish a to-do driven process engine model; the to-do driven process engine model is a model to be converted from the BPMN process engine model;
[0032] A determination module, used to determine a process node configuration file corresponding to the to-do driven process engine model based on the element information;
[0033] A file conversion module, used to convert the process node configuration file into a process engine file corresponding to the to-do driven process engine model;
[0034] A model conversion module is used to complete the conversion from the BPMN process engine model to the to-do driven process engine model based on the process engine file corresponding to the to-do driven process engine model.
[0035] Furthermore, the element information includes at least: to-do nodes, conditional directed edge structures and events;
[0036] Accordingly, the determining module is used to:
[0037] Based on the to-do nodes, the conditional directed edge structure and the events, determine the process sequence nodes corresponding to the to-do driven process engine model and the flow conditions between the nodes;
[0038] Based on the process sequence nodes, the flow conditions between the nodes and the element information, a process node configuration file corresponding to the to-do driven process engine model is determined.
[0039] Further, when the determination module is executing the process sequence nodes corresponding to the to-do driven process engine model and the flow conditions between the nodes based on the to-do nodes, the conditional directed edge structure and the events, it is specifically used to:
[0040] Parsing the conditional directed edge structure, and sequentially acquiring node pairs corresponding to the directed edges, wherein the node pairs consist of a start point and an end point of the corresponding edge;
[0041] According to the start event and end event, obtain the process start node and process end node;
[0042] Determine the longest sequential path from the process start node to the process end node according to the process start node, the process end node and the node pairs corresponding to the edges;
[0043] Using the longest sequential path as a process sequence node corresponding to the to-do driven process engine model;
[0044] According to the conditions in the conditional directed edge structure, the flow conditions between the nodes corresponding to the to-do driven process engine model are determined.
[0045] Furthermore, the process engine file corresponding to the to-do driven process engine model is a process configuration table in SQL format, a process node configuration table in SQL format, a process node to-do configuration table in SQL format, and a to-do flow condition configuration table in SQL format; the process node configuration file corresponding to the to-do driven process engine model includes a process configuration file in CSV format, a process node configuration file in CSV format, a process node to-do configuration file in CSV format, and a to-do flow condition configuration file in CSV format;
[0046] Accordingly, when the determination module determines the process node configuration file corresponding to the to-do driven process engine model based on the process sequence nodes, the flow conditions between the nodes and the element information, it is specifically used to:
[0047] Converting the process sequence nodes, the flow conditions between the nodes and the element information into array data;
[0048] According to the respective table fields of the process configuration table in SQL format, the process node configuration table in SQL format, the process node to-do configuration table in SQL format and the to-do flow condition configuration table in SQL format, the array data are traversed respectively to obtain single pieces of data corresponding to each table field one by one, and the obtained single pieces of data are written as CSV row data into the process configuration file in CSV format, the process node configuration file in CSV format, the process node to-do configuration file in CSV format and the to-do flow condition configuration file in CSV format respectively.
[0049] Furthermore, the file conversion module is used to:
[0050] According to the mapping relationship between the CSV file name and the SQL data table name, the process configuration file in CSV format, the process node configuration file in CSV format, the process node to-do configuration file in CSV format and the to-do flow condition configuration file in CSV format are converted into the process configuration table in SQL format, the process node configuration table in SQL format, the process node to-do configuration table in SQL format and the to-do flow condition configuration table in SQL format.
[0051] Furthermore, before the second acquisition module uses a BPMN parser to parse the BPMN process engine file to obtain the parsed product, the device further includes: establishing the BPMN parser module, which is specifically used to:
[0052] A BPMN parser is written based on PHP according to preset parsing product requirements; wherein the BPMN parser contains element names to be parsed corresponding to the preset parsing product requirements; wherein the BPMN parser parses the BPMN process engine file according to the element names to be parsed to obtain parsing products corresponding to the preset parsing product requirements.
[0053] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the process engine automatic conversion method described in the first aspect above are implemented.
[0054] In a fourth aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the process engine automatic conversion method as described in the first aspect above.
[0055] It can be seen from the above technical scheme that the process engine automatic conversion method, device, electronic device and storage medium provided in the embodiments of the present invention, by establishing a parser, parses the BPMN process engine file, generates the element information required for establishing a to-do driven process engine model, determines the process node configuration file corresponding to the to-do driven process engine model through the element information, and then converts the process node configuration file into a process engine file corresponding to the to-do driven process engine model based on the subsequent conversion algorithm, and uses the process engine file corresponding to the to-do driven process engine model as the data basis for the process engine conversion, thereby completing the automatic conversion from the BPMN standard process engine model to the to-do driven process engine model. It can be seen that the embodiments of the present invention do not require manual conversion from the BPMN standard process engine model to the to-do driven process engine model, thereby greatly improving the conversion efficiency between the BPMN standard process engine model and the to-do driven process engine model. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0057] Figure 1A schematic diagram of a process flow of a process engine automatic conversion method provided by an embodiment of the present invention;
[0058] Figure 2 A schematic diagram of a BPMN process engine file provided by an embodiment of the present invention;
[0059] Figure 3 A schematic diagram of parsing a BPMN process engine file provided by an embodiment of the present invention;
[0060] Figure 4 A schematic diagram of a process flow of a process engine automatic conversion method provided by another embodiment of the present invention;
[0061] Figure 5 A schematic diagram of the structure of a process engine automatic conversion device provided by an embodiment of the present invention;
[0062] Figure 6 FIG. 4 is a schematic diagram of the physical structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0064] At present, when the prior art switches between the two process engine models, the BPMN standard process engine model and the to-do driven process engine model, manual configuration is required, that is, it is necessary to manually look at the flowchart of the BPMN process engine, and then make judgments based on the flowchart, and then manually imitate the configuration process and the to-do process one by one. It can be seen that the prior art relies heavily on manual work, is prone to errors, and has a lot of repetitive work in actual operation, and is inefficient. For this reason, the present invention establishes a parser, parses the BPMN process engine file, generates the element information required to establish the to-do driven process engine model, determines the process node configuration file corresponding to the to-do driven process engine model through the element information, and then converts the process node configuration file into the process engine file corresponding to the to-do driven process engine model based on the subsequent conversion algorithm, and then uses the process engine file corresponding to the to-do driven process engine model as the data basis for the process engine conversion, thereby completing the automatic conversion from the BPMN standard process engine model to the to-do driven process engine model. The process engine automatic conversion method provided by the present invention will be explained and illustrated in detail through specific embodiments.
[0065] Figure 1A flow chart of a process engine automatic conversion method provided by an embodiment of the present invention; Figure 1 As shown, the method includes:
[0066] Step 101: Obtain a BPMN process engine file corresponding to the BPMN process engine model.
[0067] In this step, it should be noted that the full spelling of BPMN is Business Process Modeling Notation, which refers to business process modeling notation. The main goal of BPMN is to provide a set of markup languages that are understood by all business users, including business analysts, software developers, and business managers and supervisors. BPMN builds a standardized bridge between business process design and process implementation. It can be seen that BPMN is a common and standard language for process modeling. BPMN is a symbolic language. Like the purpose of any language, BPMN is to facilitate communication and promote communication and understanding of business processes. The purpose of modeling with BPMN is to use BPMN to draw flow charts so that departments can better understand business processes and relationships. For example, one of the biggest advantages of BPMN 2.0 is that it eliminates the communication gap between business personnel and IT technicians. The "N" in BPMN stands for "notation". These graphical symbols consist of behavioral symbols for process activities, process lanes, or events. Since the first version of the BPMN specification released by OMG in May 2004, these visual symbols have been used as part of the standard and have become the specification and standard for process management. BPMN = Graphical Expression + XML. BPMN2.0 introduces XML, making BPMN not only a beautiful graphical expression, but also able to accurately describe many ambiguous issues in business processes. By defining each BPMN object through XML, BPMN standardizes and ensures that each graphic, whether it is a process model or all objects in the process model, can be clearly expressed. It should be noted that the BPMN process designer can automatically generate XML.
[0068] In this step, it should be noted that the BPMN process engine file corresponding to the BPMN (standard) process engine model is a standard BPMN file (such as Figure 2 As shown), the purpose of this step of obtaining the BPMN process engine file corresponding to the BPMN standard process engine model is to facilitate step 102 to parse the BPMN process engine file and then obtain the element information contained in the BPMN process engine file.
[0069] Step 102: parse the BPMN process engine file using a BPMN parser to obtain a parsed product;
[0070] In this step, the BPMN parser is a parser written in PHP based on preset parsing product requirements, and is used to parse the BPMN process engine file to generate the required parsing products; wherein the parsing products include element information in the BPMN process engine file; the element information is the process information required to establish a to-do driven process engine model; the to-do driven process engine model is a model to be converted from the BPMN process engine model.
[0071] In this step, it should be noted that BPMN is a modeling standard. The existing technologies are all based on the BPMN parsing running on the activiti engine, which cannot output parsing products. Therefore, it is impossible to achieve automatic conversion from the BPMN (standard) process engine model to the to-do driven process engine model. In order to solve this problem, this embodiment writes a BPMN parser based on PHP according to the preset parsing product requirements, and then uses the BPMN parser to parse the BPMN process engine file to generate the required parsing products, so that the element information contained in the BPMN process engine file can be obtained (the parsing product is the element information), and then based on the element information, a process node configuration file corresponding to the to-do driven process engine model can be established, thereby completing the automatic conversion from the BPMN (standard) process engine model to the to-do driven process engine model.
[0072] In this embodiment, it should be noted that when writing the BPMN parser, the BPMN parser can be written based on the PHP public DOMDocument parser. Specifically, the tag name (TagName) of the BPMN process engine file to be parsed and the element names (ElementName) corresponding to the preset parsing product requirements need to be set in the DOMDocument parser. For example, the element names corresponding to the preset parsing product requirements include: process name (workFlowName), start event (startEvent), end event (endEvent), to-do (userTask), directed edge structure (sequenceFlow), etc. Then, the parser is used to load the BPMN process engine file to be parsed for parsing, and the corresponding element information in the BPMN process engine file is obtained according to the element name during the parsing process.
[0073] In this embodiment, it should be noted that the DOM parsing library parses all the contents of the file and does not filter the contents, while the PHP-based DOM parsing library supports reading configuration to parse out the contents of interest and classify them for subsequent analysis and processing.
[0074] In this embodiment, BPMN is a modeling standard. The existing technologies are all based on BPMN parsing running on the activiti engine, which cannot output parsing products and only supports the Java language. The advantage of the BPMN parser implemented based on PHP is that it can customize the generation of the required parsing products without limiting the language. Then, based on the subsequent conversion algorithm, the parsing products will be converted into the process engine file corresponding to the to-do driven process engine model developed by the transaction.
[0075] See also Figure 3 After parsing the BPMN process engine file using the BPMN parser, it can generate Figure 3 The parsing products shown in the figure contain various element information, based on which the process information required to establish the to-do driven process engine model can be determined. For example, based on the element information of to-do nodes, conditional directed edge structures and events, the process information required to establish the to-do driven process engine model can be determined, such as process sequence nodes and flow conditions between nodes.
[0076] It can be understood that this step requires first establishing a BPMN parser, and then using the BPMN parser to parse the BPMN process engine file to obtain a parsed product. The parsed product is the element information contained in the BPMN process engine file. Since the element information includes to-do nodes, conditional directed edge structures, participants and events, etc., the process information required to establish a to-do driven process engine model can be obtained based on the element information.
[0077] Step 103: Based on the element information, determine the process node configuration file corresponding to the to-do driven process engine model.
[0078] In this step, after obtaining the element information contained in the BPMN (standard) process engine model, the process information required to establish the to-do driven process engine model can be determined based on these element information, and then the process node configuration file corresponding to the to-do driven process engine model can be determined based on the process information.
[0079] For example, based on the element information such as to-do nodes, conditional directed edge structures and events, the process information required to establish a to-do driven process engine model can be determined, for example: "Parse the conditional directed edge structure, and obtain the node pairs corresponding to each directed edge in sequence, each node pair consisting of the starting point and end point of the corresponding edge; obtain the process start node and the process end node according to the start event and the end event; determine the longest sequential path from the process start node to the process end node according to the process start node, the process end node and the node pairs corresponding to each edge; use the longest sequential path as the process sequence node corresponding to the to-do driven process engine model; determine the flow conditions between each node corresponding to the to-do driven process engine model according to the conditions in the conditional directed edge structure", and then based on the process sequence nodes, the flow conditions between each node and the participants in the element information, the process node configuration file in CSV format corresponding to the to-do driven process engine model can be determined, for example, including a process configuration file in CSV format, a process node configuration file in CSV format, a process node to-do configuration file in CSV format and a to-do flow condition configuration file in CSV format.
[0080] It can be understood that for the convenience of processing, the above processing process "parse the conditional directed edge structure, and obtain the node pairs corresponding to each directed edge in sequence, each node pair consisting of the starting point and the end point of the corresponding edge; according to the start event and the end event, obtain the process start node and the process end node; according to the process start node, the process end node and the node pairs corresponding to each edge, determine the longest sequential path from the process start node to the process end node; use the longest sequential path as the process sequence node corresponding to the to-do driven process engine model; according to the conditions in the conditional directed edge structure, determine the flow conditions between each node corresponding to the to-do driven process engine model" can be written as a "process sequence node generator", and then use the "process sequence node generator" to process the element information obtained by the analysis, and then obtain the process sequence nodes corresponding to the to-do driven process engine model and the flow conditions between each node.
[0081] Step 104: Convert the process node configuration file into a process engine file corresponding to the to-do driven process engine model.
[0082] In this step, the process node configuration file can be converted into a process engine file corresponding to the to-do driven process engine model by using a preset conversion algorithm. It can be understood that the process engine file corresponding to the to-do driven process engine model is generally a data table in SQL format, for example, including: a process node configuration table in SQL format, a process node to-do configuration table in SQL format, and a to-do flow condition configuration table in SQL format; and the process node configuration file corresponding to the to-do driven process engine model is generally a file in CSV format, for example, including a process configuration file in CSV format, a process node configuration file in CSV format, a process node to-do configuration file in CSV format, and a to-do flow condition configuration file in CSV format. Therefore, a mapping relationship between a CSV file name and an SQL data table name can be established in the preset conversion algorithm, and then, according to the mapping relationship between the CSV file name and the SQL data table name, the process configuration file in CSV format, the process node configuration file in CSV format, the process node to-do configuration file in CSV format, and the to-do flow condition configuration file in CSV format are correspondingly converted into a process configuration table in SQL format, a process node configuration table in SQL format, a process node to-do configuration table in SQL format, and a to-do flow condition configuration table in SQL format.
[0083] Step 105: Based on the process engine file corresponding to the to-do driven process engine model, complete the conversion from the BPMN process engine model to the to-do driven process engine model.
[0084] In this step, since the process engine file corresponding to the to-do driven process engine model is generated, a data basis is provided, thereby enabling automatic conversion from the BPMN (standard) process engine model to the to-do driven process engine model.
[0085] In this embodiment, see Figure 4 As shown in the flowchart, after obtaining the process engine file corresponding to the to-do driven process engine model, the process engine file can be used for online testing to detect whether the to-do driven process engine model can be automatically generated. If the test passes, it is pushed to the production environment to realize the online configuration of the to-do driven process engine model developed by the transaction.
[0086] It can be seen from the above technical scheme that the process engine automatic conversion method provided by the embodiment of the present invention, by establishing a parser, parses the BPMN process engine file, generates the element information required for establishing the to-do driven process engine model, determines the process node configuration file corresponding to the to-do driven process engine model through the element information, and then converts the process node configuration file into the process engine file corresponding to the to-do driven process engine model based on the subsequent conversion algorithm, and uses the process engine file corresponding to the to-do driven process engine model as the data basis for the process engine conversion, thereby completing the automatic conversion from the BPMN (standard) process engine model to the to-do driven process engine model. It can be seen that this embodiment does not require manual conversion from the BPMN (standard) process engine model to the to-do driven process engine model, thereby greatly improving the conversion efficiency between the BPMN (standard) process engine model and the to-do driven process engine model.
[0087] Based on the above embodiment, in this embodiment, the element information at least includes: to-do nodes, conditional directed edge structures and events;
[0088] Accordingly, based on the element information, a process node configuration file corresponding to the to-do driven process engine model is determined, including:
[0089] Based on the to-do nodes, the conditional directed edge structure and the events, determine the process sequence nodes corresponding to the to-do driven process engine model and the flow conditions between the nodes;
[0090] Based on the process sequence nodes, the flow conditions between the nodes and the element information, a process node configuration file corresponding to the to-do driven process engine model is determined.
[0091] In this embodiment, element information such as to-do nodes, conditional directed edge structures, and events are processed. The processing method is to first parse the conditional directed edge structure, obtain the process start node, the process end node, and the node pairs corresponding to each edge, determine the process sequence nodes corresponding to the to-do driven process engine model, determine the flow conditions between the nodes corresponding to the to-do driven process engine model, and then convert the process sequence nodes, the flow conditions between the nodes, and the element information into array data to determine the process node configuration file corresponding to the to-do driven process engine model.
[0092] In this embodiment, for example, to-do nodes, conditional directed edge structures and events are used as data basis, and a priority traversal algorithm is used to establish a process sequence node generator, generate the process sequence nodes required for the to-do driven process engine model and generate the to-do driven process basic framework, automatically generate the to-do driven process node sequence, determine the process sequence nodes, and determine the process node configuration file corresponding to the to-do driven process engine model.
[0093] As can be seen from the above technical solution, the process engine automatic conversion method provided by the embodiment of the present invention determines the process sequence nodes corresponding to the to-do driven process engine model and the flow conditions between the nodes based on the to-do nodes, the conditional directed edge structure and the events, including:
[0094] Parsing the conditional directed edge structure, and sequentially acquiring node pairs corresponding to the directed edges, wherein the node pairs consist of a start point and an end point of the corresponding edge;
[0095] According to the start event and end event, obtain the process start node and process end node;
[0096] Determine the longest sequential path from the process start node to the process end node according to the process start node, the process end node and the node pairs corresponding to the edges;
[0097] Using the longest sequential path as a process sequence node corresponding to the to-do driven process engine model;
[0098] According to the conditions in the conditional directed edge structure, the flow conditions between the nodes corresponding to the to-do driven process engine model are determined.
[0099] In this embodiment, the process of generating the longest sequential path is described as follows:
[0100] Ⅰ. First, parse sequenceFlow (a directed edge structure with conditions) to get nodes with a structure similar to "(A, P1), (P1, B), (A, C), (B, P3), (P3, D), (C, D), (D, P4), (P4, E)" (the left side of the comma in the brackets is the starting point, and the right side is the end point. For the to-do driven process, they are all to-dos one by one). Write them into the LinkedHashSet list of the graph in sequence (this basic structure is used because the insertion order can be maintained), and obtain the start node and the end node of the process through startEvent (start event) and endEvent (end event) (the start and end events correspond to the starting to-do and the ending to-do respectively), that is, add A as the start node of the process and E as the end node of the process, initialize it as a directed graph, and convert the problem into finding the longest sequential path from A to E, and filter out non-to-do nodes.
[0101] Ⅱ. Find all paths based on the improved customized depth-first traversal algorithm, and then select the longest path. The detailed steps are as follows:
[0102] def finds all paths from the start point to the end point in the flowchart (graph, start, end):
[0103] Define the visited variable and initialize it as a stack;
[0104] Add the first node in the visited stack as start (the incoming starting point);
[0105] Define the nodestack list and initialize it as an empty list to store the nearest node of the current path;
[0106] Define the indexstack list and initialize it as an empty list to store the indexes of all neighbor nodes of each node in nodestack;
[0107] Define the variable current and initialize it to start (the starting point passed in);
[0108] Define the index variable i and initialize it to 0;
[0109] Start the loop:
[0110] #Note: Get all neighbor nodes of the current node
[0111] Define the variable neighbors and assign it the value graph[current]
[0112] Start looping through all neighbor nodes, increasing i by 1 each time until the traversal is complete:
[0113] If the last neighbor node has been reached:
[0114] Remove the current node from the visted stack;
[0115] If the length of the nodestack list is less than 1: terminate the loop;
[0116] Pop a node from the nodestack list and assign it to the current variable;
[0117] Pop a node from indexstack and assign it to index variable i;
[0118] On the contrary, if the end is found in the neighbor node (that is, the end point is reached, a path from start to end is found here);
[0119] Print out this path, that is, all nodes in nodestack + current + end nodes, and filter out nodes that are not to-do types;
[0120] The index variable i is incremented by 1;
[0121] On the contrary,
[0122] Push the current node into the nodestack list;
[0123] Push index i+1 into the indexstack list;
[0124] Add neighbors[i] node to the visited stack;
[0125] Assign the current variable to neighbors[i];
[0126] Assign index i to 0;
[0127] Loop through all paths to get their lengths, and print out the path with the largest length;
[0128] Through the above steps, all paths from the starting point to the end point in the flowchart can be traversed. For example, suppose "ABCDE", "ABDE", and "ACDE" are obtained, and then the longest path is obtained from them, which is the "ABCDE" process sequence node, as the process sequence node corresponding to the to-do driven process engine model.
[0129] Ⅲ. Finally, the conditions of the directed segments in sequenceFlow (conditional directed edge structure) are merged to generate a list of flow conditions between each to-do node (ABCDE), and the obtained sequential process node list is merged with the flow condition list to generate a JSON file called "sequential process node configuration". According to the conditions in sequenceFlow (conditional directed edge structure), the flow conditions between each node corresponding to the to-do driven process engine model are determined.
[0130] It can be seen from the above technical scheme that the process engine automatic conversion method provided by the embodiment of the present invention parses the conditional directed edge structure, and obtains the node pairs corresponding to each directed edge in sequence, each node pair consisting of the starting point and the end point of the corresponding edge; according to the start event and the end event, the process start node and the process end node are obtained; according to the process start node, the process end node and the node pairs corresponding to the edges, the longest sequential path from the process start node to the process end node is determined; the longest sequential path is used as the process sequence node corresponding to the to-do driven process engine model; according to the conditions in the conditional directed edge structure, the flow conditions between the nodes corresponding to the to-do driven process engine model are determined, thereby determining the process sequence node corresponding to the to-do driven process engine model and the flow conditions between the nodes.
[0131] On the basis of the above embodiments, in this embodiment, the process engine file corresponding to the to-do driven process engine model is a process configuration table in SQL format, a process node configuration table in SQL format, a process node to-do configuration table in SQL format, and a to-do flow condition configuration table in SQL format; the process node configuration file corresponding to the to-do driven process engine model includes a process configuration file in CSV format, a process node configuration file in CSV format, a process node to-do configuration file in CSV format, and a to-do flow condition configuration file in CSV format;
[0132] Accordingly, the process node configuration file corresponding to the to-do driven process engine model is determined based on the process sequence nodes, the flow conditions between the nodes and the element information, including:
[0133] Converting the process sequence nodes, the flow conditions between the nodes and the element information into array data;
[0134] According to the respective table fields of the process configuration table in SQL format, the process node configuration table in SQL format, the process node to-do configuration table in SQL format and the to-do flow condition configuration table in SQL format, the array data are traversed respectively to obtain single pieces of data corresponding to each table field one by one, and the obtained single pieces of data are written as CSV row data into the process configuration file in CSV format, the process node configuration file in CSV format, the process node to-do configuration file in CSV format and the to-do flow condition configuration file in CSV format respectively.
[0135] In this embodiment, it should be noted that when determining the process node configuration file corresponding to the to-do driven process engine model based on the process sequence nodes, the flow conditions between the nodes and the element information, the following method can be used:
[0136] First, the process sequence nodes, the flow conditions between each node and the element information are converted into array data, and then according to the table fields of the process configuration table in SQL format, the process node configuration table in SQL format, the process node to-do configuration table in SQL format and the to-do flow condition configuration table in SQL format, the array data are traversed respectively to obtain a single piece of data corresponding to each table field one by one, and the obtained single piece of data is written as CSV row data into the process configuration file in CSV format, the process node configuration file in CSV format, the process node to-do configuration file in CSV format and the to-do flow condition configuration file in CSV format respectively.
[0137] Specifically, based on PHP, the function json_decode() can be used to configure an array for "process sequence nodes, flow conditions between nodes, and the element information", and then recursively traverse the above configuration array in turn to flatten it into a single piece of data that corresponds one to one with each table field. For example, it can be flattened into a single piece of data that corresponds one to one with a MySQL data table field, and the obtained single piece of data is written into a row of CSV configuration as CSV row data, and then according to the latitude of different data tables, the CSV row data is respectively written into the process configuration file in the CSV format, the process node configuration file in the CSV format, the process node to-do configuration file in the CSV format, and the to-do flow condition configuration file in the CSV format.
[0138] In this embodiment, it should be noted that the process sequence nodes, the flow conditions between the nodes and the element information are obtained, converted into array data, and converted into the process node configuration file corresponding to the to-do driven process engine model after the process configuration file conversion. Among them, "process node configuration file conversion" is a configuration file conversion script, which obtains the element information and the generated process sequence nodes and the flow conditions between the nodes, and converts them into the transaction self-developed process engine CSV configuration file. Because the process engine configuration of the to-do driven process engine model is a plurality of MySQL-based data tables, each of which contains one-by-one data, therefore, in order to facilitate the import of the database, the array is configured for the element information, etc. based on PHP through the function json_decode(), and then the array data is recursively traversed in turn, flattened into a single data corresponding to the MySQL data table field, and directly written into a row of CSV configuration, and finally, according to the dimensions of different data tables, a plurality of transaction configuration tables (such as process table, process node table, process node to-do table, to-do flow condition table) CSV files are generated, and the CSV file name is the data table name, which is used for subsequent configuration file import.
[0139] It can be seen from the above technical scheme that the process engine automatic conversion method provided by the embodiment of the present invention converts the process sequence nodes, the flow conditions between each node and the element information into array data, and traverses the array data according to the table fields of the process configuration table in SQL format, the process node configuration table in SQL format, the process node to-do configuration table in SQL format and the to-do flow condition configuration table in SQL format, respectively, to obtain a single piece of data corresponding to each table field one by one, and writes the obtained single piece of data as CSV row data into the process configuration file in CSV format, the process node configuration file in CSV format, the process node to-do configuration file in CSV format and the to-do flow condition configuration file in CSV format, respectively, so as to facilitate the subsequent conversion of the process configuration file in CSV format, the process node configuration file in CSV format, the process node to-do configuration file in CSV format and the to-do flow condition configuration file in CSV format into a process engine file corresponding to the to-do driven process engine model (the process engine file corresponding to the to-do driven process engine model includes the process configuration table in SQL format, the process node configuration table in SQL format, the process node to-do configuration table in SQL format and the to-do flow condition configuration table in SQL format).
[0140] On the basis of the above embodiment, in this embodiment, the process node configuration file is converted into a process engine file corresponding to the to-do driven process engine model, including:
[0141] According to the mapping relationship between the CSV file name and the SQL data table name, the process configuration file in CSV format, the process node configuration file in CSV format, the process node to-do configuration file in CSV format and the to-do flow condition configuration file in CSV format are converted into the process configuration table in SQL format, the process node configuration table in SQL format, the process node to-do configuration table in SQL format and the to-do flow condition configuration table in SQL format.
[0142] In this embodiment, it can be understood that a mapping relationship between a CSV file name and an SQL data table name is established in a preset conversion algorithm, and then based on the mapping relationship between the CSV file name and the SQL data table name, the process configuration file in CSV format, the process node configuration file in CSV format, the process node to-do configuration file in CSV format, and the to-do flow condition configuration file in CSV format are converted into a process configuration table in SQL format, a process node configuration table in SQL format, a process node to-do configuration table in SQL format, and a to-do flow condition configuration table in SQL format.
[0143] In this embodiment, it should be noted that the generated multiple transaction configuration table CSV files can be used to loop through the configuration table CSV files line by line using the fgetcsv() function, and the MySQL insert SQL is generated based on the mapping relationship between the CSV file name and the SQL data table name, and written into each configuration table in turn, including a process configuration table in SQL format, a process node configuration table in SQL format, a process node to-do configuration table in SQL format, and a to-do flow condition configuration table in SQL format.
[0144] It can be seen from the above technical solution that the process engine automatic conversion method provided in an embodiment of the present invention realizes the conversion of CSV format files and corresponding SQL format data tables according to the mapping relationship between CSV file names and SQL data table names, thereby providing data support for the automatic conversion between the BPMN (standard) process engine model and the to-do driven process engine model.
[0145] On the basis of the above embodiment, in this embodiment, before using the BPMN parser to parse the BPMN process engine file and obtain the parsed product, the method further includes: a step of establishing the BPMN parser, specifically including:
[0146] A BPMN parser is written based on PHP according to preset parsing product requirements; wherein the BPMN parser contains element names to be parsed corresponding to the preset parsing product requirements; wherein the BPMN parser parses the BPMN process engine file according to the element names to be parsed to obtain parsing products corresponding to the preset parsing product requirements.
[0147] In this embodiment, it should be noted that when writing the BPMN parser, the BPMN parser can be written based on the PHP public DOMDocument parser. Specifically, the tag name (TagName) of the BPMN process engine file to be parsed and the element names (ElementName) corresponding to the preset parsing product requirements need to be set in the DOMDocument parser. For example, the element names corresponding to the preset parsing product requirements include: process name (workFlowName), start event (startEvent), end event (endEvent), to-do (userTask), directed edge structure (sequenceFlow), etc. Then, the parser is used to load the BPMN process engine file to be parsed for parsing, and the corresponding element information in the BPMN process engine file is obtained according to the element name during the parsing process.
[0148] In this embodiment, it should be noted that the DOM parsing library parses all the contents of the file and does not filter the contents, while the PHP-based DOM parsing library supports reading configuration to parse out the contents of interest and classify them for subsequent analysis and processing.
[0149] In this embodiment, BPMN is a modeling standard. The existing technologies are all based on BPMN parsing running on the activiti engine, which cannot output parsing products and only supports the Java language. The advantage of the BPMN parser implemented based on PHP is that it can customize the generation of the required parsing products without limiting the language. Then, based on the subsequent conversion algorithm, the parsing products will be converted into the process engine file corresponding to the to-do driven process engine model developed by the transaction.
[0150] Figure 5 A schematic diagram of the structure of a process engine automatic conversion device provided by an embodiment of the present invention is shown in FIG. Figure 5 As shown, the device includes: a first acquisition module 201, a second acquisition module 202, a determination module 203, a file conversion module 204, and a model conversion module 205, wherein:
[0151] The first acquisition module 201 is used to acquire a BPMN process engine file corresponding to the BPMN process engine model;
[0152] The second acquisition module 202 is used to parse the BPMN process engine file using a BPMN parser to obtain a parsed product; wherein the BPMN parser is a parser written in PHP based on preset parsed product requirements, and is used to parse the BPMN process engine file to generate a required parsed product; wherein the parsed product includes element information in the BPMN process engine file; the element information is the process information required to establish a to-do driven process engine model; the to-do driven process engine model is a model to be converted from the BPMN process engine model;
[0153] A determination module 203, configured to determine a process node configuration file corresponding to the to-do driven process engine model based on the element information;
[0154] A file conversion module 204, used to convert the process node configuration file into a process engine file corresponding to the to-do driven process engine model;
[0155] The model conversion module 205 is used to complete the conversion from the BPMN process engine model to the to-do driven process engine model based on the process engine file corresponding to the to-do driven process engine model.
[0156] Based on the above embodiment, the element information at least includes: to-do nodes, conditional directed edge structures and events;
[0157] Accordingly, the determining module 203 is used to:
[0158] Based on the to-do nodes, the conditional directed edge structure and the events, determine the process sequence nodes corresponding to the to-do driven process engine model and the flow conditions between the nodes;
[0159] Based on the process sequence nodes, the flow conditions between the nodes and the element information, a process node configuration file corresponding to the to-do driven process engine model is determined.
[0160] Based on the above embodiment, when the determination module 203 executes the process sequence nodes corresponding to the to-do driven process engine model and the flow conditions between the nodes based on the to-do nodes, the conditional directed edge structure and the events, it is specifically used to:
[0161] Parsing the conditional directed edge structure, and sequentially acquiring node pairs corresponding to the directed edges, wherein the node pairs consist of a start point and an end point of the corresponding edge;
[0162] According to the start event and end event, obtain the process start node and process end node;
[0163] Determine the longest sequential path from the process start node to the process end node according to the process start node, the process end node and the node pairs corresponding to the edges;
[0164] Using the longest sequential path as a process sequence node corresponding to the to-do driven process engine model;
[0165] According to the conditions in the conditional directed edge structure, the flow conditions between the nodes corresponding to the to-do driven process engine model are determined.
[0166] On the basis of the above-mentioned embodiment, the process engine file corresponding to the to-do driven process engine model is a process configuration table in SQL format, a process node configuration table in SQL format, a process node to-do configuration table in SQL format, and a to-do flow condition configuration table in SQL format; the process node configuration file corresponding to the to-do driven process engine model includes a process configuration file in CSV format, a process node configuration file in CSV format, a process node to-do configuration file in CSV format, and a to-do flow condition configuration file in CSV format;
[0167] Accordingly, when the determination module 203 determines the process node configuration file corresponding to the to-do driven process engine model based on the process sequence nodes, the flow conditions between the nodes and the element information, it is specifically used to:
[0168] Converting the process sequence nodes, the flow conditions between the nodes and the element information into array data;
[0169] According to the respective table fields of the process configuration table in SQL format, the process node configuration table in SQL format, the process node to-do configuration table in SQL format and the to-do flow condition configuration table in SQL format, the array data are traversed respectively to obtain single pieces of data corresponding to each table field one by one, and the obtained single pieces of data are written as CSV row data into the process configuration file in CSV format, the process node configuration file in CSV format, the process node to-do configuration file in CSV format and the to-do flow condition configuration file in CSV format respectively.
[0170] Based on the above embodiment, the file conversion module 204 is used to:
[0171] According to the mapping relationship between the CSV file name and the SQL data table name, the process configuration file in CSV format, the process node configuration file in CSV format, the process node to-do configuration file in CSV format and the to-do flow condition configuration file in CSV format are converted into the process configuration table in SQL format, the process node configuration table in SQL format, the process node to-do configuration table in SQL format and the to-do flow condition configuration table in SQL format.
[0172] Based on the above embodiment, before the second acquisition module 202 uses the BPMN parser to parse the BPMN process engine file and obtain the parsed product, the device further includes: establishing the BPMN parser module, which is specifically used to:
[0173] A BPMN parser is written based on PHP according to preset parsing product requirements; wherein the BPMN parser contains element names to be parsed corresponding to the preset parsing product requirements; wherein the BPMN parser parses the BPMN process engine file according to the element names to be parsed to obtain parsing products corresponding to the preset parsing product requirements.
[0174] The process engine automatic conversion device provided in the embodiment of the present invention can be specifically used to execute the process engine automatic conversion method of the above embodiment. Its technical principles and beneficial effects are similar. Please refer to the above embodiment for details, which will not be repeated here.
[0175] Based on the same inventive concept, an embodiment of the present invention provides an electronic device, see Figure 6, the electronic device specifically includes the following contents: a processor 301, a communication interface 303, a memory 302 and a communication bus 304;
[0176] Among them, the processor 301, the communication interface 303, and the memory 302 communicate with each other through the communication bus 304; the communication interface 303 is used to realize the information transmission between various modeling software and intelligent manufacturing equipment module libraries and other related devices; the processor 301 is used to call the computer program in the memory 302, and the processor implements the methods provided by the above-mentioned method embodiments when executing the computer program. For example, when the processor executes the computer program, the following steps are implemented: obtaining a BPMN process engine file corresponding to the BPMN process engine model; using a BPMN parser to parse the BPMN process engine file to obtain a parsed product; wherein the BPMN parser is a parser written in PHP based on preset parsed product requirements , used to parse the BPMN process engine file to generate the required parsing product; wherein the parsing product includes the element information in the BPMN process engine file; the element information is the process information required for establishing a to-do driven process engine model; the to-do driven process engine model is the model to be converted from the BPMN process engine model; based on the element information, determine the process node configuration file corresponding to the to-do driven process engine model; convert the process node configuration file into a process engine file corresponding to the to-do driven process engine model; based on the process engine file corresponding to the to-do driven process engine model, complete the conversion from the BPMN process engine model to the to-do driven process engine model.
[0177] Based on the same inventive concept, another embodiment of the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it is implemented to execute the methods provided by the above-mentioned method embodiments, for example, obtaining a BPMN process engine file corresponding to a BPMN process engine model; parsing the BPMN process engine file using a BPMN parser to obtain a parsed product; wherein the BPMN parser is a parser written in PHP based on preset parsed product requirements, and is used to parse the BPMN process engine file to generate the required parsed product; wherein the parsed product includes element information in the BPMN process engine file; the element information is the process information required to establish a to-do driven process engine model; the to-do driven process engine model is a model to be converted from the BPMN process engine model; based on the element information, determining a process node configuration file corresponding to the to-do driven process engine model; converting the process node configuration file into a process engine file corresponding to the to-do driven process engine model; and completing the conversion from the BPMN process engine model to the to-do driven process engine model based on the process engine file corresponding to the to-do driven process engine model.
[0178] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.
[0179] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.
[0180] In addition, in the present invention, terms such as "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0181] In addition, in the present invention, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0182] In addition, in the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0183] 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 make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A process engine automatic conversion method, characterized in that: include: Obtain the BPMN process engine file corresponding to the BPMN process engine model; The BPMN process engine file is parsed using a BPMN parser to obtain a parsed product; wherein the BPMN parser is a parser written in PHP based on preset parsed product requirements, and is used to parse the BPMN process engine file to generate a required parsed product; wherein the parsed product includes element information in the BPMN process engine file; the element information is process information required to establish a to-do driven process engine model; the to-do driven process engine model is a model to be converted from the BPMN process engine model; Based on the element information, determine the process node configuration file corresponding to the to-do driven process engine model; the process node configuration file corresponding to the to-do driven process engine model includes a process configuration file in CSV format, a process node configuration file in CSV format, a process node to-do configuration file in CSV format, and a to-do flow condition configuration file in CSV format; Convert the process node configuration file into a process engine file corresponding to the to-do driven process engine model; the process engine file corresponding to the to-do driven process engine model is a process configuration table in SQL format, a process node configuration table in SQL format, a process node to-do configuration table in SQL format, and a to-do flow condition configuration table in SQL format; Based on the process engine file corresponding to the to-do driven process engine model, completing the conversion from the BPMN process engine model to the to-do driven process engine model; The element information at least includes: to-do nodes, conditional directed edge structures and events; Based on the element information, a process node configuration file corresponding to the to-do driven process engine model is determined, including: Based on the to-do nodes, the conditional directed edge structure and the events, determine the process sequence nodes corresponding to the to-do driven process engine model and the flow conditions between the nodes; Determine a process node configuration file corresponding to the to-do driven process engine model based on the process sequence nodes, the flow conditions between the nodes, and the element information; The determining of the process node configuration file corresponding to the to-do driven process engine model based on the process sequence nodes, the flow conditions between the nodes and the element information includes: Converting the process sequence nodes, the flow conditions between the nodes and the element information into array data; According to the respective table fields of the process configuration table in SQL format, the process node configuration table in SQL format, the process node to-do configuration table in SQL format and the to-do flow condition configuration table in SQL format, the array data are traversed respectively to obtain single pieces of data corresponding to each table field one by one, and the obtained single pieces of data are written as CSV row data into the process configuration file in CSV format, the process node configuration file in CSV format, the process node to-do configuration file in CSV format and the to-do flow condition configuration file in CSV format respectively.
2. The process engine automatic conversion method according to claim 1, characterized in that: Based on the to-do nodes, the conditional directed edge structure and the events, the process sequence nodes corresponding to the to-do driven process engine model and the flow conditions between the nodes are determined, including: Parsing the conditional directed edge structure, and sequentially acquiring node pairs corresponding to the directed edges, wherein the node pairs consist of a start point and an end point of the corresponding edge; According to the start event and end event, obtain the process start node and process end node; Determine the longest sequential path from the process start node to the process end node according to the process start node, the process end node and the node pairs corresponding to the edges; Using the longest sequential path as a process sequence node corresponding to the to-do driven process engine model; According to the conditions in the conditional directed edge structure, the flow conditions between the nodes corresponding to the to-do driven process engine model are determined.
3. The process engine automatic conversion method according to claim 1, characterized in that: Converting the process node configuration file into a process engine file corresponding to the to-do driven process engine model includes: According to the mapping relationship between the CSV file name and the SQL data table name, the process configuration file in CSV format, the process node configuration file in CSV format, the process node to-do configuration file in CSV format and the to-do flow condition configuration file in CSV format are converted into the process configuration table in SQL format, the process node configuration table in SQL format, the process node to-do configuration table in SQL format and the to-do flow condition configuration table in SQL format.
4. The process engine automatic conversion method according to claim 1, characterized in that: Before using the BPMN parser to parse the BPMN process engine file and obtain the parsed product, the method further includes: a step of establishing the BPMN parser, specifically including: A BPMN parser is written based on PHP according to preset parsing product requirements; wherein the BPMN parser contains element names to be parsed corresponding to the preset parsing product requirements; wherein the BPMN parser parses the BPMN process engine file according to the element names to be parsed to obtain parsing products corresponding to the preset parsing product requirements.
5. A process engine automatic conversion device, characterized in that: include: A first acquisition module is used to acquire a BPMN process engine file corresponding to a BPMN process engine model; The second acquisition module is used to parse the BPMN process engine file using a BPMN parser to obtain a parsed product; wherein the BPMN parser is a parser written in PHP based on preset parsed product requirements, and is used to parse the BPMN process engine file to generate a required parsed product; wherein the parsed product includes element information in the BPMN process engine file; the element information is the process information required to establish a to-do driven process engine model; the to-do driven process engine model is a model to be converted from the BPMN process engine model; A determination module, used to determine a process node configuration file corresponding to the to-do driven process engine model based on the element information, wherein the process node configuration file corresponding to the to-do driven process engine model includes a process configuration file in CSV format, a process node configuration file in CSV format, a process node to-do configuration file in CSV format, and a to-do flow condition configuration file in CSV format; A file conversion module, used to convert the process node configuration file into a process engine file corresponding to the to-do driven process engine model, wherein the process engine file corresponding to the to-do driven process engine model is a process configuration table in SQL format, a process node configuration table in SQL format, a process node to-do configuration table in SQL format, and a to-do flow condition configuration table in SQL format; A model conversion module, used to complete the conversion from the BPMN process engine model to the to-do driven process engine model based on the process engine file corresponding to the to-do driven process engine model; The element information at least includes: to-do nodes, conditional directed edge structures and events; The determining module is used to: Based on the to-do nodes, the conditional directed edge structure and the events, determine the process sequence nodes corresponding to the to-do driven process engine model and the flow conditions between the nodes; Determine a process node configuration file corresponding to the to-do driven process engine model based on the process sequence nodes, the flow conditions between the nodes, and the element information; When the determination module determines the process node configuration file corresponding to the to-do driven process engine model based on the process sequence nodes, the flow conditions between the nodes and the element information, it is specifically used to: Converting the process sequence nodes, the flow conditions between the nodes and the element information into array data; According to the respective table fields of the process configuration table in SQL format, the process node configuration table in SQL format, the process node to-do configuration table in SQL format and the to-do flow condition configuration table in SQL format, the array data are traversed respectively to obtain single pieces of data corresponding to each table field one by one, and the obtained single pieces of data are written as CSV row data into the process configuration file in CSV format, the process node configuration file in CSV format, the process node to-do configuration file in CSV format and the to-do flow condition configuration file in CSV format respectively.
6. The process engine automatic conversion device according to claim 5, characterized in that: When the determination module determines the process sequence nodes corresponding to the to-do driven process engine model and the flow conditions between the nodes based on the to-do nodes, the conditional directed edge structure and the events, the determination module is specifically used to: Parsing the conditional directed edge structure, and sequentially acquiring node pairs corresponding to the directed edges, wherein the node pairs consist of a start point and an end point of the corresponding edge; According to the start event and end event, obtain the process start node and process end node; Determine the longest sequential path from the process start node to the process end node according to the process start node, the process end node and the node pairs corresponding to the edges; Using the longest sequential path as a process sequence node corresponding to the to-do driven process engine model; According to the conditions in the conditional directed edge structure, the flow conditions between the nodes corresponding to the to-do driven process engine model are determined.
7. The process engine automatic conversion device according to claim 5, characterized in that: The file conversion module is used to: According to the mapping relationship between the CSV file name and the SQL data table name, the process configuration file in CSV format, the process node configuration file in CSV format, the process node to-do configuration file in CSV format and the to-do flow condition configuration file in CSV format are converted into the process configuration table in SQL format, the process node configuration table in SQL format, the process node to-do configuration table in SQL format and the to-do flow condition configuration table in SQL format.
8. The process engine automatic conversion device according to claim 5, characterized in that: Before the second acquisition module uses the BPMN parser to parse the BPMN process engine file to obtain the parsed product, the device further includes: establishing the BPMN parser module, which is specifically used to: A BPMN parser is written based on PHP according to preset parsing product requirements; wherein the BPMN parser contains element names to be parsed corresponding to the preset parsing product requirements; wherein the BPMN parser parses the BPMN process engine file according to the element names to be parsed to obtain parsing products corresponding to the preset parsing product requirements.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the process engine automatic conversion method as described in any one of claims 1 to 4 are implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the process engine automatic conversion method as described in any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Workflow engine and implementation method thereof
CN103617066A
Procedure virtual machine
CN105204919A
Process engine implementation method and device
CN110659018A
A system and a method for generating web service customized based on business process
KR1020110114173A
Fixed Format Document Conversion Engine
US20130191732A1
