CN112230933A - Automatic process engine conversion method and device, electronic medium and storage medium - Google Patents

Automatic process engine conversion method and device, electronic medium and storage medium Download PDF

Info

Publication number
CN112230933A
CN112230933A CN202010976892.4A CN202010976892A CN112230933A CN 112230933 A CN112230933 A CN 112230933A CN 202010976892 A CN202010976892 A CN 202010976892A CN 112230933 A CN112230933 A CN 112230933A
Authority
CN
China
Prior art keywords
flow
node
bpmn
process engine
handled
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010976892.4A
Other languages
Chinese (zh)
Inventor
郑泽亮
高瑞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beike Technology Co Ltd
Original Assignee
Beike Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beike Technology Co Ltd filed Critical Beike Technology Co Ltd
Priority to CN202010976892.4A priority Critical patent/CN112230933A/en
Publication of CN112230933A publication Critical patent/CN112230933A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/51Source to source
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/151Transformation
    • G06F40/154Tree transformation for tree-structured or markup documents, e.g. XSLT, XSL-FO or stylesheets
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/35Creation or generation of source code model driven
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/37Compiler construction; Parser generation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Combined Controls Of Internal Combustion Engines (AREA)

Abstract

The embodiment of the invention provides a method and a device for automatically converting a process engine, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a BPMN process engine file corresponding to a BPMN standard process engine model; analyzing the BPMN process engine file to acquire element information in the BPMN process engine file; determining a process node configuration file corresponding to the to-be-handled driving process engine model based on the element information; converting the process node configuration file into a process engine file corresponding to the to-be-handled driving process engine model; and completing the conversion from the BPMN standard flow engine model to the to-be-handled driving flow engine model based on the flow engine file corresponding to the to-be-handled driving flow engine model. The embodiment of the invention automatically converts the BPMN standard process engine model into the to-be-handled driving process engine model, completes automatic process migration and improves the conversion efficiency among the process engine models.

Description

