Process model extensible markup language (XML) file conversion method, device, and medium

By converting the XML file of the process model, different types of process engines can parse each other's XML files, solving the interoperability problem of process management systems and realizing cross-engine migration and synchronization of process models.

CN115983207BActive Publication Date: 2026-05-05BEIJING CHINA POWER INFORMATION TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING CHINA POWER INFORMATION TECH
Filing Date
2023-01-04
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Different types of process engines cannot parse the XML files defined by the other type of process engine, which makes it impossible for the process management system to synchronize and interact with the process models.

Method used

This paper provides a method for converting process models into Extensible Markup Language (XML) files. By obtaining migration instructions, the paper parses the primitives, attributes, flow conditions, and participant codes of the source XML file, and performs code conversion and reorganization according to the rules of the target process engine to generate an XML file that can be parsed by the target process engine.

Benefits of technology

It enables the migration and synchronization of process models between different types of process engines, and supports interaction and collaborative work among process management systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115983207B_ABST
    Figure CN115983207B_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, device, and medium for converting process models into Extensible Markup Language (XML) files. If it is necessary to import a process model from a source process management system into a target process management system, the source XML file of the process model needs to be converted into a target XML file that the target process engine can parse. This achieves the synchronization and interaction of process models in process management systems based on different types of process engines.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of process engines, and more specifically, to methods, apparatus, and media for converting process models into Extensible Markup Language (XML) files. Background Technology

[0002] A process management system is a system that defines, manages, and executes process models through software execution, driven by a formalized representation of the process model. The process engine is the core of the process management system; it parses the process model and drives the flow of the process. Currently, different types of process engines exist, such as the Flowable process engine and the Activiti process engine; the type of process engine may differ between different process management systems.

[0003] Different types of process engines are incompatible with each other; that is, a process engine cannot parse XML (Extensible Markup Language) files defined by another type of process engine. Therefore, process management systems based on different types of process engines cannot achieve process model synchronization and interaction. Summary of the Invention

[0004] In view of this, this application provides a method, apparatus and medium for converting process models into Extensible Markup Language (XML) files.

[0005] To achieve the above objectives, this application provides the following technical solution:

[0006] According to a first aspect of the present disclosure, a method for converting a process model into an Extensible Markup Language (XML) file is provided, comprising:

[0007] Obtain the migration instructions for the source XML file corresponding to the process model. The migration instructions include: the type of the source process engine to which the source XML file belongs, and the type of the target process engine to which the source XML file is to be migrated.

[0008] Parse the source XML file to obtain the code corresponding to the first element identifier, the code corresponding to the first element attribute, the source flow condition code, the code corresponding to the source participant, and the code corresponding to the association relationship. The association relationship represents the execution order of multiple first elements.

[0009] According to the XML file rules defined for the target process engine, the code corresponding to the first graphic element identifier is converted into the first code belonging to the target process engine, the code corresponding to the first graphic element attribute is converted into the second code belonging to the target process engine, the source flow condition code is converted into the third code belonging to the target process engine, the code corresponding to the source participant is converted into the fourth code belonging to the target process engine, and the association relationship is converted into the fifth code belonging to the target process engine.

[0010] The first code, the second code, the third code, the fourth code, and the fifth code are recombined according to the XML file format defined by the target process engine to obtain a target XML file belonging to the target process engine.

[0011] According to a second aspect of the present disclosure, an apparatus for converting a process model into an Extensible Markup Language (XML) file is provided, comprising:

[0012] The first acquisition module is used to acquire the migration instructions of the source XML file corresponding to the process model. The migration instructions include: the type of the source process engine to which the source XML file belongs, and the type of the target process engine to which the source XML file is to be migrated.

[0013] The second acquisition module is used to parse the source XML file to obtain the code corresponding to the first graphic element identifier, the code corresponding to the first graphic element attribute, the source flow condition code, the code corresponding to the source participant, and the code corresponding to the association relationship, wherein the association relationship represents the sequential execution order of multiple first graphic elements;

[0014] The conversion module is used to convert the code corresponding to the first graphic element identifier into first code belonging to the target process engine, the code corresponding to the first graphic element attribute into second code belonging to the target process engine, the source flow condition code into third code belonging to the target process engine, the code corresponding to the source participant into fourth code belonging to the target process engine, and the association relationship into fifth code belonging to the target process engine, according to the XML file rules defined by the target process engine.

[0015] The reorganization module is used to reorganize the first code, the second code, the third code, the fourth code, and the fifth code according to the XML file format defined by the target process engine to obtain a target XML file belonging to the target process engine.

[0016] According to a third aspect of the present disclosure, an electronic device is provided, characterized in that it includes:

[0017] processor;

[0018] Memory used to store the processor's executable instructions;

[0019] The processor is configured to execute the instructions to implement the Extensible Markup Language (XML) file conversion method of the process model as described in the first aspect.

[0020] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided that, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to perform an Extensible Markup Language (XML) file conversion method according to the process model described in the first aspect.

[0021] As can be seen from the above technical solution, in the XML file conversion method of the process model provided in this application, if it is necessary to import the process model in the source process engine into the target process engine, it is necessary to export the source XML file of the process model, convert it into a target XML file that the target process engine can parse, and then import it. The specific method is as follows: obtain the migration instructions of the source XML file corresponding to the process model. The migration instructions include: the type of the source process engine to which the source XML file belongs, and the type of the target process engine to which the source XML file is to be migrated; parse the source XML file to obtain the code corresponding to the first element identifier of the first element, the code corresponding to the first element attribute, the source flow condition code, the code corresponding to the source participant, and the association. The code corresponding to the relationships represents the execution order of multiple first primitives. According to the XML file rules defined by the target process engine, the code corresponding to the first primitive identifier is converted into first code belonging to the target process engine; the code corresponding to the first primitive attribute is converted into second code belonging to the target process engine; the source flow condition code is converted into third code belonging to the target process engine; the code corresponding to the source participant is converted into fourth code belonging to the target process engine; and the relationships are converted into fifth code belonging to the target process engine. The first, second, third, fourth, and fifth codes are then recombined according to the XML file format defined by the target process engine to obtain the target XML file. This achieves the synchronization and interaction of process models in process management systems based on different types of process engines. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0023] Figure 1A schematic diagram of the hardware architecture provided for an embodiment of this application;