Automatic process engine conversion method and device, electronic medium and storage medium
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for automatically converting a process engine, electronic equipment and a storage medium.
Background
In the prior art, the process engine model conversion is carried out by manually looking at a process diagram of a BPMN process engine, then manually judging and manually simulating configuration processes and flows to be handled one by one, and no prior art can automatically convert a BPMN standard process engine model into a transaction self-research expression-based flow engine model to be handled.
The method for carrying out the process engine model migration through manual configuration seriously depends on manual work and is easy to make mistakes on one hand, and has large repeated workload and low efficiency on the other hand.
Disclosure of Invention
To solve the problems in the prior art, embodiments of the present invention provide a method and an apparatus for automatically converting a process engine, an electronic device, and a storage medium.
In a first aspect, an embodiment of the present invention provides an automatic flow engine conversion method, including:
acquiring a BPMN process engine file corresponding to the BPMN process engine model;
analyzing the BPMN process engine file by using a BPMN analyzer to obtain an analysis product; the BPMN resolver is a resolver written by PHP based on preset resolution product requirements and is used for resolving the BPMN process engine file to generate a required resolution product; wherein, the analysis product comprises element information in the BPMN process engine file; the element information is flow information required for establishing a to-be-handled driving flow engine model; the to-be-handled driving process engine model is a model to be converted from a BPMN process engine model;
determining a process node configuration file corresponding to the to-be-handled driving process engine model based on the element information;
converting the process node configuration file into a process engine file corresponding to the to-be-handled driving process engine model;
and completing the conversion from the BPMN process engine model to the to-be-handled driving process engine model based on the process engine file corresponding to the to-be-handled driving process engine model.
Further, the element information includes at least: a node to be handled, a conditional directed edge structure and an event;
correspondingly, determining a process node configuration file corresponding to the to-be-handled driving process engine model based on the element information, including:
determining flow sequence nodes corresponding to the to-be-handled driving flow engine model and flow conditions among the nodes based on the to-be-handled nodes, the conditional directed edge structures and the events;
and determining a process node configuration file corresponding to the to-be-handled driving process engine model based on the process sequence nodes, the circulation conditions among the nodes and the element information.
Further, determining flow sequence nodes corresponding to the to-do driven flow engine model and flow conditions among the nodes based on the to-do nodes, the conditional directed edge structure and the events, including:
analyzing the conditional directed edge structure, and acquiring node pairs corresponding to the directed edges according to the sequence, wherein the node pairs consist of starting points and end points of corresponding edges;
acquiring a process starting node and a process ending node according to a starting event and an ending event;
determining the longest sequential path from the process starting node to the process ending node according to the process starting node, the process ending node and the node pair corresponding to the edge;
taking the longest sequential path as a process sequential node corresponding to the to-be-handled driving process engine model;
and determining the circulation condition between the nodes corresponding to the to-be-handled driving process engine model according to the condition in the conditional directed edge structure.
Further, the process engine files corresponding to the to-be-handled driving process engine model are a process configuration table in an SQL format, a process node configuration table in the SQL format, a process node to-be-handled configuration table in the SQL format, and a to-be-handled flow condition configuration table in the SQL format; the process node configuration files corresponding to the to-do driving process engine model comprise a CSV-format process configuration file, a CSV-format process node to-do configuration file and a CSV-format to-do flow condition configuration file;
correspondingly, the determining a process node configuration file corresponding to the to-be-handled driven process engine model based on the process sequence node, the flow conditions among the nodes, and the element information includes:
converting flow sequence nodes, circulation conditions among the nodes and the element information into array data;
and respectively traversing the array data according to respective table fields of the SQL-formatted flow configuration table, the SQL-formatted flow node to-be-handled configuration table and the SQL-formatted flow condition configuration table, acquiring single data corresponding to the table fields one by one, and respectively writing the acquired single data serving as CSV line data into the CSV-formatted flow configuration file, the CSV-formatted flow node to-be-handled configuration file and the CSV-formatted flow condition configuration file correspondingly.
Further, converting the process node configuration file into a process engine file corresponding to the to-do driver process engine model, including:
and correspondingly converting the CSV-format flow configuration file, the CSV-format flow node to-be-handled configuration file and the CSV-format to-be-handled flow condition configuration file into an SQL-format flow configuration table, an SQL-format flow node to-be-handled configuration table and an SQL-format to-be-handled flow condition configuration table according to the mapping relation between the CSV file name and the SQL data table name.
Further, before the BPMN flow engine file is parsed by using a BPMN parser to obtain a parsing product, the method further includes: the step of establishing the BPMN resolver specifically comprises the following steps:
compiling a BPMN resolver based on PHP according to the requirement of a preset resolution product; the BPMN resolver comprises element names to be resolved corresponding to the preset resolution product requirements; and the BPMN resolver resolves the BPMN process engine file according to the element name to be resolved to obtain a resolution product corresponding to the preset resolution product requirement.
In a second aspect, an embodiment of the present invention provides an automatic flow engine conversion apparatus, including:
the first acquisition module is used for acquiring a BPMN process engine file corresponding to the BPMN process engine model;
the second acquisition module is used for analyzing the BPMN process engine file by using a BPMN analyzer to acquire an analysis product; the BPMN resolver is a resolver written by PHP based on preset resolution product requirements and is used for resolving the BPMN process engine file to generate a required resolution product; wherein, the analysis product comprises element information in the BPMN process engine file; the element information is flow information required for establishing a to-be-handled driving flow engine model; the to-be-handled driving process engine model is a model to be converted from a BPMN process engine model;
the determining module is used for determining a process node configuration file corresponding to the to-be-handled driving process engine model based on the element information;
the file conversion module is used for converting the process node configuration file into a process engine file corresponding to the to-be-handled drive process engine model;
and the model conversion module is used for completing the conversion from the BPMN process engine model to the to-be-handled driving process engine model based on the process engine file corresponding to the to-be-handled driving process engine model.
Further, the element information includes at least: a node to be handled, a conditional directed edge structure and an event;
accordingly, the determining module is configured to:
determining flow sequence nodes corresponding to the to-be-handled driving flow engine model and flow conditions among the nodes based on the to-be-handled nodes, the conditional directed edge structures and the events;
and determining a process node configuration file corresponding to the to-be-handled driving process engine model based on the process sequence nodes, the circulation conditions among the nodes and the element information.
Further, when the determining module executes the to-do node, the conditional directed edge structure, and the event, and determines the flow sequence node corresponding to the to-do driver flow engine model and the flow condition between the nodes, the determining module is specifically configured to:
analyzing the conditional directed edge structure, and acquiring node pairs corresponding to the directed edges according to the sequence, wherein the node pairs consist of starting points and end points of corresponding edges;
acquiring a process starting node and a process ending node according to a starting event and an ending event;
determining the longest sequential path from the process starting node to the process ending node according to the process starting node, the process ending node and the node pair corresponding to the edge;
taking the longest sequential path as a process sequential node corresponding to the to-be-handled driving process engine model;
and determining the circulation condition between the nodes corresponding to the to-be-handled driving process engine model according to the condition in the conditional directed edge structure.
Further, the process engine files corresponding to the to-be-handled driving process engine model are a process configuration table in an SQL format, a process node configuration table in the SQL format, a process node to-be-handled configuration table in the SQL format, and a to-be-handled flow condition configuration table in the SQL format; the process node configuration files corresponding to the to-do driving process engine model comprise a CSV-format process configuration file, a CSV-format process node to-do configuration file and a CSV-format to-do flow condition configuration file;
correspondingly, when the determining module executes the process node configuration file corresponding to the to-be-handled driver process engine model and determined based on the process sequence node, the flow conditions among the nodes, and the element information, the determining module is specifically configured to:
converting flow sequence nodes, circulation conditions among the nodes and the element information into array data;
and respectively traversing the array data according to respective table fields of the SQL-formatted flow configuration table, the SQL-formatted flow node to-be-handled configuration table and the SQL-formatted flow condition configuration table, acquiring single data corresponding to the table fields one by one, and respectively writing the acquired single data serving as CSV line data into the CSV-formatted flow configuration file, the CSV-formatted flow node to-be-handled configuration file and the CSV-formatted flow condition configuration file correspondingly.
Further, the file conversion module is configured to:
and correspondingly converting the CSV-format flow configuration file, the CSV-format flow node to-be-handled configuration file and the CSV-format to-be-handled flow condition configuration file into an SQL-format flow configuration table, an SQL-format flow node to-be-handled configuration table and an SQL-format to-be-handled flow condition configuration table according to the mapping relation between the CSV file name and the SQL data table name.
Further, before the second obtaining module uses a BPMN parser to parse the BPMN process engine file to obtain a parsing product, the apparatus further includes: establishing the BPMN resolver module, specifically configured to:
compiling a BPMN resolver based on PHP according to the requirement of a preset resolution product; the BPMN resolver comprises element names to be resolved corresponding to the preset resolution product requirements; and the BPMN resolver resolves the BPMN process engine file according to the element name to be resolved to obtain a resolution product corresponding to the preset resolution product requirement.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the automatic flow engine conversion method according to the first aspect when executing the program.
In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the flow engine automatic conversion method described in the first aspect.
It can be seen from the above technical solutions that, in the method, the apparatus, the electronic device, and the storage medium for automatically converting a process engine provided in the embodiments of the present invention, a BPMN process engine file is parsed by establishing a parser, so as to generate element information required for establishing a to-be-handled driving process engine model, a process node configuration file corresponding to the to-be-handled driving process engine model is determined according to the element information, and then the process node configuration file is converted into a process engine file corresponding to the to-be-handled driving process engine model based on a subsequent conversion algorithm, and the process engine file corresponding to the to-be-handled driving process engine model is used as a data basis for process engine conversion, so as to complete automatic conversion from the mn BPMN standard process engine model to the to-be-handled driving process engine model, and thus, the embodiments of the present invention do not need to manually perform conversion from the BPMN standard process engine, therefore, the conversion efficiency between the BPMN standard process engine model and the to-be-handled driving process engine model can be greatly improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic flow chart illustrating an automatic flow engine conversion method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a BPMN process engine file according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a BPMN flow engine file after parsing according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart illustrating an automatic conversion method for a flow engine according to another embodiment of the present invention;
fig. 5 is a schematic structural diagram of an automatic flow engine conversion device according to an embodiment of the present invention;
fig. 6 is a schematic physical structure diagram of an electronic device according to an embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some embodiments, but not all embodiments, of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the prior art, when switching between a BPMN standard flow engine model and a to-be-handled driving flow engine model, manual configuration needs to be carried out, namely, a flow chart of the BPMN flow engine needs to be seen manually, then judgment is carried out according to the flow chart, and configuration flows and to-be-handled flows are simulated manually one by one, so that the prior art is seriously dependent on manual work, is easy to make mistakes, has more repeated work in actual operation and low efficiency, therefore, the invention analyzes the BPMN flow engine file by establishing an analyzer, generates element information required by establishing the to-be-handled driving flow engine model, determines a flow node configuration file corresponding to the to-be-handled driving flow engine model through the element information, and converts the flow node configuration file into a flow engine file corresponding to the to-be-handled driving flow engine model based on a subsequent conversion algorithm, and then, taking the process engine file corresponding to the to-be-handled driving process engine model as a data basis for process engine conversion, and completing automatic conversion from the BPMN standard process engine model to the to-be-handled driving process engine model. The automatic flow engine conversion method provided by the present invention will be explained and explained in detail by specific embodiments.
Fig. 1 is a schematic flow chart illustrating an automatic flow engine conversion method according to an embodiment of the present invention; as shown in fig. 1, the method includes:
step 101: and acquiring a BPMN process engine file corresponding to the BPMN process engine model.
In this step, it should be noted that the english spelling of BPMN is Business Process Modeling Notation, which means the Business Process Modeling Notation. The main goal of BPMN is to provide a suite of markup languages understood by all business users, including business analysts, software developers, and business managers and supervisors. The BPMN establishes a standardized bridge between the design of the business process and the realization of the process. It can be seen that BPMN is a common and standard language for process modeling, and that BPMN is a symbolic language, just as any language is used for purposes of facilitating communication and understanding of business processes. The purpose of modeling using BPMN is to use BPMN to draw a flow diagram to better understand business processes and interrelationships between departments. For example, one of the greatest advantages of BPMN2.0 is the elimination of communication gaps between business personnel and IT technicians. The "N" of BPMN stands for "symbol" (Notation). These graphical symbols consist of behavior symbols for flow activities, flow lanes, or events. Since the first version of BPMN specifications released by OMG in 5 months 2004, these visual symbols have been used as part of the standard, and have been used to date as specifications and standards for process management. BPMN is the graphic expression + XML, and BPMN2.0 makes BPMN not only a beautiful graphic expression, more accurately describes many vague problems among the business processes through introducing XML. Each BPMN object is defined through XML, so that each graph can be clearly expressed by the BPMN in a normative mode no matter the graph is a flow model or all objects in the flow model. It should be noted that the BPMN flow designer can automatically generate XML.
In this step, it should be noted that the BPMN flow engine file corresponding to the BPMN (standard) flow engine model is a standard BPMN file (as shown in fig. 2), and the purpose of obtaining the BPMN flow engine file corresponding to the BPMN standard flow engine model in this step is to facilitate analyzing the BPMN flow engine file in step 102 and further obtain the element information included in the BPMN flow engine file.
Step 102: analyzing the BPMN process engine file by using a BPMN analyzer to obtain an analysis product;
in this step, the BPMN parser is a parser compiled by PHP based on a preset parsing product requirement, and is configured to parse the BPMN process engine file to generate a required parsing product; wherein, the analysis product comprises element information in the BPMN process engine file; the element information is flow information required for establishing a to-be-handled driving flow engine model; the to-do driving process engine model is a model to be converted from the BPMN process engine model.
In this step, it should be noted that the BPMN is a modeling standard, and in the prior art, the BPMN analysis is based on the operation of the activiti engine, and an analysis product cannot be output, so that automatic conversion from the BPMN (standard) process engine model to the to-be-handled driver process engine model cannot be realized. In order to solve the problem, a BPMN parser is written based on PHP according to a preset parsing product requirement, and then the BPMN parser is used to parse the BPMN flow engine file to generate a required parsing product, so that element information (the parsing product is element information) included in the BPMN flow engine file can be obtained, and then, based on the element information, a flow node configuration file corresponding to a to-be-handled driving flow engine model can be established, so that automatic conversion from the BPMN (standard) flow engine model to the to-be-handled driving flow engine model can be completed.
In this embodiment, it should be noted that, when the BPMN parser is written, the BPMN parser may be written based on a public domstem parser of the PHP, and specifically, a tag name (TagName) of a BPMN process engine file to be parsed and each element name (ElementName) corresponding to a preset parsing product requirement need to be set in the domstem parser. For example, each element name corresponding to the predetermined parsing product requirement includes: a flow name (workFlowName), a start event (startEvent), an end event (endEvent), a to-do (userTask), a sequential edge structure (sequencoflow), and the like. And then loading the BPMN process engine file to be analyzed by using the analyzer for analysis, and acquiring corresponding element information in the BPMN process engine file according to the element name in the analysis process.
In this embodiment, it should be noted that the DOM parsing library parses all contents of the file and does not filter the contents, and the PHP-based DOM parsing library supports reading, configuring, parsing, and classifying the concerned contents, thereby facilitating subsequent analysis processing.
In the embodiment, the BPMN is a modeling standard, and in the prior art, the BPMN is analyzed based on the operation of an activiti engine, cannot output an analysis product, and only supports java language; the BPMN resolver realized based on PHP has the advantages that the required resolution product can be generated in a customized mode, the language is not limited, and then the resolution product is converted into a flow engine file corresponding to a to-be-handled driving flow engine model of transaction self-research based on a subsequent conversion algorithm.
Referring to fig. 3, after the BPMN parser is used to parse the BPMN flow engine file, the parsing products shown in fig. 3 may be generated, where the parsing products include various element information, and based on the element information, the flow information required for establishing the to-be-handled driving flow engine model may be determined. For example, based on the element information of the to-do node, the conditional directed edge structure and the event, the flow information required for establishing the to-do driven flow engine model may be determined, for example: flow sequence nodes and flow conditions among the nodes, and the like.
It can be understood that, in this step, a BPMN parser needs to be established first, and then the BPMN parser is used to parse the BPMN flow engine file to obtain a parsed product, where the parsed product is element information included in the BPMN flow engine file, and since the element information includes nodes to be handled, conditional directional edge structures, participants, events, and the like, the flow information required for establishing the to-be-handled driving flow engine model can be obtained according to the element information.
Step 103: and determining a process node configuration file corresponding to the to-be-handled driving process engine model based on the element information.
In this step, after obtaining the element information included in the BPMN (standard) flow engine model, based on the element information, the flow information required for establishing the to-do driver flow engine model may be determined, and further based on the flow information, the flow node configuration file corresponding to the to-do driver flow engine model may be determined.
For example, based on the element information of the to-do node, the conditional directed edge structure and the event, the flow information required for establishing the to-do driven flow engine model can be determined, for example: analyzing the conditional directed edge structure, and acquiring node pairs corresponding to each directed edge according to the sequence, wherein each node pair consists of a starting point and an end point of the corresponding edge; acquiring a process starting node and a process ending node according to a starting event and an ending event; determining the longest sequential path from the process starting node to the process ending node according to the process starting node, the process ending node and the node pair corresponding to each edge; taking the longest sequential path as a process sequential node corresponding to the to-be-handled driving process engine model; determining a flow condition between each node corresponding to the to-be-handled driving flow engine model according to the condition in the conditional directed edge structure, and further determining a flow node configuration file in a CSV format corresponding to the to-be-handled driving flow engine model based on the flow sequence nodes, the flow condition between each node, the participator in the element information, and the like, for example, the flow node configuration file in the CSV format, the flow node to-be-handled configuration file in the CSV format, and the flow condition configuration file in the CSV format.
It can be understood that, for convenience of processing, the above processing procedure "may be used to analyze the conditional directed edge structure, and obtain node pairs corresponding to each directed edge in order, where each node pair is composed of a start point and an end point of a corresponding edge; acquiring a process starting node and a process ending node according to a starting event and an ending event; determining the longest sequential path from the process starting node to the process ending node according to the process starting node, the process ending node and the node pair corresponding to each edge; taking the longest sequential path as a process sequential node corresponding to the to-be-handled driving process engine model; and determining the flow conditions among the nodes corresponding to the to-be-handled driving flow engine model to be written into a flow sequence node generator according to the conditions in the conditional directed edge structure, and then processing the element information obtained by analysis by using the flow sequence node generator so as to obtain the flow sequence nodes corresponding to the to-be-handled driving flow engine model and the flow conditions among the nodes.
Step 104: and converting the process node configuration file into a process engine file corresponding to the to-be-handled driving process engine model.
In this step, a preset conversion algorithm may be used to convert the process node configuration file into a process engine file corresponding to the to-be-handled driver process engine model. It can be understood that the flow engine file corresponding to the to-do driven flow engine model is generally a data table in SQL format, and includes, for example: a flow node configuration table in SQL format, a flow node to-be-handled configuration table in SQL format and a flow condition configuration table in SQL format; the process node configuration file corresponding to the to-do driver process engine model is generally a file in a CSV format, for example, a flow configuration file in CSV format, a flow node to-do configuration file in CSV format, and a to-do stream condition configuration file in CSV format, and thus, the mapping relationship between the CSV file name and the SQL data table name may be established in a preset conversion algorithm, then according to the mapping relation between the CSV file name and the SQL data table name, the flow configuration file in the CSV format, the flow node to-do configuration file in the CSV format and the to-do flow condition configuration file in the CSV format are processed, and correspondingly converting the flow configuration table into an SQL format, the flow node configuration table in the SQL format, the flow node to-be-handled configuration table in the SQL format and the flow condition configuration table in the SQL format.
Step 105: and completing the conversion from the BPMN process engine model to the to-be-handled driving process engine model based on the process engine file corresponding to the to-be-handled driving process engine model.
In this step, since the process engine file corresponding to the to-do driver process engine model is generated, a data base is provided, so that automatic conversion from the BPMN (standard) process engine model to the to-do driver process engine model can be realized.
In this embodiment, referring to the flowchart shown in fig. 4, after obtaining the process engine file corresponding to the to-do driver process engine model, an online test may be performed by using the process engine file to detect whether the to-do driver process engine model can be automatically generated, and if the test is passed, the to-do driver process engine file is pushed to a production environment, so that the to-do driver process engine model for self-research of the transaction is configured online.
As can be seen from the above technical solutions, in the method for automatically converting a process engine provided in the embodiments of the present invention, an analyzer is established to analyze a BPMN process engine file, to generate element information required to establish a to-be-handled driven process engine model, a process node configuration file corresponding to the to-be-handled driven process engine model is determined according to the element information, then the process node configuration file is converted into a process engine file corresponding to the to-be-handled driven process engine model based on a subsequent conversion algorithm, and the process engine file corresponding to the to-be-handled driven process engine model is used as a data basis for process engine conversion, so as to complete automatic conversion from the BPMN (standard) process engine model to the to-be-handled driven process engine model. Therefore, according to the embodiment, the conversion from the BPMN (standard) process engine model to the to-be-handled driving process engine model is not required to be performed manually, so that the conversion efficiency between the BPMN (standard) process engine model and the to-be-handled driving process engine model can be greatly improved.
On the basis of the above embodiment, in the present embodiment, the element information at least includes: a node to be handled, a conditional directed edge structure and an event;
correspondingly, determining a process node configuration file corresponding to the to-be-handled driving process engine model based on the element information, including:
determining flow sequence nodes corresponding to the to-be-handled driving flow engine model and flow conditions among the nodes based on the to-be-handled nodes, the conditional directed edge structures and the events;
and determining a process node configuration file corresponding to the to-be-handled driving process engine model based on the process sequence nodes, the circulation conditions among the nodes and the element information.
In this embodiment, element information such as a to-be-handled node, a conditional directed edge structure, and an event is processed, and the processing method includes analyzing the conditional directed edge structure, obtaining a flow start node, a flow end node, and a node pair corresponding to each edge, determining a flow order node corresponding to a to-be-handled driving flow engine model, determining a flow condition among nodes corresponding to the to-be-handled driving flow engine model, converting the flow order node, the flow condition among nodes, and the element information into array data, and determining a flow node configuration file corresponding to the to-be-handled driving flow engine model.
In this embodiment, for example, the to-be-handled nodes, the conditional directed edge structure, and the events are used as data bases, a priority traversal algorithm is used to establish a flow sequence node generator, generate flow sequence nodes required by the to-be-handled driver flow engine model and a to-be-handled driver flow basic framework, automatically generate a to-be-handled driver flow node sequence, determine flow sequence nodes, and determine a flow node configuration file corresponding to the to-be-handled driver flow engine model.
As can be seen from the foregoing technical solutions, the method for automatically converting a process engine provided in the embodiment of the present invention determines, based on the to-do node, the conditional directed edge structure, and the event, a process sequence node corresponding to the to-do driven process engine model and a flow condition between the nodes, including:
analyzing the conditional directed edge structure, and acquiring node pairs corresponding to the directed edges according to the sequence, wherein the node pairs consist of starting points and end points of corresponding edges;
acquiring a process starting node and a process ending node according to a starting event and an ending event;
determining the longest sequential path from the process starting node to the process ending node according to the process starting node, the process ending node and the node pair corresponding to the edge;
taking the longest sequential path as a process sequential node corresponding to the to-be-handled driving process engine model;
and determining the circulation condition between the nodes corresponding to the to-be-handled driving process engine model according to the condition in the conditional directed edge structure.
In this embodiment, the generation process of the longest sequential path is described as follows:
i, firstly resolving a sequence flow (a directional edge structure with conditions) to obtain nodes (a, P1), (P1, B), (a, C), (B, P3), (P3, D), (C, D), (D, P4), (P4, E) "of the structure, wherein a comma in brackets is a starting point on the left and an end point on the right, and the to-be-handled drive flows are to be handled one by one, sequentially writing the nodes into a LinkedHashSet list of the graph (the basic structure is used for keeping the insertion sequence), acquiring a starting node of the flow and an ending node of the flow through a startEvent and an end event (the starting event and the ending event are to be handled and ended respectively), namely adding A as the starting node of the flow, adding E as the ending node of the flow, initializing the graph, converting the problem into a longest path from A to E, and filtered to non-to-do nodes.
And II, finding all paths based on the improved customized depth-first traversal algorithm, and then selecting the longest path from the paths. The detailed steps are as follows:
def finds all paths (graph, start, end) from the start point to the end point in the flow chart:
defining a visited variable and initializing the visited variable into a stack;
adding a first node as a start (an incoming starting point) in the visited stack;
defining a nodestack list, initializing the nodestack list into an empty list, and storing a nearest node of a current path;
defining an indexstack list, initializing the indexstack list into an empty list, and storing indexes of all neighbor nodes of each node in nodestack;
defining a variable current and initializing to start (the starting point of the incoming);
defining an index variable i and initializing to 0;
and (3) starting a cycle:
note #: acquiring all neighbor nodes of current node
Defining variables neighbors, assigning a value of graph [ current ]
And starting to circularly traverse all the neighbor nodes, and adding 1 to i each time until the traversal is completed:
if the last neighbor node has been reached:
removing the current node from the visted stack;
if nodestack list length is less than 1: the loop is terminated;
a node is popped from the nodestack list and is assigned to a current variable;
popping a node from indexstack, and assigning a value to an index variable i;
if the end is found in the neighbor node (namely the end is reached, a path from the start to the end is found);
printing out the path, namely all nodes of nodestack + current + end nodes, and filtering out nodes with types of non-to-do;
the index variable i is self-increased by 1;
otherwise, the following steps are carried out:
stacking current nodes in a nodestack list;
stacking an i +1 index in an indexstack list;
adding neighbor [ i ] nodes in the visited stack;
assigning a current variable to neighbor [ i ];
the assignment index i is 0;
circularly acquiring the lengths of all paths, and printing the path with the largest length;
all paths from the starting point to the end point in the flowchart can be traversed through the above steps, for example, if "ABCDE", "ABDE" and "ACDE" are acquired, then the longest path, that is, the "ABCDE" flow sequence node is acquired from the acquired paths, and is used as the flow sequence node corresponding to the to-be-handled driving flow engine model.
And III, finally merging conditions of directed line segments in the sequence flow (directed edge structure with conditions) to generate a flow condition list between the nodes to be handled (A-B-C-D-E), merging the obtained sequence flow node list and the flow condition list to generate a JSON file, and determining the flow conditions between the nodes corresponding to the engine model of the drive flow to be handled according to the conditions in the sequence flow (directed edge structure with conditions).
As can be seen from the above technical solutions, in the automatic flow engine conversion method provided in the embodiments of the present invention, the conditional directed edge structure is analyzed, node pairs corresponding to each directed edge are obtained in order, and each node pair is composed of a start point and an end point of a corresponding edge; acquiring a process starting node and a process ending node according to a starting event and an ending event; determining the longest sequential path from the process starting node to the process ending node according to the process starting node, the process ending node and the node pair corresponding to the edge; taking the longest sequential path as a process sequential node corresponding to the to-be-handled driving process engine model; and determining the circulation condition among the nodes corresponding to the to-be-handled driving flow engine model according to the condition in the conditional directed edge structure, thereby determining the flow sequence node corresponding to the to-be-handled driving flow engine model and the circulation condition among the nodes.
On the basis of the foregoing embodiment, in this embodiment, the process engine file corresponding to the to-be-handled driving process engine model is a process configuration table in an SQL format, a process node configuration table in the SQL format, a process node to-be-handled configuration table in the SQL format, and a to-be-handled flow condition configuration table in the SQL format; the process node configuration files corresponding to the to-do driving process engine model comprise a CSV-format process configuration file, a CSV-format process node to-do configuration file and a CSV-format to-do flow condition configuration file;
correspondingly, the determining a process node configuration file corresponding to the to-be-handled driven process engine model based on the process sequence node, the flow conditions among the nodes, and the element information includes:
converting flow sequence nodes, circulation conditions among the nodes and the element information into array data;
and respectively traversing the array data according to respective table fields of the SQL-formatted flow configuration table, the SQL-formatted flow node to-be-handled configuration table and the SQL-formatted flow condition configuration table, acquiring single data corresponding to the table fields one by one, and respectively writing the acquired single data serving as CSV line data into the CSV-formatted flow configuration file, the CSV-formatted flow node to-be-handled configuration file and the CSV-formatted flow condition configuration file correspondingly.
In this embodiment, it should be noted that, when determining the flow node configuration file corresponding to the to-do driver flow engine model based on the flow sequence nodes, the flow conditions among the nodes, and the element information, the following specific method may be used:
converting flow sequence nodes, flow conditions among the nodes and the element information into array data, traversing the array data according to respective table fields of a flow configuration table in an SQL format, a flow node configuration table in the SQL format, a flow node to-be-handled configuration table in the SQL format and a flow condition to-be-handled configuration table in the SQL format, acquiring single data corresponding to the table fields one by one, and writing the acquired single data serving as CSV data into a flow configuration file in the CSV format, a flow node to-be-handled configuration file in the CSV format and a flow condition configuration file in the CSV format.
Specifically, the PHP may be configured with an array of "flow order nodes, flow conditions between nodes, and the element information" through a json _ decode () function, and then recursively traverse the configuration array in sequence, flatten the configuration array into single data corresponding to each table field one by one, for example, flatten the single data corresponding to a MySQL data table field one by one, write the obtained single data into a row of CSV configuration as CSV row data, and then write the CSV row data into the CSV-formatted flow configuration file, the CSV-formatted flow node configuration file, and the CSV-formatted flow condition configuration file, according to the latitudes of different data tables.
In this embodiment, it should be noted that the flow sequence nodes, the circulation conditions among the nodes, and the element information are obtained, converted into array data, converted into the flow node configuration file corresponding to the to-be-handled driver flow engine model through the flow configuration file conversion. Wherein, the 'flow node configuration file conversion' is a configuration file conversion script, which obtains element information, generated flow sequence nodes and flow conditions among the nodes, and converts the element information, the generated flow sequence nodes and the flow conditions into a transaction self-research flow engine CSV configuration file, because the flow engine configuration of the to-be-handled drive flow engine model is a plurality of data tables based on MySQL, and each table is one piece of data, in order to conveniently import the database, array is configured for the element information and the like through a function json _ decode () based on PHP, then the array data is traversed in sequence and recurrently, flattened (flatten) into single data corresponding to the MySQL data table fields one by one, one row configuration of the CSV is directly written, finally, CSV files of a plurality of transaction configuration tables (such as a flow table, a flow node table and a to-be-handled flow condition table) are generated according to the dimensions of different data tables, the file names of the CSV are data tables, for subsequent configuration file import.
As can be seen from the above technical solutions, in the automatic flow engine conversion method provided in the embodiments of the present invention, the flow sequence nodes, the flow conditions among the nodes, and the element information are converted into array data, the array data are respectively traversed according to the table fields of the SQL-format flow configuration table, the SQL-format flow node to-be-handled configuration table, and the SQL-format to-be-handled flow condition configuration table, to obtain single data corresponding to the table fields one by one, and the obtained single data are respectively written as data of the CSV into the CSV-format flow configuration file, the CSV-format flow node to-be-handled configuration file, and the CSV-format to-be-handled flow condition configuration file, so as to subsequently write the CSV-format flow configuration file, the CSV-format flow node configuration file, and the CSV, The flow node to-be-handled configuration file in the CSV format and the flow condition configuration file in the CSV format are correspondingly converted into a flow engine file corresponding to the to-be-handled driving flow engine model (the flow engine file corresponding to the to-be-handled driving flow engine model includes a flow configuration table in the SQL format, a flow node to-be-handled configuration table in the SQL format, and a flow condition configuration table in the SQL format).
On the basis of the foregoing embodiment, in this embodiment, converting the process node configuration file into a process engine file corresponding to the to-do driver process engine model includes:
and correspondingly converting the CSV-format flow configuration file, the CSV-format flow node to-be-handled configuration file and the CSV-format to-be-handled flow condition configuration file into an SQL-format flow configuration table, an SQL-format flow node to-be-handled configuration table and an SQL-format to-be-handled flow condition configuration table according to the mapping relation between the CSV file name and the SQL data table name.
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, according to the mapping relationship between the CSV file name and the SQL data table name, a flow configuration file in a CSV format, a flow node to-be-handled configuration file in a CSV format, and a flow condition configuration file to-be-handled in a CSV format are correspondingly converted into a flow configuration table in an SQL format, a flow node to-be-handled configuration table in an SQL format, and a flow condition configuration table in an SQL format.
In this embodiment, it should be noted that, the multiple generated transaction configuration table CSV files may be read cyclically in rows and columns by using an fgettcsv () function, and according to a mapping relationship between a CSV file name and an SQL data table name, a SQL of insert of MySQL may be generated and sequentially written into each configuration table, where the configuration tables include a flow configuration table in an SQL format, a flow node to-be-handled configuration table in an SQL format, and a flow condition configuration table in an SQL format.
As can be seen from the foregoing technical solutions, according to the mapping relationship between the CSV file name and the SQL data table name, the method for automatically converting a flow engine provided in the embodiment of the present invention realizes the conversion between the CSV format file and the corresponding SQL format data table, thereby providing data support for realizing the automatic conversion between the BPMN (standard) flow engine model and the to-be-handled driving flow engine model.
On the basis of the foregoing embodiment, in this embodiment, before analyzing the BPMN flow engine file by using a BPMN analyzer to obtain an analysis product, the method further includes: the step of establishing the BPMN resolver specifically comprises the following steps:
compiling a BPMN resolver based on PHP according to the requirement of a preset resolution product; the BPMN resolver comprises element names to be resolved corresponding to the preset resolution product requirements; and the BPMN resolver resolves the BPMN process engine file according to the element name to be resolved to obtain a resolution product corresponding to the preset resolution product requirement.
In this embodiment, it should be noted that, when the BPMN parser is written, the BPMN parser may be written based on a public domstem parser of the PHP, and specifically, a tag name (TagName) of a BPMN process engine file to be parsed and each element name (ElementName) corresponding to a preset parsing product requirement need to be set in the domstem parser. For example, each element name corresponding to the predetermined parsing product requirement includes: a flow name (workFlowName), a start event (startEvent), an end event (endEvent), a to-do (userTask), a sequential edge structure (sequencoflow), and the like. And then loading the BPMN process engine file to be analyzed by using the analyzer for analysis, and acquiring corresponding element information in the BPMN process engine file according to the element name in the analysis process.
In this embodiment, it should be noted that the DOM parsing library parses all contents of the file and does not filter the contents, and the PHP-based DOM parsing library supports reading, configuring, parsing, and classifying the concerned contents, thereby facilitating subsequent analysis processing.
In the embodiment, the BPMN is a modeling standard, and in the prior art, the BPMN is analyzed based on the operation of an activiti engine, cannot output an analysis product, and only supports java language; the BPMN resolver realized based on PHP has the advantages that the required resolution product can be generated in a customized mode, the language is not limited, and then the resolution product is converted into a flow engine file corresponding to a to-be-handled driving flow engine model of transaction self-research based on a subsequent conversion algorithm.
Fig. 5 is a schematic structural diagram of an automatic flow engine conversion apparatus according to an embodiment of the present invention, and as shown in fig. 5, the apparatus includes: a first obtaining module 201, a second obtaining module 202, a determining module 203, a file converting module 204, and a model converting module 205, wherein:
the first obtaining module 201 is configured to obtain a BPMN flow engine file corresponding to the BPMN flow engine model;
the second obtaining module 202 is configured to analyze the BPMN process engine file by using a BPMN analyzer, and obtain an analysis product; the BPMN resolver is a resolver written by PHP based on preset resolution product requirements and is used for resolving the BPMN process engine file to generate a required resolution product; wherein, the analysis product comprises element information in the BPMN process engine file; the element information is flow information required for establishing a to-be-handled driving flow engine model; the to-be-handled driving process engine model is a model to be converted from a BPMN process engine model;
a determining module 203, configured to determine, based on the element information, a process node configuration file corresponding to the to-be-handled driving process engine model;
the file conversion module 204 is configured to convert the process node configuration file into a process engine file corresponding to the to-be-handled driving process engine model;
the model conversion module 205 is configured to complete conversion from the BPMN flow engine model to the to-do driver flow engine model based on the flow engine file corresponding to the to-do driver flow engine model.
On the basis of the above embodiment, the factor information includes at least: a node to be handled, a conditional directed edge structure and an event;
accordingly, the determining module 203 is configured to:
determining flow sequence nodes corresponding to the to-be-handled driving flow engine model and flow conditions among the nodes based on the to-be-handled nodes, the conditional directed edge structures and the events;
and determining a process node configuration file corresponding to the to-be-handled driving process engine model based on the process sequence nodes, the circulation conditions among the nodes and the element information.
On the basis of the foregoing embodiment, when the determining module 203 executes the to-do node, the conditional directed edge structure, and the event, and determines the flow sequence node corresponding to the to-do driven flow engine model and the flow condition between the nodes, it is specifically configured to:
analyzing the conditional directed edge structure, and acquiring node pairs corresponding to the directed edges according to the sequence, wherein the node pairs consist of starting points and end points of corresponding edges;
acquiring a process starting node and a process ending node according to a starting event and an ending event;
determining the longest sequential path from the process starting node to the process ending node according to the process starting node, the process ending node and the node pair corresponding to the edge;
taking the longest sequential path as a process sequential node corresponding to the to-be-handled driving process engine model;
and determining the circulation condition between the nodes corresponding to the to-be-handled driving process engine model according to the condition in the conditional directed edge structure.
On the basis of the above embodiment, the process engine files corresponding to the to-be-handled driving process engine model are a process configuration table in an SQL format, a process node configuration table in the SQL format, a process node to-be-handled configuration table in the SQL format, and a to-be-handled flow condition configuration table in the SQL format; the process node configuration files corresponding to the to-do driving process engine model comprise a CSV-format process configuration file, a CSV-format process node to-do configuration file and a CSV-format to-do flow condition configuration file;
correspondingly, when the determining module 203 determines the process node configuration file corresponding to the to-be-handled driver process engine model based on the process sequence node, the flow condition among the nodes, and the element information, the determining module is specifically configured to:
converting flow sequence nodes, circulation conditions among the nodes and the element information into array data;
and respectively traversing the array data according to respective table fields of the SQL-formatted flow configuration table, the SQL-formatted flow node to-be-handled configuration table and the SQL-formatted flow condition configuration table, acquiring single data corresponding to the table fields one by one, and respectively writing the acquired single data serving as CSV line data into the CSV-formatted flow configuration file, the CSV-formatted flow node to-be-handled configuration file and the CSV-formatted flow condition configuration file correspondingly.
On the basis of the foregoing embodiment, the file conversion module 204 is configured to:
and correspondingly converting the CSV-format flow configuration file, the CSV-format flow node to-be-handled configuration file and the CSV-format to-be-handled flow condition configuration file into an SQL-format flow configuration table, an SQL-format flow node to-be-handled configuration table and an SQL-format to-be-handled flow condition configuration table according to the mapping relation between the CSV file name and the SQL data table name.
On the basis of the foregoing embodiment, before the second obtaining module 202 uses a BPMN parser to parse the BPMN flow engine file to obtain a parsed product, the apparatus further includes: establishing the BPMN resolver module, specifically configured to:
compiling a BPMN resolver based on PHP according to the requirement of a preset resolution product; the BPMN resolver comprises element names to be resolved corresponding to the preset resolution product requirements; and the BPMN resolver resolves the BPMN process engine file according to the element name to be resolved to obtain a resolution product corresponding to the preset resolution product requirement.
The automatic flow engine conversion device provided in the embodiment of the present invention may be specifically used to execute the automatic flow engine conversion method in the above embodiments, and the technical principle and the beneficial effects thereof are similar, and reference may be specifically made to the above embodiments, and details are not described here.
Based on the same inventive concept, an embodiment of the present invention provides an electronic device, which specifically includes the following components, with reference to fig. 6: a processor 301, a communication interface 303, a memory 302, and a communication bus 304;
the processor 301, the communication interface 303 and the memory 302 complete mutual communication through the communication bus 304; the communication interface 303 is used for realizing information transmission between related devices such as modeling software, an intelligent manufacturing equipment module library and the like; the processor 301 is used for calling the computer program in the memory 302, and the processor executes the computer program to implement the method provided by the above method embodiments, for example, the processor executes the computer program to implement the following steps: acquiring a BPMN process engine file corresponding to the BPMN process engine model; analyzing the BPMN process engine file by using a BPMN analyzer to obtain an analysis product; the BPMN resolver is a resolver written by PHP based on preset resolution product requirements and is used for resolving the BPMN process engine file to generate a required resolution product; wherein, the analysis product comprises element information in the BPMN process engine file; the element information is flow information required for establishing a to-be-handled driving flow engine model; the to-be-handled driving process engine model is a model to be converted from a BPMN process engine model; determining a process node configuration file corresponding to the to-be-handled driving process engine model based on the element information; converting the process node configuration file into a process engine file corresponding to the to-be-handled driving process engine model; and completing the conversion from the BPMN process engine model to the to-be-handled driving process engine model based on the process engine file corresponding to the to-be-handled driving process engine model.
Based on the same inventive concept, another embodiment of the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program is implemented to perform the methods provided by the above method embodiments when executed by a processor, for example, obtaining a BPMN flow engine file corresponding to a BPMN flow engine model; analyzing the BPMN process engine file by using a BPMN analyzer to obtain an analysis product; the BPMN resolver is a resolver written by PHP based on preset resolution product requirements and is used for resolving the BPMN process engine file to generate a required resolution product; wherein, the analysis product comprises element information in the BPMN process engine file; the element information is flow information required for establishing a to-be-handled driving flow engine model; the to-be-handled driving process engine model is a model to be converted from a BPMN process engine model; determining a process node configuration file corresponding to the to-be-handled driving process engine model based on the element information; converting the process node configuration file into a process engine file corresponding to the to-be-handled driving process engine model; and completing the conversion from the BPMN process engine model to the to-be-handled driving process engine model based on the process engine file corresponding to the to-be-handled driving process engine model.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods of the various embodiments or some parts of the embodiments.
In addition, in the present invention, terms such as "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Moreover, in the present invention, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Furthermore, in the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A process engine automatic conversion method is characterized by comprising the following steps:
acquiring a BPMN process engine file corresponding to the BPMN process engine model;
analyzing the BPMN process engine file by using a BPMN analyzer to obtain an analysis product; the BPMN resolver is a resolver written by PHP based on preset resolution product requirements and is used for resolving the BPMN process engine file to generate a required resolution product; wherein, the analysis product comprises element information in the BPMN process engine file; the element information is flow information required for establishing a to-be-handled driving flow engine model; the to-be-handled driving process engine model is a model to be converted from a BPMN process engine model;
determining a process node configuration file corresponding to the to-be-handled driving process engine model based on the element information;
converting the process node configuration file into a process engine file corresponding to the to-be-handled driving process engine model;
and completing the conversion from the BPMN process engine model to the to-be-handled driving process engine model based on the process engine file corresponding to the to-be-handled driving process engine model.
2. The process engine automatic conversion method according to claim 1, wherein the element information includes at least: a node to be handled, a conditional directed edge structure and an event;
correspondingly, determining a process node configuration file corresponding to the to-be-handled driving process engine model based on the element information, including:
determining flow sequence nodes corresponding to the to-be-handled driving flow engine model and flow conditions among the nodes based on the to-be-handled nodes, the conditional directed edge structures and the events;
and determining a process node configuration file corresponding to the to-be-handled driving process engine model based on the process sequence nodes, the circulation conditions among the nodes and the element information.
3. The process engine automatic conversion method of claim 2, wherein determining process sequence nodes corresponding to the to-do driven process engine model and flow conditions among the nodes based on the to-do nodes, the conditional directed edge structure and the events comprises:
analyzing the conditional directed edge structure, and acquiring node pairs corresponding to the directed edges according to the sequence, wherein the node pairs consist of starting points and end points of corresponding edges;
acquiring a process starting node and a process ending node according to a starting event and an ending event;
determining the longest sequential path from the process starting node to the process ending node according to the process starting node, the process ending node and the node pair corresponding to the edge;
taking the longest sequential path as a process sequential node corresponding to the to-be-handled driving process engine model;
and determining the circulation condition between the nodes corresponding to the to-be-handled driving process engine model according to the condition in the conditional directed edge structure.
4. The process engine automatic conversion method according to claim 2, 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 to-do configuration table in SQL format, and a to-do flow condition configuration table in SQL format; the process node configuration files corresponding to the to-do driving process engine model comprise a CSV-format process configuration file, a CSV-format process node to-do configuration file and a CSV-format to-do flow condition configuration file;
correspondingly, the determining a process node configuration file corresponding to the to-be-handled driven process engine model based on the process sequence node, the flow conditions among the nodes, and the element information includes:
converting flow sequence nodes, circulation conditions among the nodes and the element information into array data;
and respectively traversing the array data according to respective table fields of the SQL-formatted flow configuration table, the SQL-formatted flow node to-be-handled configuration table and the SQL-formatted flow condition configuration table, acquiring single data corresponding to the table fields one by one, and respectively writing the acquired single data serving as CSV line data into the CSV-formatted flow configuration file, the CSV-formatted flow node to-be-handled configuration file and the CSV-formatted flow condition configuration file correspondingly.
5. The method for automatically converting a process engine according to claim 4, wherein converting the process node configuration file into a process engine file corresponding to the to-do driven process engine model comprises:
and correspondingly converting the CSV-format flow configuration file, the CSV-format flow node to-be-handled configuration file and the CSV-format to-be-handled flow condition configuration file into an SQL-format flow configuration table, an SQL-format flow node to-be-handled configuration table and an SQL-format to-be-handled flow condition configuration table according to the mapping relation between the CSV file name and the SQL data table name.
6. The method for automatically converting process engine according to claim 1, wherein before parsing the BPMN process engine file by using a BPMN parser to obtain a parsed product, the method further comprises: the step of establishing the BPMN resolver specifically comprises the following steps:
compiling a BPMN resolver based on PHP according to the requirement of a preset resolution product; the BPMN resolver comprises element names to be resolved corresponding to the preset resolution product requirements; and the BPMN resolver resolves the BPMN process engine file according to the element name to be resolved to obtain a resolution product corresponding to the preset resolution product requirement.
7. An automatic flow engine switching device, comprising:
the first acquisition module is used for acquiring a BPMN process engine file corresponding to the BPMN process engine model;
the second acquisition module is used for analyzing the BPMN process engine file by using a BPMN analyzer to acquire an analysis product; the BPMN resolver is a resolver written by PHP based on preset resolution product requirements and is used for resolving the BPMN process engine file to generate a required resolution product; wherein, the analysis product comprises element information in the BPMN process engine file; the element information is flow information required for establishing a to-be-handled driving flow engine model; the to-be-handled driving process engine model is a model to be converted from a BPMN process engine model;
the determining module is used for determining a process node configuration file corresponding to the to-be-handled driving process engine model based on the element information;
the file conversion module is used for converting the process node configuration file into a process engine file corresponding to the to-be-handled drive process engine model;
and the model conversion module is used for completing the conversion from the BPMN process engine model to the to-be-handled driving process engine model based on the process engine file corresponding to the to-be-handled driving process engine model.
8. The process engine automatic conversion device according to claim 7, wherein the factor information includes at least: a node to be handled, a conditional directed edge structure and an event;
accordingly, the determining module is configured to:
determining flow sequence nodes corresponding to the to-be-handled driving flow engine model and flow conditions among the nodes based on the to-be-handled nodes, the conditional directed edge structures and the events;
and determining a process node configuration file corresponding to the to-be-handled driving process engine model based on the process sequence nodes, the circulation conditions among the nodes and the element information.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the steps of the process engine automatic conversion method according to any one of claims 1 to 6.
10. A non-transitory computer readable storage medium, having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the process engine automatic conversion method according to any one of claims 1 to 6.
CN202010976892.4A 2020-09-16 2020-09-16 Automatic process engine conversion method and device, electronic medium and storage medium Pending CN112230933A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010976892.4A CN112230933A (en) 2020-09-16 2020-09-16 Automatic process engine conversion method and device, electronic medium and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010976892.4A CN112230933A (en) 2020-09-16 2020-09-16 Automatic process engine conversion method and device, electronic medium and storage medium