[0024] Figure 2 This is a flowchart illustrating a process model for converting Extensible Markup Language (XML) files according to an exemplary embodiment;

[0025] Figure 3 A schematic diagram illustrating the correspondence between the names and descriptions of events provided in the embodiments of this application;

[0026] Figure 4 A visual schematic diagram of the process model provided in the embodiments of this application;

[0027] Figure 5 A schematic diagram of the gateway type provided in the embodiments of this application;

[0028] Figure 6 This is a schematic diagram illustrating the names and descriptions of the activities involved in the embodiments of this application;

[0029] Figure 7 This is a schematic diagram illustrating the names, descriptions, and patterns of the swimming lanes involved in the embodiments of this application;

[0030] Figure 8 A visual schematic diagram of the process model provided in the embodiments of this application;

[0031] Figure 9 This is a block diagram of an Extensible Markup Language (XML) file conversion device for a process model, according to an exemplary embodiment.

[0032] Figure 10 This is a block diagram illustrating an apparatus for an electronic device according to an exemplary embodiment. Detailed Implementation

[0033] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0034] This application provides a method, apparatus, electronic device, and medium for converting Extensible Markup Language (XML) files of a process model. Before introducing the technical solutions provided by this application, the hardware architecture involved in this application will be described first.

[0035] like Figure 1 The diagram shown is a schematic of the hardware architecture provided in an embodiment of this application. The hardware architecture includes a terminal device 11 and a server 12.

[0036] For example, terminal device 11 can be any computer device that can interact with the user through one or more means such as a keyboard, touchpad, or touchscreen, such as a tablet computer, PDA, or personal computer.

[0037] For example, the terminal device may have a process management system application installed.

[0038] For example, server 12 can be a single server, a server cluster consisting of multiple servers, or a cloud computing service center.

[0039] For example, terminal device 11 can be connected to server 12 via wired or wireless communication links or fiber optic cables.

[0040] In an alternative implementation, an application running on terminal device 11 can be used to configure and generate migration instructions for the source XML file. For example, in an application running on terminal device 11 that imports XML files, the user can input the type of the source process engine and the type of the target process engine through the application's user interface.

[0041] For example, after generating a migration instruction, the terminal device 11 can execute the XML file conversion method for the process model provided in this application embodiment. For example, the terminal device 11 can send the migration instruction to the server 12, and the server 12 can execute the XML file conversion method for the process model provided in this application embodiment.

[0042] In summary, server 12 converts the source XML file into a target XML file that conforms to the programming rules of the target process engine, and sends it back to terminal device 11, which then exports the target XML file. The target XML file is then sent to the target process engine. Because the programming rules of the target XML file conform to the programming rules of the target process engine, the target process engine can parse the target XML file. Since each process model corresponds to one XML file, the migration of process models between different types of process engines is achieved.

[0043] Those skilled in the art should understand that the above-described terminal devices and servers are merely examples, and other existing or future terminal devices or servers that are applicable to this disclosure should also be included within the scope of protection of this disclosure, and are hereby incorporated by reference.

[0044] Figure 2 This is a flowchart illustrating a process model for converting Extensible Markup Language (XML) files according to an exemplary embodiment, such as... Figure 2As shown, the process model's Extensible Markup Language (XML) file conversion method is used in terminal device 11 or server 12, including the following steps S21 to S24.

[0045] Step S21: Obtain the migration instructions for the source XML file corresponding to the process model. The migration instructions include: the type of the source process engine to which the source XML file belongs, and the type of the target process engine to which the source XML file is to be migrated.

[0046] For example, the source process engine type includes, but is not limited to: flowable type, activiti type, SG-BPM type; for example, the target process engine includes, but is not limited to: flowable type, activiti type, SG-BPM type; the target process engine is of a different type than the source process engine.

[0047] The type of the source process engine corresponds to the text type of the source XML file.

[0048] For example, one process model corresponds to one XML file.

[0049] Step S22: Parse the source XML file to obtain the code corresponding to the first element identifier, the code corresponding to the first element attribute, the source flow condition code, the code corresponding to the source participant, and the code corresponding to the association relationship. The association relationship represents the execution order of multiple first elements.

[0050] In this embodiment, the XML file corresponding to the source process engine is referred to as the source XML file, the graphic element corresponding to the source process engine is referred to as the first graphic element, the attribute of the graphic element corresponding to the source process engine is referred to as the first graphic element attribute, and the flow condition code of the graphic element corresponding to the source process engine is referred to as the source flow condition code. The XML file corresponding to the target process engine is referred to as the target XML file, the graphic element corresponding to the target process engine is referred to as the second graphic element, the attribute of the graphic element corresponding to the target process engine is referred to as the second graphic element attribute, and the flow condition code of the graphic element corresponding to the target process engine is referred to as the third code.

[0051] Among them, the code corresponding to the first element identifier of the first element, the code corresponding to the first element attribute, the source flow condition code, and the source participant code refer to: the code corresponding to the first element identifier of the first element, the code corresponding to the first element attribute of the first element, the source flow condition code of the first element, and the code corresponding to the source participant of the first element.

[0052] The following explains the graphic elements, graphic element attributes, flow condition codes, and participants.

[0053] In one alternative implementation, primitives are important components of the process model.

[0054] In an optional implementation, the primitive attributes include but are not limited to: activity, event, in-degree of the primitive, out-degree of the primitive, gateway type, and swimlane.

[0055] Exemplarily, the types of events include but are not limited to: start event, message start event, end event, termination event, cancel end event, cancel intermediate event, error intermediate event, send event, receive event, and service event. The names of events are different in different types of process engines.

[0056] As Figure 3 shown, it is a schematic diagram of the correspondence between the names and descriptions of events provided by an embodiment of the present application.

[0057] Exemplarily, the names of events include: the element name and display name of the event. For example, in <startEvent id="NoneStartEvent" name="开始">, "NoneStartEvent" is the element name of the start event, and "开始" is the display name of the start event.

[0058] In different types of process engines, the element names of the same event may be different; in different types of process engines, the display names of the same event may be different.

[0059] In a type-A process engine, the XML file includes <graphicalelements / > tags, etc. Among them, <graphcalelements / > the xsi:type attribute in the tag specifies a specific event, such as <graphcalElements xsi:type="bpmn:StartEvent">;..., <graphcalElements xsi:type="bpmn:EndEvent">, where "StartEvent" represents a start event; "EndEvent" represents an end event.

[0060] In a type-B process engine, the XML file includes <startEvent id / > and <endEvent id / > tags, where the id attribute specifies a specific event. For example, <startEvent id="NoneStartEvent" name="开始">;..., <endEvent id="NoneEndEvent" name="结束" desc="">, where "NoneStartEvent" represents a start event and "NoneEndEvent" represents an end event.

[0061] In summary, in different types of process engines, the names of events corresponding to the same event are different. For example, in type A process engine, the "start event" is "StartEvent", while in type B process engine, the "start event" is "NoneStartEvent". In different types of process engines, the XML file rules are different. For example, the XML file rules for the same event are different. In type A process engine, the XML file rule is <graphcalElements xsi:type=”bpmn:StartEvent”>, while in type B process engine, the XML file rule is <startEvent id="NoneStartEvent"name="开始">.

[0062] In an optional implementation, the in-degree of a graphical primitive is the number of control flows from the graphical primitives at the previous hierarchical level of the graphical primitive to this graphical primitive, and the out-degree of a graphical primitive is the number of control flows from this graphical primitive to the graphical primitives at the previous hierarchical level of the graphical primitive. Referring to Figure 4 , there is no graphical primitive at the previous hierarchical level of graphical primitive 1; the graphical primitive at the previous hierarchical level of graphical primitive 2 is graphical primitive 1, the in-degree of graphical primitive 2 is 1, and the out-degree is 1. The in-degree of graphical primitive 3 is 1, and the out-degree is 0; the in-degree of graphical primitive 4 is 1, and the out-degree is 0; the in-degree of graphical primitive 5 is 2, and the out-degree is 0.

[0063] Exemplarily, the in-degree and out-degree of a graphical primitive can be represented by connection lines with arrows. The connection lines of a graphical primitive include: the number of connection lines, the number of arrows of each connection line, and the direction of the arrow of each connection line.

[0064] Exemplarily, the gateway types include but are not limited to: single gateway, parallel gateway, and multi-way gateway.

[0065] To enable those skilled in the art to better understand the gateway types provided in the embodiments of the present application, the following is described in conjunction with Figure 4 and Figure 5 .

[0066] Combined with the description of the gateway types in Figure 5 , the gateway type corresponding to graphical primitive 1 in Figure 4 is a parallel gateway, the gateway types corresponding to graphical primitives 2, 3, and 4 are all single gateways, and the gateway type corresponding to graphical primitive 5 is a multi-way gateway.

[0067] Figure 4 is part of a process model.

[0068] In different types of process engines, the element names of the same gateway type may be different; in different types of process engines, the display names of the same gateway type may be different; in different types of process engines, the XML file rules of the same gateway type are different.

[0069] In one alternative implementation, an activity refers to an operation that a primitive needs to perform.

[0070] To help those skilled in the art better understand the activities corresponding to the graphic elements mentioned in the embodiments of this application, examples are provided below.

[0071] like Figure 6 The diagram shown illustrates the names and descriptions of the activities involved in the embodiments of this application.

[0072] For example, activities include, but are not limited to: empty activities, automatic activities, sending activities, manual activities, sub-processes, external sub-processes, and transaction blocks.

[0073] For example, an activity includes an element name and a display name.

[0074] When the process engine reaches this element, it will perform the corresponding operation based on the activity corresponding to the element.

[0075] In different types of workflow engines, the element names for the same activity may be different; in different types of workflow engines, the display names for the same activity may be different; in different types of workflow engines, the XML file rules for the same activity may be different.

[0076] In one optional implementation, the lanes include, but are not limited to, horizontal lanes and vertical lanes.

[0077] To help those skilled in the art better understand the swimlanes corresponding to the primitives mentioned in the embodiments of this application, examples are provided below.

[0078] like Figure 7 The diagram shown is a schematic representation of the name, description, and style of the swimming lanes involved in the embodiments of this application.

[0079] In different types of workflow engines, the element names for the same swimlane may be different; the display names for the same swimlane may be different; and the XML file rules for the same swimlane may differ in different types of workflow engines.

[0080] In this embodiment, the display name refers to the display such as Figure 4 The process model shown refers to the names of the graphical elements displayed in the process model.

[0081] In one alternative implementation, the primitive may correspond to a participant. For example, in a leave approval process, after an employee submits a leave request, it needs to be approved by a supervisor or manager, who is a participant.

[0082] Different types of process engines may have different names for the same participant; the XML file rules for the same participant may also differ.

[0083] In an optional implementation, there is a need for the transfer between each graphic primitive. Figure 4 Taking Figure 4 as an example, after graphic primitive 1 finishes executing an activity, it needs to be transferred to graphic primitive 2 and / or graphic primitive 3. Then, when graphic primitive 1 is transferred to graphic primitive 2 and / or graphic primitive 3, certain transfer conditions need to be met, and this transfer condition is the transfer condition corresponding to graphic primitive 1. For example, the transfer condition corresponding to graphic primitive 1 is: if the execution result a is greater than b, then execute the activity of graphic primitive 2; if the execution result a is less than or equal to b, then execute the activity of graphic primitive 3.

[0084] It can be understood that the transfer condition corresponds to a source transfer condition code. For the source process engine, the source transfer condition code is written in a programming language that conforms to the source process engine, and the third code is written in a programming language that conforms to the target process engine.

[0085] In summary, in different types of process engines, the graphic primitive attributes are different (such as the element name and display name of the event of the graphic primitive, the name of the in-degree of the graphic primitive, the name of the out-degree of the graphic primitive, the element name and display name of the network type, the element name and display name of the activity, the element name and display name of the swimlane), the names of the participants corresponding to the graphic primitive are different, and the condition codes of the transfer conditions corresponding to the graphic primitive are different. Therefore, the target process engine cannot parse the source XML file, so it is necessary to convert the source XML file into a target XML file.

[0086] The process of obtaining the code corresponding to the first graphic primitive identifier of the first graphic primitive, the code corresponding to the first graphic primitive attribute, the source transfer condition code, and the code corresponding to the source participant from the source XML file in the embodiments of the present application will be described below.

[0087] It can be understood that the XML file includes graphic primitive identifiers, graphic primitive attributes, transfer condition codes, and participant information.

[0088] Taking the graphic primitive attribute as an example for illustration, if the source XML file includes: the statement "<startEvent id="NoneStartEvent" name="开始">…." includes the start tag "startEvent", the element name "NoneStartEvent" of the start event, the display name "开始", and the end tag " / startEvent". Therefore, the name of the graphic primitive attribute in the source process engine, as well as the start tag and the end tag, can be used as keywords to search for the code corresponding to the start event in the source XML file, that is, the code corresponding to the start event is "<startEvent id="NoneStartEvent" name="开始">….".

[0089] Taking the participant as an example for illustration, if the source XML file includes the following code:

[0090]

[0091] The code above includes: the participant's start tag "performer id=""name="", the participant's end tag " / performer", the participant ID, the participant name, and the participant type. Therefore, the participant's code can be determined by their start and end tags. Furthermore, participant information can be found using the keyword "participant", the keyword "id" for the participant ID, the keyword "name" for the participant name, and the keyword "type" for the participant type.

[0092] Step S23: According to the XML file rules defined by the target process engine, convert the code corresponding to the first graphic element identifier into first code belonging to the target process engine, convert the code corresponding to the first graphic element attribute into second code belonging to the target process engine, convert the source flow condition code into third code belonging to the target process engine, convert the code corresponding to the source participant into fourth code belonging to the target process engine, and convert the association relationship into fifth code belonging to the target process engine.

[0093] In one optional implementation, the XML file rules include, but are not limited to: the correspondence between primitive identifiers belonging to the source process engine and primitive identifiers belonging to the target process engine; the correspondence between primitive attributes belonging to the source process engine and primitive attributes belonging to the target process engine; the correspondence between source flow condition codes belonging to the source process engine and flow condition codes belonging to the target process engine; and the correspondence between participants belonging to the source process engine and participants belonging to the target process engine. For example, step S23 includes steps A11 to A14.

[0094] Step A11: From the preset correspondence between the graphic element identifiers belonging to the source process engine and the graphic element identifiers belonging to the target process engine, find the second graphic element identifier corresponding to the first graphic element identifier and belonging to the target process engine.

[0095] Step A12: From the preset correspondence between the primitive attributes belonging to the source process engine and the primitive attributes belonging to the target process engine, find the second primitive attribute belonging to the target process engine corresponding to the first primitive attribute.

[0096] Step A13: From the preset correspondence between the flow condition codes belonging to the source flow engine and the flow condition codes belonging to the target flow engine, find the third code corresponding to the source flow condition code.

[0097] Step A14: Find the target participant corresponding to the source participant from the preset correspondence between participants belonging to the source process engine and participants belonging to the target process engine.

[0098] The following explanation uses events contained in primitive attributes as an example; see Table 1 for details.

[0099] Table 1

[0100] event Type A workflow engine Type B process engine Start Event StartEvent NoneStartEvent End of event EndEvent NoneEndEvent … … …

[0101] If the source process engine is type A and the target process engine is type B, then the names of the events belonging to the target process engine can be obtained from Table 1.

[0102] It is understandable that different types of process engines may use different languages ​​to write the transition conditions. If the target process engine needs to be able to parse the source transition condition code in the source process engine, the source transition condition code needs to be rewritten.

[0103] In this embodiment, the correspondence between different types of process engines and their corresponding flow condition codes can be pre-defined. The flow condition codes can be categorized, and their flow types include, but are not limited to, judgment type and trigger type. A judgment type means that the activity processing result of a graphic element can flow to the next graphic element if certain conditions are met; a trigger type means that the activity of the graphic element can flow to the next graphic element once it has been processed.

[0104] In one alternative implementation, step A13 is specifically implemented by including steps A131 to A133.

[0105] Step A131: Obtain the target flow type of the source flow condition code corresponding to the first primitive.

[0106] Step A132: From the preset correspondence between the flow type, the source flow condition code template belonging to the source flow engine, and the flow condition code template belonging to the target flow engine, find the source flow condition code template corresponding to the target flow type and the target flow condition code template belonging to the target flow engine.

[0107] Step A133: Based on the correspondence between the placeholders in the source flow condition code template and the target flow condition code template, replace the placeholders in the corresponding positions in the target flow condition code template with the corresponding parameters in the source flow code to obtain the target flow code.

[0108] The following example illustrates the correspondence between "flow type, source flow condition code template belonging to the source flow engine, and target flow condition code template belonging to the target flow engine", as shown in Table 2.

[0109] Table 2

[0110]

[0111] It is understandable that the flow condition code includes one or more parameters, and the placeholders in the flow condition code template are the positions of the parameters.

[0112] As shown in Table 2, the number of parameters contained in the corresponding flow condition code templates in different types of flow engines is the same, and the parameters placed in the placeholders with the same identifier in the corresponding flow condition code templates are the same.

[0113] Still with Figure 4 For example, if the source transition condition code corresponding to element 1 is a judgment type, and the source transition condition code is: jump to (a>b?"element2":"element3"), that is, if a is greater than b, then jump to element 2; otherwise, jump to element 3. If the source transition condition code template A1 is: jump to (placeholder1>placeholder2?"placeholder3":"placeholder4"), then the correspondence between placeholders and parameters can be obtained, that is, placeholder1 corresponds to a, placeholder2 corresponds to b, placeholder3 corresponds to element 2, and placeholder4 corresponds to element 3; if the target transition condition code template B1 is: if placeholder1>placeholder2, jump to placeholder3; else jump to placeholder4. Based on the correspondence between placeholders in the source transition condition code template A1 and the target transition condition code template B1, the third code can be obtained: if a>b, jump to element 2; else jump to element 3.

[0114] For example, you can build a code rewriting mini-program, input the relationship into the code rewriting mini-program, and then obtain the target relationship.

[0115] Step S24: Reorganize the first code, the second code, the third code, the fourth code, and the fifth code according to the XML file format defined by the target process engine to obtain a target XML file belonging to the target process engine.

[0116] For example, the XML file format includes: the target XML file code, and the first code, the second code, the third code, the fourth code, and the fifth code located at the respective positions of the target XML file code.

[0117] In this embodiment, if it is necessary to import the process model from the source process engine into the target process engine, the source XML file of the process model needs to be exported and converted into a target XML file that the target process engine can parse before importing. The specific method is as follows: Obtain the migration instruction of the source XML file corresponding to the process model. The migration instruction includes: the type of the source process engine to which the source XML file belongs, and the type of the target process engine to which the source XML file is to be migrated; parse the source XML file to obtain the code corresponding to the first element identifier of the first element, the code corresponding to the first element attribute, the source flow condition code, the code corresponding to the source participant, and the code corresponding to the association relationship, and the association relationship table. The execution order of multiple first graphical elements is determined. Based on the XML file rules defined by the target process engine, the code corresponding to the first graphical element identifier is converted into first code belonging to the target process engine; the code corresponding to the first graphical element attribute is converted into second code belonging to the target process engine; the source flow condition code is converted into third code belonging to the target process engine; the code corresponding to the source participant is converted into fourth code belonging to the target process engine; and the association relationship is converted into fifth code belonging to the target process engine. The first, second, third, fourth, and fifth codes are then recombined according to the XML file format defined by the target process engine to obtain the target XML file. This achieves the synchronization and interaction of process models in process management systems based on different types of process engines.

[0118] In one optional implementation, there are multiple methods for obtaining the association relationship through the source XML file in step S22. The embodiments of this application provide, but are not limited to, the following methods, which include the following steps B1 to B3 during implementation.

[0119] Step B1: Obtain the primitive hierarchy corresponding to each of the first primitives from the source XML file.

[0120] For example, the XML file contains the primitive hierarchy parameters, so the primitive hierarchy corresponding to each primitive can be obtained by traversing the source XML file.

[0121] Still with Figure 4 For example, primitive 1 has a primitive level of level 1, primitives 2 and 3 have a primitive level of level 2, primitive 4 has a primitive level of level 3, and primitive 5 has a primitive level of level 4.

[0122] Step B2: For each of the first graph elements belonging to the same graph element level, based on the gateway type, out-degree, in-degree, and order of the sorting result corresponding to the first graph element, determine the connection relationship between the first graph element and the first graph element located in the previous graph element level, so as to obtain the connection relationship corresponding to multiple first graph elements respectively. The sorting result is the result of sorting the first graph elements belonging to the same graph element level according to the order in the source XML file.

[0123] Still with Figure 4 For example, primitive 1 is located in level 1, so there are no primitives in the previous level of primitive 1; primitives in level 2 include primitive 2 and primitive 3; the sorting result corresponding to primitive level 2 is primitive 2, primitive 3.

[0124] Element 2 has a single gateway type with both in-degree and out-degree of 1; element 3 has a single gateway type with an in-degree of 1 and an out-degree of 0. Since in-degree and out-degree refer to elements at the previous level, element 2 is connected to element 1, and the arrow of the connecting line is a bidirectional arrow. Element 3 is connected to element 1, and the arrow of the connecting line points to element 3 as a unidirectional arrow.

[0125] The graphic element located at graphic element level 3 includes graphic element 4. The gateway type of graphic element 4 is a single gateway, with an in-degree of 1 and an out-degree of 0, indicating that graphic element 4 is connected to one of the graphic elements in the previous graphic element level, and the arrow of the connecting line is a one-way arrow pointing to graphic element 4.

[0126] In order to parse out "which element in the previous element level is connected to element 4", the source XML file will write an element with "empty activity" in the corresponding element level, that is, the element does not need to perform any operation.

[0127] exist Figure 4 The element 6 with "empty activity" is added; see details. Figure 8 .

[0128] like Figure 8 As shown, the elements located at element level 3 include element 6 and element 4; and the sorting result corresponding to element level 3 is: element 6, element 4; element 6 has a gateway type of single gateway, an in-degree of 1, an out-degree of 0, and is located in the first position of the sorting result. Therefore, element 6 is connected to element 2, which is located in the first position of the sorting result at element level 2, and the arrow of the connecting line is a one-way arrow, pointing from element 2 to element 6; element 4 is located in the second position of the sorting result, so element 4 is connected to element 3, which is located in the second position of the sorting result at element level 2, and the arrow of the connecting line is a one-way arrow, pointing from element 3 to element 4.

[0129] The element located at element level 4 includes element 5, and element 5 has a gateway type of multi-way gateway, an in-degree of 2, and an out-degree of 0. This means that element 5 is connected to two elements at element level 3, and the connecting lines are all one-way arrows pointing to element 5. That is, element 5 is connected to element 6 and element 4 respectively, and the connecting lines are all one-way arrows pointing to element 5.