Publications (1)

Publication Number Publication Date
CN112230933A true CN112230933A (en) 2021-01-15

Family

ID=74107890

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010976892.4A Pending CN112230933A (en) 2020-09-16 2020-09-16 Automatic process engine conversion method and device, electronic medium and storage medium

Country Status (1)

Country Link
CN (1) CN112230933A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113918637A (en) * 2021-10-22 2022-01-11 重庆新致金服信息技术有限公司 BPMN2.0 specification-based process engine platform creation method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20110114173A (en) * 2010-04-13 2011-10-19 한국과학기술원 A system and a method for generating web service customized based on business process
US20130191732A1 (en) * 2012-01-23 2013-07-25 Microsoft Corporation Fixed Format Document Conversion Engine
CN103617066A (en) * 2013-12-16 2014-03-05 中国农业银行股份有限公司 Workflow engine and implementation method thereof
CN105204919A (en) * 2015-09-22 2015-12-30 北京京东尚科信息技术有限公司 Procedure virtual machine
CN110659018A (en) * 2019-09-20 2020-01-07 中国银行股份有限公司 Flow engine implementation method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20110114173A (en) * 2010-04-13 2011-10-19 한국과학기술원 A system and a method for generating web service customized based on business process
US20130191732A1 (en) * 2012-01-23 2013-07-25 Microsoft Corporation Fixed Format Document Conversion Engine
CN103617066A (en) * 2013-12-16 2014-03-05 中国农业银行股份有限公司 Workflow engine and implementation method thereof
CN105204919A (en) * 2015-09-22 2015-12-30 北京京东尚科信息技术有限公司 Procedure virtual machine
CN110659018A (en) * 2019-09-20 2020-01-07 中国银行股份有限公司 Flow engine implementation method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113918637A (en) * 2021-10-22 2022-01-11 重庆新致金服信息技术有限公司 BPMN2.0 specification-based process engine platform creation method and system