[0130] Step B3: Obtain the association relationship, which represents the element hierarchy corresponding to the multiple first elements and the connection relationship corresponding to the multiple first elements.

[0131] Still with Figure 4 and Figure 8 For example, the relationships are as follows: the element at element level 1 is element 1; the elements at element level 2 are element 2 and element 3, which are connected by a bidirectional arrow, and element 3 and element 1 are connected by a single arrow pointing to element 3; the elements at element level 3 are element 6 and element 4, which are connected by a single arrow pointing to element 6, and element 4 and element 3 are connected by a single arrow pointing to element 4; the element at element level 4 is element 5, which is connected to element 6 and element 4 by single arrows pointing to element 5.

[0132] In an optional implementation, in order to more concisely represent the association relationship of each first graphic element, the embodiments of this application also provide the following method, which includes the following steps B31 to B35 in the implementation process.

[0133] Step B31: If the connection relationship of the first graphic element indicates that the first graphic element is not connected to the first graphic element located at the previous graphic element level, the level number of the graphic element level where the first graphic element is located is taken as the graphic element level number of the first graphic element.

[0134] Step B32: The order in which the first graphic element is located in the sorting result is used as the sequence number of the first graphic element.

[0135] Still with Figure 4 and Figure 8 For example, element 1 is located at element level 1 and has no element at the next higher element level, so element level 1 is numbered 1. Since element 1 is the first element in the sorting results of element level 1, its sequence number is 1, meaning element 1 is numbered 11.

[0136] Step B33: If the connection relationship of the first graphic element indicates that the first graphic element is connected to a target first graphic element located at the previous graphic element level, the number of the target first graphic element is used as the level number of the first graphic element.

[0137] Step B34: The order in which the first graphic element is located in the sorting result is used as the sequence number of the first graphic element.

[0138] Still with Figure 4 and Figure 8 For example, element 2 is connected to element 1, and the level number of element 2 is the same as the number of element 1, which is 11. Element 2 is the first element in the sorting result corresponding to element level 2, and its sequence number is 1, that is, the number of element 2 is 111. The numbering of other elements is similar, and will not be repeated here.

[0139] Step B35: Determine the association relationship of the first graphic element, including the number of the first graphic element, which includes the graphic element level number and the sequence number.

[0140] In one alternative implementation, operations and maintenance personnel need to work with the visualized process model (such as...) Figure 4 As shown, an inspection is performed to check for any problems with the process model. Therefore, it is necessary to set the position of each second element in the process drawing canvas to avoid the problem of some second elements being obscured in the process drawing canvas, preventing maintenance personnel from seeing the obscured second elements. Based on this, the embodiments of this application also provide the following method, which includes the following steps D1 to D2 during implementation.

[0141] Step D1: Obtain the relative positions of multiple first primitives in the flowchart canvas of the source process engine from the source XML file.

[0142] For example, relative positions include, but are not limited to: the relative positions between the various first elements, and the positions of the various first elements relative to the boundaries of the flowchart canvas.

[0143] Step D2: Based on the preset size of the flowchart canvas belonging to the source process engine, the size of the flowchart canvas belonging to the target process engine, and the relative positions of the plurality of first elements in the flowchart canvas of the source process engine, determine the relative positions of the plurality of second elements in the flowchart canvas of the target process engine.

[0144] For example, the relative positions of the plurality of second primitives in the flowchart canvas of the target flowchart engine include, but are not limited to: the relative positions between the various second primitives, and the positions of the various second primitives relative to the boundaries of the flowchart canvas.

[0145] Correspondingly, it also includes: setting the positions of the multiple second graphic elements in the flowchart canvas of the target process engine based on the relative positions of the multiple second graphic elements in the flowchart canvas of the target process engine.

[0146] The methods described in the above-disclosed embodiments of this application are detailed in terms of the methods. The methods of this application can be implemented by various forms of apparatus. Therefore, this application also discloses an apparatus. Specific embodiments are given below for detailed description.

[0147] Figure 9 This is a block diagram of an Extensible Markup Language (XML) file conversion apparatus according to an exemplary embodiment. (Refer to...) Figure 9 The device includes: a first acquisition module 101, a second acquisition module 102, a conversion module 103, and a recombination module 104, wherein:

[0148] The first acquisition module 101 is used to acquire the migration instructions of the source XML file corresponding to the process model. The migration instructions include: the type of the source process engine to which the source XML file belongs, and the type of the target process engine to which the source XML file is to be migrated.

[0149] The second acquisition module 102 is used to parse the source XML file to obtain the code corresponding to the first graphic element identifier, the code corresponding to the first graphic element attribute, the source flow condition code, the code corresponding to the source participant, and the code corresponding to the association relationship, wherein the association relationship represents the sequential execution order of multiple first graphic elements;

[0150] The conversion module 103 is used to convert the code corresponding to the first graphic element identifier into first code belonging to the target process engine, the code corresponding to the first graphic element attribute into second code belonging to the target process engine, the source flow condition code into third code belonging to the target process engine, the code corresponding to the source participant into fourth code belonging to the target process engine, and the association relationship into fifth code belonging to the target process engine, according to the XML file rules defined by the target process engine.

[0151] The reorganization module 104 is used to reorganize the first code, the second code, the third code, the fourth code, and the fifth code according to the XML file format defined by the target process engine to obtain the target XML file.

[0152] In one optional implementation, the second acquisition module includes:

[0153] The first acquisition unit is used to obtain the primitive hierarchy corresponding to the multiple first primitives from the source XML file;

[0154] The first determining unit is used to determine the connection relationship between the first graphic element and the first graphic element located in the previous graphic element level for each first graphic element belonging to the same graphic element level, based on the gateway type, out-degree, in-degree and the order of the sorting result corresponding to the first graphic element, so as to obtain the connection relationship corresponding to multiple first graphic elements respectively. The sorting result is the result of sorting the first graphic elements belonging to the same graphic element level according to the order of their location in the source XML file.

[0155] The second acquisition unit is used to obtain the association relationship, which represents the element hierarchy corresponding to the plurality of first elements and the connection relationship corresponding to the plurality of first elements.

[0156] In one optional implementation, for each of the first primitives, the second acquisition unit includes:

[0157] The first determining subunit is used to determine the level number of the first graphic element as the graphic element level number of the first graphic element if the connection relationship of the first graphic element indicates that the first graphic element is not connected to the first graphic element located in the previous graphic element level.

[0158] The second determining subunit is used to take the order in which the first graphic element is located in the sorting result as the order number of the first graphic element.

[0159] The third determining subunit is used to determine the level number of the first graphic element if the connection relationship of the first graphic element indicates that the first graphic element is connected to a target first graphic element located at the previous graphic element level.

[0160] The fourth determining subunit is used to take the order of the first graphic element in the sorting result as the order number of the first graphic element.

[0161] The fifth determining subunit is used to determine the association relationship of the first graphic element, including the number of the first graphic element, which includes the graphic element level number and the sequence number.

[0162] In one alternative implementation, it also includes:

[0163] The second acquisition module is used to acquire the relative positions of multiple first graphic elements in the flowchart canvas of the source process engine from the source XML file;

[0164] The first determining module is used to determine the relative positions of a plurality of second elements in the flowchart canvas of the target process engine based on the preset size of the flowchart canvas belonging to the source process engine, the size of the flowchart canvas belonging to the target process engine, and the relative positions of the plurality of first elements in the flowchart canvas of the source process engine.

[0165] In one alternative implementation, it also includes:

[0166] The setting module is used to set the position of the multiple second graphic elements in the flowchart canvas of the target process engine based on the relative positions of the multiple second graphic elements in the flowchart canvas of the target process engine.

[0167] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0168] Figure 10 This is a block diagram illustrating an apparatus for an electronic device according to an exemplary embodiment. The electronic device may be a terminal device 11 or a server 12.

[0169] Electronic devices include, but are not limited to: processor 111, memory 112, network interface 113, I / O controller 114, and communication bus 115.

[0170] It should be noted that those skilled in the art will understand that Figure 10 The structure of the electronic device shown does not constitute a limitation on the electronic device; the electronic device may include, but is not limited to, other electronic devices. Figure 10 This may indicate more or fewer components, or a combination of certain components, or a different arrangement of components.

[0171] The following is combined with Figure 10 A detailed introduction to each component of the electronic device:

[0172] Processor 111 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines. By running or executing software programs and / or modules stored in memory 112, and by calling data stored in memory 112, it performs various functions and processes data, thereby providing overall monitoring of the electronic device. Processor 111 may include one or more processing units; for example, processor 111 may integrate an application processor and a modem processor. The application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into processor 111.

[0173] The processor 111 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.

[0174] The memory 112 may include memory such as high-speed random-access memory (RAM) 1121 and read-only memory (ROM) 1122, and may also include a mass storage device 1123, such as at least one disk storage device. Of course, the electronic device may also include other hardware required for business operations.

[0175] The aforementioned memory 112 is used to store executable instructions of the aforementioned processor 111. The aforementioned processor 111 has the function of executing a method for converting Extensible Markup Language (XML) files according to an execution flow model.

[0176] A wired or wireless network interface 113 is configured to connect an electronic device to a network.

[0177] The processor 111, memory 112, network interface 113, and I / O controller 114 can be interconnected via a communication bus 115. This communication bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc.

[0178] In an exemplary embodiment, the electronic device may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to execute the Extensible Markup Language (XML) file conversion method of the above-described process model.

[0179] In an exemplary embodiment, this disclosure provides a storage medium including instructions, such as a memory 112 including instructions, which can be executed by a processor 111 of an electronic device to perform the above-described method. Optionally, the storage medium may be a non-transitory computer-readable storage medium, such as a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device.

[0180] In an exemplary embodiment, a computer-readable storage medium is also provided, which can be directly loaded into the computer's internal memory, such as the memory 112 described above, and contains software code. After being loaded and executed by the computer, the computer program can implement the Extensible Markup Language (XML) file conversion method of the above-described process model.

[0181] In an exemplary embodiment, a computer program product is also provided, which can be directly loaded into the internal memory of a computer, such as the memory included in the electronic device, and contains software code. After being loaded and executed by the computer, the computer program can implement the Extensible Markup Language (XML) file conversion method of the process model described above.

[0182] It should be noted that the features described in the various embodiments of this specification can be substituted for or combined with each other. For apparatus or system embodiments, since they are basically similar to the method embodiments, the descriptions are relatively simple; relevant details can be found in the descriptions of the method embodiments.

[0183] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0184] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0185] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for converting process models into Extensible Markup Language (XML) files, characterized in that, include: Obtain the migration instructions for the source XML file corresponding to the process model. The migration instructions include: the type of the source process engine to which the source XML file belongs, and the type of the target process engine to which the source XML file is to be migrated. Parse the source XML file to obtain the code corresponding to the first element identifier, the code corresponding to the first element attribute, the source flow condition code, the code corresponding to the source participant, and the code corresponding to the association relationship. The association relationship represents the execution order of multiple first elements. Obtain the relative positions of multiple first primitives in the flowchart canvas of the source process engine from the source XML file; Based on the preset size of the flowchart canvas belonging to the source process engine, the size of the flowchart canvas belonging to the target process engine, and the relative positions of the plurality of first elements in the flowchart canvas of the source process engine, the relative positions of the plurality of second elements in the flowchart canvas of the target process engine are determined, and each first element corresponds to a second element belonging to the target process engine. According to the XML file rules defined by the target process engine, the code corresponding to the first graphic element identifier is converted into the first code belonging to the target process engine, the code corresponding to the first graphic element attribute is converted into the second code belonging to the target process engine, the source flow condition code is converted into the third code belonging to the target process engine, the code corresponding to the source participant is converted into the fourth code belonging to the target process engine, and the association relationship is converted into the fifth code belonging to the target process engine. The first code, the second code, the third code, the fourth code, and the fifth code are recombined according to the XML file format defined by the target process engine to obtain a target XML file belonging to the target process engine.

2. The method for converting Extensible Markup Language (XML) files according to the process model described in claim 1, characterized in that, The steps for obtaining the association from the source XML file include: Obtain the element hierarchy corresponding to each of the first elements from the source XML file; For each first graph element belonging to the same graph element level, based on the gateway type, out-degree, in-degree, and order of the sorting result corresponding to the first graph element, the connection relationship between the first graph element and the first graph element in the previous graph element level is determined to obtain the connection relationship corresponding to multiple first graph elements respectively. The sorting result is the result of sorting the first graph elements belonging to the same graph element level according to the order in the source XML file. The association relationship is obtained, which represents the element hierarchy corresponding to the multiple first elements and the connection relationship corresponding to the multiple first elements.

3. The method for converting Extensible Markup Language (XML) files according to the process model described in claim 2, characterized in that, The step of obtaining the association relationship for each of the first primitives includes: If the connection relationship of the first graphic element indicates that the first graphic element is not connected to the first graphic element located at the previous graphic element level, the level number of the graphic element level where the first graphic element is located is taken as the graphic element level number of the first graphic element. The order in which the first graphic element is located in the sorting result is used as the sequence number of the first graphic element. If the connection relationship of the first graphic element indicates that the first graphic element is connected to a target first graphic element located at the previous graphic element level, the number of the target first graphic element is used as the level number of the first graphic element. The order in which the first graphic element is located in the sorting result is used as the sequence number of the first graphic element. Determining the association relationship of the first graphic element includes the number of the first graphic element, which includes the graphic element level number and the sequence number.

4. The XML file conversion method for the process model according to claim 1, characterized in that, Also includes: Based on the relative positions of the multiple second primitives on the flowchart canvas in the target process engine, the positions of the multiple second primitives on the flowchart canvas in the target process engine are set.

5. A device for converting process models to Extensible Markup Language (XML) files, characterized in that, include: The first acquisition module is used to acquire the migration instructions of the source XML file corresponding to the process model. The migration instructions include: the type of the source process engine to which the source XML file belongs, and the type of the target process engine to which the source XML file is to be migrated. The second acquisition module is used to parse the source XML file to obtain the code corresponding to the first graphic element identifier, the code corresponding to the first graphic element attribute, the source flow condition code, the code corresponding to the source participant, and the code corresponding to the association relationship, wherein the association relationship represents the sequential execution order of multiple first graphic elements; The second acquisition module is used to acquire the relative positions of multiple first graphic elements in the flowchart canvas of the source process engine from the source XML file; The first determining module is used to determine the relative positions of multiple second elements in the flowchart canvas of the target process engine based on the preset size of the flowchart canvas belonging to the source process engine, the size of the flowchart canvas belonging to the target process engine, and the relative positions of the multiple first elements in the flowchart canvas of the source process engine, wherein each first element corresponds to a second element belonging to the target process engine. The conversion module is used to convert the code corresponding to the first graphic element identifier into first code belonging to the target process engine, the code corresponding to the first graphic element attribute into second code belonging to the target process engine, the source flow condition code into third code belonging to the target process engine, the code corresponding to the source participant into fourth code belonging to the target process engine, and the association relationship into fifth code belonging to the target process engine, according to the XML file rules defined by the target process engine. The reorganization module is used to reorganize the first code, the second code, the third code, the fourth code, and the fifth code according to the XML file format defined by the target process engine to obtain a target XML file belonging to the target process engine.

6. The Extensible Markup Language (XML) file conversion device according to the process model described in claim 5, characterized in that, The second acquisition module includes: The first acquisition unit is used to obtain the primitive hierarchy corresponding to the multiple first primitives from the source XML file; The first determining unit is used to determine the connection relationship between the first graphic element and the first graphic element located in the previous graphic element level for each first graphic element belonging to the same graphic element level, based on the gateway type, out-degree, in-degree and the order of the sorting result corresponding to the first graphic element, so as to obtain the connection relationship corresponding to multiple first graphic elements respectively. The sorting result is the result of sorting the first graphic elements belonging to the same graphic element level according to the order of their location in the source XML file. The second acquisition unit is used to obtain the association relationship, which represents the element hierarchy corresponding to the plurality of first elements and the connection relationship corresponding to the plurality of first elements.

7. The Extensible Markup Language (XML) file conversion apparatus for the process model according to claim 6, wherein for each first graphic element, the second acquisition unit comprises: The first determining subunit is used to determine the level number of the first graphic element as the graphic element level number of the first graphic element if the connection relationship of the first graphic element indicates that the first graphic element is not connected to the first graphic element located in the previous graphic element level. The second determining subunit is used to take the order in which the first graphic element is located in the sorting result as the order number of the first graphic element. The third determining subunit is used to determine the level number of the first graphic element if the connection relationship of the first graphic element indicates that the first graphic element is connected to a target first graphic element located at the previous graphic element level. The fourth determining subunit is used to take the order of the first graphic element in the sorting result as the order number of the first graphic element. The fifth determining subunit is used to determine the association relationship of the first graphic element, including the number of the first graphic element, which includes the graphic element level number and the sequence number.

8. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the Extensible Markup Language (XML) file conversion method of the process model as described in any one of claims 1 to 4.

9. A computer-readable storage medium, wherein instructions in the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform an Extensible Markup Language (XML) file conversion method according to the process model of any one of claims 1 to 4.

Citation Information

Patent Citations

  • Page generating method based on BPMN (business process modeling notation) and device

    CN102520953A

  • Integrated on-line trading and extension service system for cultural and creative products

    CN104268778A