Similar Documents

Publication Publication Date Title
CN108446190B (en) Interface test method and device
CN107665171B (en) Automatic regression testing method and device
US9323650B2 (en) Methods for generating software test input data and devices thereof
CN105095067A (en) User interface element object identification and automatic test method and apparatus
CN111090417B (en) Binary file analysis method, binary file analysis device, binary file analysis equipment and binary file analysis medium
CN103559025B (en) Software refactoring method through clustering
CN108170602B (en) Test case generation method and device, terminal and computer readable medium
CN104182347B (en) A kind of testing requirement automatic analysis method based on automatic test platform
CN113238740B (en) Code generation method, code generation device, storage medium and electronic device
CN111158656B (en) Test code generation method and device based on fruit tree method
CN109062819B (en) Method and device for generating software test case
CN108664546B (en) XML data structure conversion method and device
CN110308904B (en) Aggregation method and device for multi-type front-end frames and computer equipment
CN112948726A (en) Method, device and system for processing abnormal information
CN112230933A (en) Automatic process engine conversion method and device, electronic medium and storage medium
CN112799670B (en) Method and system for unified multi-terminal logic development
CN108694194A (en) A kind of method and apparatus of construction data object
CN112835901A (en) File storage method and device, computer equipment and computer readable storage medium
CN112989795A (en) Text information extraction method and device, computer equipment and storage medium
CN106326090A (en) Method and device for realizing construction of test use case
CN117216092A (en) Method, device and equipment for optimizing TDSQL script and readable storage medium
CN117094296A (en) VB language-based form splitting method, intelligent terminal and storage medium
CN112363939A (en) Method, system and equipment for quickly generating fuzzy test network protocol template
CN109471935B (en) Questionnaire survey object determining method and device, electronic equipment and storage medium
CN116643739A (en) Decision engine implementation method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination