Business document processing method and system based on BPMN error boundary event

By embedding BPMN error boundary events in the business process, the BpmnError error is captured and processed, and the service side interface is directly called to ensure that the business documents and process node status are consistent, solving the problem of difficult to ensure the consistency between the business documents and process node status in the existing technology, and achieving high-reliability business processing.

CN118689470BActive Publication Date: 2025-03-18SHANDONG INSPUR DIGITAL BUSINESS TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411156519.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2025-03-18
Estimated Expiration
2044-08-22

AI Technical Summary

Technical Problem

In the business processing type, the consistency between the business documents and process nodes is difficult to ensure, resulting in the "fake failure, real success", and the lack of effective log auditing methods, which brings huge hidden dangers to the business.

Method used

The business document processing method based on BPMN error boundary event is adopted. By embedding error boundary events in the business process, the BpmnError error thrown by the process activity service task node is captured, and the business side can be directly called to the executable interface, and the process node status data is carried to notify the business side to ensure that the business documents are consistent with the process node status, and keep traces through log records to facilitate subsequent review and audit.

Benefits of technology

The consistency between the business documents and the process node status is achieved, and the business documents rollback caused by network delay or other abnormalities is avoided, which enhances the reliability and transparency of the business and reduces hidden dangers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118689470B_ABST
    Figure CN118689470B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of workflow data processing, and in particular to a business document processing method and system based on BPMN error boundary events. The business document processing method based on BPMN error boundary events uses the business process modeling symbol BPMN to design the business process. After the BpmnError error is thrown, the error event is captured, triggering the boundary event, and the workflow calls the executable interface on the business side, and carries the process node status data to notify the business side, ensuring that the business document is consistent with the process node status; the log records the calling process to achieve status tracking and leaving traces. The business document processing method and system based on BPMN error boundary events realize business data rollback without destroying the business logic structure, solves the problem of consistency between business documents and process node status, maintains business integrity while being unaware of the business and process, and can meet the horizontal expansion of business logic in different business scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of workflow data processing, and in particular to a business document processing method and system based on BPMN error boundary events. Background Art

[0002] At present, more and more business scenarios use general process modeling technology based on the business process modeling symbol BPMN2.0 (Business Process Modeling Notation) to realize business flow, such as: procurement quality inspection, workshop comprehensive evaluation process, general distribution ordering strategy, store grade evaluation plan, freight settlement review process, etc. By cooperating with workflow, the business processing efficiency can be greatly improved.

[0003] Generally speaking, the interaction between workflow and business can be divided into two situations: process handling and business handling. In actual business scenarios, the decoupling of business operations from workflow operations will inevitably lead to data consistency issues.

[0004] The process handling does not need to consider the interaction between business documents. When pending approval, the business documents are directly embedded through the iframe tag, which is only used for jumping;

[0005] Business processing requires calling the runTask() interface of the workflow through the remote procedure call protocol RPC in the code (the remote procedure call protocol RPC call is generally implemented through gateway forwarding). In addition to considering the interaction between business documents, the interaction between business documents and workflows must also be considered.

[0006] Therefore, the common practice in the industry is to remotely call the workflow interface through the gateway. Whether the business document is submitted or rolled back depends on the response result status code after the gateway (used to achieve communication and data forwarding exchange between different networks) forwards the workflow interface.

[0007] As attached Figure 1 As shown in the figure, if the response status code is 200 (200 is the status code in the HTTP protocol, indicating that the server successfully processed the client request), the business side executes the business document submission action;

[0008] If the response status is not 200, the business side performs the business document rollback operation.

[0009] However, in actual applications, this solution has potential unknown abnormal risks and often results in "false failure, real success" situations.

[0010] Specifically, the business side first calls the workflow interface through the gateway geteway, and then the workflow forwards the call result status to the gateway, and the gateway then forwards the result status to the business side; the business side determines whether the business document is submitted or rolled back based on the status result returned by the gateway, which is relatively passive; and the intermediate interaction process is completely dependent on the quality of network communication. If there is a delay in network communication or network congestion or jitter, the gateway forwarding result may be abnormal. Obviously, the workflow call is successful and the process node status is successfully updated, but the gateway returns to the business side with network delays or other abnormalities, resulting in the rollback of the business document and the inconsistency between the business document status and the process node. The business side cannot fully trust the response result status of the gateway, and the business side is relatively passive in processing business documents. In addition, there is a lack of effective log auditing methods, and the data status of the two cannot be accurately recorded, which brings huge hidden dangers to the business.

[0011] Therefore, how to better solve the consistency between business documents and process node status in business processing types is an urgent problem that needs to be solved in current actual business scenarios.

[0012] In order to better solve the problem of consistency between business documents and process node states, the present invention proposes a business document processing method and system based on BPMN error boundary events. Summary of the invention

[0013] In order to make up for the defects of the prior art, the present invention provides a simple and efficient business document processing method and system based on BPMN error boundary events.

[0014] The present invention is achieved through the following technical solutions:

[0015] A business document processing method based on BPMN error boundary event, characterized in that: using business process modeling symbol BPMN to design business process, embedding error boundary event into sub-process, caller activity or custom node;

[0016] When the process activity service task serviceTask (used to automatically execute predefined services or operations) node to which the error boundary event is attached throws a BpmnError error, the error event is captured, triggering the boundary event. The workflow directly calls the business-side executable interface and carries the process node status data to notify the business side to ensure that the business document is consistent with the process node status. At the same time, the calling process is recorded in the form of logs to track the business document and process node status for subsequent review and audit.

[0017] The following steps are involved:

[0018] Step S1, define the executable interface of the target business component. The interface path is composed of business type, business code, V, version number and / upd from front to back. The version number is automatically incremented from 1 according to the same type of business. All interface request modes are set to send POST for the next business document status update action.

[0019] Step S2: Maintain the target executable interface of each business component into the X1 platform dictionary list. When the X1 platform is initialized, convert the dictionary list into a JSON (JavaScript Object Notation) string and cache it in the remote dictionary server Redis (Remote Dictionary Server) cache database for subscription by the service task serviceTask node.

[0020] In the step S2, the key key of the dictionary list JSON string in the remote dictionary server Redis cache database is the business process modeling notation application service interface queue list BPMN_API_QUEUE_LIST;

[0021] Each item in the business process modeling notation application service interface queue list BPMN_API_QUEUE_LIST is a dictionary item composed of a key-value pair key-value, which is used to maintain the business target executable interface properties; wherein the dictionary key key represents the unique code of a business target executable interface, and is composed of the prefix BPMN_API_, business type, business code, V and business method increment from front to back, which is consistent with the interface path defined in step S1, and the dictionary value value represents the actual URL address of the corresponding interface.

[0022] Step S3: provide a boundary event software development kit SDK (Software Development Kit) plug-in, and use the boundary event software development kit SDK plug-in to encapsulate the boundary event BORDER_EVT;

[0023] The boundary event BORDER_EVT is expanded according to the actual business situation, and the process engine side is pluggable and dynamically upgraded;

[0024] The process engine bpm-server (Business Process Management server) relies on the boundary event software development kit SDK plug-in. When the process engine module is started, the boundary event BORDER_EVT is instantiated as a Bean and initialized into the Spring container to prepare for the next process node subscription;

[0025] Step S4: Customize process nodes according to actual business scenario requirements. The node type at least includes user task nodes.<bpmn2: userTask> and service task nodes<bpmn2: serviceTask> Two categories,

[0026] Among them, the user task node<bpmn2: userTask> The handling method is process handling, which does not require interaction with the business;

[0027] Service Task Node<bpmn2: serviceTask> It is the target process node, and the handling method is business handling, which requires interaction with the business;

[0028] In step S4, the target process node is selected, and an expression mode is selected for it, and it is bound as follows:

[0029] ${BORDER_EVT.EXE(execution, business target executable interface dictionary Key)};

[0030] Among them, the execution context method EXE() is an internal method encapsulated by the Bean instance boundary event BORDER_EVT, which is used to capture error boundary events and execute specific business logic;

[0031] The expression referencing the Bean instance must start with $ and end with};

[0032] Execution represents the built-in process environment variable of the workflow. The business target executable interface dictionary key key is taken from an item in the business process modeling symbol application service interface queue list BPMN_API_QUEUE_LIST dictionary list in the Redis cache database of the remote dictionary server (selected according to the actual business scenario);

[0033] Step S5: On the workflow side, the process engine bpm-server is executed to capture error boundary events;

[0034] When the business process reaches the target process node, the process engine bpm-server performs the following operations:

[0035] Step S5.1, the process engine bpm-server obtains the boundary event BORDER_EVT instance from the Spring container, uses the JAVA reflection mechanism to call the execution context method EXE(), executes the workflow running task method runTask() in the execution context method EXE(), and completes the process passing operation;

[0036] Step S5.2, execute the context method EXE() according to the running result of the running task method runTask() (the running result is defined as BpmResult <List <taskdto>>, that is, business process result < list < task data transfer object) to decide whether to throw a BpmnError error boundary exception:

[0037] If the business process result BpmResult response status code is 200, the BpmnError error boundary event is not triggered and the flow continues to the next node;

[0038] If the business process result BpmResult response status code is not 200, a BpmnError error is directly thrown to trigger an error boundary event. At this time, the execution context method EXE() performs the following operations:

[0039] Step S5.2.1, execute the context method EXE() to execute the execution variable method execution.getVariable("BPMN_BUSI_PARAMS") to obtain the business document parameters and process instance related parameters passed from the process instance variables;

[0040] Step S5.2.2, the execution context method EXE() defines a flow status parameter flowStatus, and writes it back to the process instance parameter obtained in the previous step S5.2.1 to mark the actual status of the current process node;

[0041] Step S5.2.3, the execution context method EXE() calls the method DictUtil.getDictValueByKey (business target executable interface dictionary key) for obtaining dictionary values ​​by key according to the business target executable interface dictionary key key pre-subscribed by the target process node to obtain the business target executable interface uniform resource locator URL; at this time, the execution context method EXE() uses the HttpClient client to carry the obtained business parameters together with the process instance parameters to remotely call the business target executable interface to implement the business document status update action;

[0042] Step S6: On the business component side, each target business component has a built-in logging SDK software development kit, which provides unified logging logic. When the workflow triggers the BpmnError error boundary event, the business target executable interface is called back, and the execution process of the business end interface is stored in the form of a JSON string. The result returned by the business target interface is defined as BaseResult. <object>, i.e. the base result <object>;

[0043] If the BaseResult response code is 200, it means that the business document status is updated successfully. The business document status busiStatus in the JSON string is updated to the process node status flowStatus, indicating that the callback of the business document status is successful.

[0044] If the BaseResult response code is not 200, it means that an unknown exception occurs in the business document status update. The business document status busiStatus in the JSON string is updated to 99, and the process node status flowStatus is updated to the actual status of the current process node, indicating that the callback of the business document status has failed.

[0045] Furthermore, in step S6, the tracking log method LogUtil.traceLog (JSON string) of the SDKK software development kit is called to store the actual JSON result string generated by the calling process of steps S5 to S6 into the log library to facilitate subsequent manual audits and secondary compensation calls.

[0046] A system for implementing the business document processing method based on BPMN error boundary events of the present invention comprises:

[0047] The target business component executable interface definition module is used to define the target business component executable interface. The interface path is composed of business type, business code, V, version number and / upd from front to back. The version number is automatically incremented from 1 according to the same type of business. All interface request methods are set to send POST.

[0048] The target business component executable interface publishing module is used to maintain the target business component executable interface in the X1 platform dictionary list. When the X1 platform is initialized, the dictionary list is converted into a JSON (JavaScript Object Notation) string and cached in the remote dictionary server Redis (Remote DictionaryServer) cache database for subscription by the service task serviceTask node;

[0049] The boundary event software development kit SDK plug-in module is used to define the boundary event BORDER_EVT and inject its dependencies into the process engine bpm-server. When the process engine module is started, the boundary event BORDER_EVT is instantiated as a Bean and initialized into the Spring container to prepare for the next process node subscription;

[0050] The workflow node subscription executable interface module is responsible for customizing the process node according to the actual business scenario requirements, selecting the target node of the service task node serviceTask type, and selecting the expression method for it. According to the business process modeling symbol BPMN2.0 definition specification, the target node is bound as follows:

[0051] ${BORDER_EVT.EXE(execution,'Business target executable interface dictionary key')};

[0052] The workflow boundary event capture and trigger module is responsible for executing the process engine bpm-server on the workflow side and capturing error boundary events. The workflow decides whether to throw the BpmnError error boundary event and whether to call the business document interface based on the execution result of the task method runTask(), and notifies the business side to execute the corresponding logic.

[0053] The business document processing and log audit module is responsible for the built-in logging SDK software development kit in each target business component on the business component side. The logging SDK software development kit provides unified logging logic; it updates the business document status busiStatus and the process node status flowStatus according to the actual execution situation, encapsulates the execution process as JSON and string it into the log library, thereby ensuring the consistency of the two states.

[0054] A business document processing device based on BPMN error boundary events, characterized in that it includes a memory and a processor; the memory is used to store a computer program, and the processor is used to implement the above-mentioned method steps when executing the computer program.

[0055] A readable storage medium, characterized in that: a computer program is stored on the readable storage medium, and when the computer program is executed by a processor, the method steps described above are implemented.

[0056] The beneficial effects of the present invention are as follows: the business document processing method and system based on BPMN error boundary events provide a flexible binding and subscription relationship between business documents and process nodes, logically decouple the operation of business documents from the operation of process processing, realize business data rollback without destroying the business logic structure, solve the problem of consistency between business documents and process node states, maintain business integrity while being insensitive to business and processes, can meet the horizontal expansion of business logic in different business scenarios, and have no code intrusion impact on the process engine. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0058] Attached Figure 1 The present invention is a schematic diagram of a communication method for processing services and processes by an industry gateway in the prior art.

[0059] Attached Figure 2 It is a schematic diagram of a business document processing method based on BPMN error boundary events of the present invention.

[0060] Attached Figure 3 It is a schematic diagram of a business document processing system based on BPMN error boundary events of the present invention.

[0061] Attached Figure 4 It is a schematic diagram of a business document processing system application method based on BPMN error boundary events of the present invention. DETAILED DESCRIPTION

[0062] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0063] Attached Figure 1 This is a schematic diagram of a commonly used logging method in the prior art. Obviously, this method requires intrusion into the business code, and the logging template configuration is not flexible enough.

[0064] The business document processing method based on BPMN error boundary event uses the business process modeling symbol BPMN to design the business process and embeds the error boundary event into the sub-process, caller activity or custom node;

[0065] When the process activity service task serviceTask (used to automatically execute predefined services or operations) node to which the error boundary event is attached throws a BpmnError error, the error event is captured, triggering the boundary event. The workflow directly calls the business-side executable interface and carries the process node status data to notify the business side to ensure that the business document is consistent with the process node status. At the same time, the calling process is recorded in the form of logs to track the business document and process node status for subsequent review and audit.

[0066] Based on the business process modeling symbol BPMN error boundary event, the business-side executable interface is actively notified, and business parameters and process instance parameters (including process status) are carried to ensure the consistency of data status on both sides; at the same time, each triggering process log is recorded to ensure the accuracy of the data status and facilitate subsequent review and tracking audits.

[0067] This avoids the problem of inconsistency between business documents and process node data caused by the uncertainty of forwarding by the gateway as an intermediary.

[0068] As attached Figure 2 As shown, the business document processing method based on the BPMN error boundary event includes the following steps:

[0069] Step S1, define the executable interface of the target business component. The interface path is composed of business type, business code, V, version number and / upd from front to back. The version number is automatically incremented from 1 according to the same type of business. All interface request modes are set to send POST for the next business document status update action.

[0070] Step S2: Maintain the target executable interface of each business component into the X1 platform dictionary list. When the X1 platform is initialized, convert the dictionary list into a JSON (JavaScript Object Notation) string and cache it in the remote dictionary server Redis (Remote Dictionary Server) cache database for subscription by the service task serviceTask node.

[0071] In the step S2, the key key of the dictionary list JSON string in the remote dictionary server Redis cache database is the business process modeling notation application service interface queue list BPMN_API_QUEUE_LIST;

[0072] Each item in the business process modeling notation application service interface queue list BPMN_API_QUEUE_LIST is a dictionary item composed of a key-value pair key-value, which is used to maintain the business target executable interface properties; wherein the dictionary key key represents the unique code of a business target executable interface, and is composed of the prefix BPMN_API_, business type, business code, V and business method increment from front to back, which is consistent with the interface path defined in step S1, and the dictionary value value represents the actual URL address of the corresponding interface.

[0073] Step S3: provide a boundary event software development kit SDK (Software Development Kit) plug-in, and use the boundary event software development kit SDK plug-in to encapsulate the boundary event BORDER_EVT;

[0074] The boundary event BORDER_EVT is expanded according to the actual business situation, and the process engine side is pluggable and dynamically upgraded;

[0075] The process engine bpm-server (Business Process Management server) relies on the boundary event software development kit SDK plug-in. When the process engine module is started, the boundary event BORDER_EVT is instantiated as a Bean and initialized into the Spring container to prepare for the next process node subscription;

[0076] Step S4: Customize process nodes according to actual business scenario requirements. The node type at least includes user task nodes.<bpmn2: userTask> and service task nodes<bpmn2: serviceTask> Two categories,

[0077] Among them, the user task node<bpmn2: userTask> The handling method is process handling, which does not require interaction with the business;

[0078] Service Task Node<bpmn2: serviceTask> It is the target process node, and the handling method is business handling, which requires interaction with the business;

[0079] In step S4, the target process node is selected, and an expression mode is selected for it, and it is bound as follows:

[0080] ${BORDER_EVT.EXE(execution, business target executable interface dictionary Key)};

[0081] Among them, the execution context method EXE() is an internal method encapsulated by the Bean instance boundary event BORDER_EVT, which is used to capture error boundary events and execute specific business logic;

[0082] The expression referencing the Bean instance must start with $ and end with};

[0083] Execution represents the built-in process environment variable of the workflow. The business target executable interface dictionary key key is taken from an item in the business process modeling symbol application service interface queue list BPMN_API_QUEUE_LIST dictionary list in the Redis cache database of the remote dictionary server (selected according to the actual business scenario);

[0084] Step S5: On the workflow side, the process engine bpm-server is executed to capture error boundary events;

[0085] When the business process reaches the target process node, the process engine bpm-server performs the following operations:

[0086] Step S5.1, the process engine bpm-server obtains the boundary event BORDER_EVT instance from the Spring container, uses the JAVA reflection mechanism to call the execution context method EXE(), executes the workflow running task method runTask() in the execution context method EXE(), and completes the process passing operation;

[0087] Step S5.2, execute the context method EXE() according to the running result of the running task method runTask() (the running result is defined as BpmResult <List <taskdto>>, that is, business process result < list < task data transfer object) to decide whether to throw a BpmnError error boundary exception:

[0088] If the business process result BpmResult response status code is 200, the BpmnError error boundary event is not triggered and the flow continues to the next node;

[0089] If the business process result BpmResult response status code is not 200, a BpmnError error is directly thrown to trigger an error boundary event. At this time, the execution context method EXE() performs the following operations:

[0090] Step S5.2.1, execute the context method EXE() to execute the execution variable method execution.getVariable("BPMN_BUSI_PARAMS") to obtain the business document parameters and process instance related parameters passed from the process instance variables;

[0091] Step S5.2.2, the execution context method EXE() defines a flow status parameter flowStatus, and writes it back to the process instance parameter obtained in the previous step S5.2.1 to mark the actual status of the current process node;

[0092] Step S5.2.3, the execution context method EXE() calls the method DictUtil.getDictValueByKey (business target executable interface dictionary key) for obtaining dictionary values ​​by key according to the business target executable interface dictionary key key pre-subscribed by the target process node to obtain the business target executable interface uniform resource locator URL; at this time, the execution context method EXE() uses the HttpClient client to carry the obtained business parameters together with the process instance parameters to remotely call the business target executable interface to implement the business document status update action;

[0093] Step S6: On the business component side, each target business component has a built-in logging SDK software development kit, which provides unified logging logic. When the workflow triggers the BpmnError error boundary event, the business target executable interface is called back, and the execution process of the business end interface is stored in the form of a JSON string. The result returned by the business target interface is defined as BaseResult. <object>, i.e. the base result <object>;

[0094] If the BaseResult response code is 200, it means that the business document status is updated successfully. The business document status busiStatus in the JSON string is updated to the process node status flowStatus, indicating that the callback of the business document status is successful.

[0095] If the BaseResult response code is not 200, it means that an unknown exception occurs in the business document status update. The business document status busiStatus in the JSON string is updated to 99, and the process node status flowStatus is updated to the actual status of the current process node, indicating that the callback of the business document status has failed.

[0096] Furthermore, in step S6, the tracking log method LogUtil.traceLog (JSON string) of the SDKK software development kit is called to store the actual JSON result string generated by the calling process of steps S5 to S6 into the log library to facilitate subsequent manual audits and secondary compensation calls.

[0097] As attached Figure 3 As shown, the system for implementing the business document processing method based on the BPMN error boundary event includes:

[0098] The target business component executable interface definition module is used to define the target business component executable interface. The interface path is composed of business type, business code, V, version number and / upd from front to back. The version number is automatically incremented from 1 according to the same type of business. All interface request methods are set to send POST.

[0099] The target business component executable interface publishing module is used to maintain the target business component executable interface in the X1 platform dictionary list. When the X1 platform is initialized, the dictionary list is converted into a JSON (JavaScript Object Notation) string and cached in the remote dictionary server Redis (Remote DictionaryServer) cache database for subscription by the service task serviceTask node;

[0100] The boundary event software development kit SDK plug-in module is used to define the boundary event BORDER_EVT and inject its dependencies into the process engine bpm-server. When the process engine module is started, the boundary event BORDER_EVT is instantiated as a Bean and initialized into the Spring container to prepare for the next process node subscription;

[0101] The workflow node subscription executable interface module is responsible for customizing the process node according to the actual business scenario requirements, selecting the target node of the service task node serviceTask type, and selecting the expression method for it. According to the business process modeling symbol BPMN2.0 definition specification, the target node is bound as follows:

[0102] ${BORDER_EVT.EXE(execution,'Business target executable interface dictionary key')};

[0103] The workflow boundary event capture and trigger module is responsible for executing the process engine bpm-server on the workflow side and capturing error boundary events. The workflow decides whether to throw the BpmnError error boundary event and whether to call the business document interface based on the execution result of the task method runTask(), and notifies the business side to execute the corresponding logic.

[0104] The business document processing and log audit module is responsible for the built-in logging SDK software development kit in each target business component on the business component side. The logging SDK software development kit provides unified logging logic; it updates the business document status busiStatus and the process node status flowStatus according to the actual execution situation, encapsulates the execution process as JSON and string it into the log library, thereby ensuring the consistency of the two states.

[0105] The business document processing device based on BPMN error boundary events includes a memory and a processor; the memory is used to store a computer program, and the processor is used to implement the above-mentioned method steps when executing the computer program.

[0106] The readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described above are implemented.

[0107] Compared with the prior art, the business document processing method and system based on BPMN error boundary events has the following characteristics:

[0108] First, it provides a flexible binding and subscription relationship between business documents and process nodes. Without restarting the process engine, the business programming interface uniform resource locator URL can be updated at any time. The interface can be automatically superimposed according to the business attribute version, and the interface version can be updated by simply refreshing the cache.

[0109] Second, the business document operation and process processing operation are completely decoupled logically, and the status of both the business and process sides are controlled through boundary events. On the basis of not destroying the business logic structure, business data rollback is realized, which not only maintains business integrity but also has no impact on business and process.

[0110] Third, it can meet the horizontal expansion of business logic in different business scenarios without code intrusion into the process engine;

[0111] Fourth, it provides a log audit and tracking method for processes and businesses. If the status of the two is inconsistent, subsequent manual intervention can be timely to compensate for business data.

[0112] The embodiment described above is only one specific implementation of the present invention. Common changes and substitutions made by those skilled in the art within the scope of the technical solution of the present invention should be included in the protection scope of the present invention.< / object> < / taskdto> < / object> < / taskdto>

Claims

1. A business document processing method based on BPMN error boundary events, characterized by: Use the business process modeling notation BPMN to design business processes and embed error boundary events into sub-processes, caller activities or custom nodes; When the process activity service task serviceTask node to which the error boundary event is attached throws a BpmnError error, the error event is captured, triggering the boundary event. The workflow directly calls the executable interface on the business side and carries the process node status data to notify the business side to ensure that the business document is consistent with the process node status. At the same time, the calling process is recorded in the form of logs to track the business document and process node status, which is convenient for subsequent review and audit. The following steps are involved: Step S1, define the executable interface of the target business component. The interface path is composed of business type, business code, V, version number and / upd from front to back. The version number is automatically incremented from 1 according to the same type of business. All interface request modes are set to send POST for the next business document status update action. Step S2: Maintain the target executable interface of each business component into the X1 platform dictionary list. When the X1 platform is initialized, convert the dictionary list into a JSON string and cache it in the remote dictionary server Redis cache database for subscription by the service task serviceTask node. Step S3: provide a boundary event software development kit SDK plug-in, and use the boundary event software development kit SDK plug-in to encapsulate the boundary event BORDER_EVT; The process engine bpm-server relies on the boundary event software development kit SDK plug-in. When the process engine module is started, the boundary event BORDER_EVT is instantiated as a Bean and initialized into the Spring container to prepare for the next process node subscription; Step S4: Customize process nodes according to actual business scenario requirements. The node type at least includes user task nodes.<bpmn2: userTask> and service task nodes<bpmn2: serviceTask> Two categories, Among them, the user task node<bpmn2: userTask> The handling method is process handling, which does not require interaction with the business; Service Task Node<bpmn2: serviceTask> It is the target process node, and the handling method is business handling, which requires interaction with the business; Select the target process node and choose the expression mode for it, and bind it as follows: ${BORDER_EVT.EXE(execution, business target executable interface dictionary Key)}; Step S5: On the workflow side, the process engine bpm-server is executed to capture error boundary events; When the business process reaches the target process node, the process engine bpm-server performs the following operations: Step S5.1, the process engine bpm-server obtains the boundary event BORDER_EVT instance from the Spring container, uses the JAVA reflection mechanism to call the execution context method EXE(), executes the workflow running task method runTask() in the execution context method EXE(), and completes the process passing operation; Step S5.2, the execution context method EXE() determines whether to throw a BpmnError error boundary exception according to the running result of the running task method runTask(): If the business process result BpmResult response status code is 200, the BpmnError error boundary event is not triggered and the flow continues to the next node; If the business process result BpmResult response status code is not 200, a BpmnError error is directly thrown to trigger an error boundary event. At this time, the execution context method EXE() performs the following operations: Step S5.2.1, execute the context method EXE() to execute the execution variable method execution.getVariable("BPMN_BUSI_PARAMS") to obtain the business document parameters and process instance related parameters passed from the process instance variables; Step S5.2.2, the execution context method EXE() defines a flow status parameter flowStatus, and writes it back to the process instance parameter obtained in the previous step S5.2.1 to mark the actual status of the current process node; Step S5.2.3, the execution context method EXE() calls the method DictUtil.getDictValueByKey to obtain the business target executable interface uniform resource locator URL according to the business target executable interface dictionary key key pre-subscribed by the target process node; at this time, the execution context method EXE() uses the HttpClient client to carry the obtained business parameters, together with the process instance parameters, to remotely call the business target executable interface to implement the business document status update action; Step S6: On the business component side, each target business component has a built-in logging SDK software development kit, which provides unified logging logic. When the workflow triggers the BpmnError error boundary event, the business target executable interface is called back, and the execution process of the business end interface is stored in the form of a JSON string. The result returned by the business target interface is defined as BaseResult. <object>, i.e. the base result <object>; If the BaseResult response code is 200, it means that the business document status is updated successfully. The business document status busiStatus in the JSON string is updated to the process node status flowStatus, indicating that the callback of the business document status is successful. If the BaseResult response code is not 200, it means that an unknown exception occurs in the business document status update. The business document status busiStatus in the JSON string is updated to 99, and the process node status flowStatus is updated to the actual status of the current process node, indicating that the callback of the business document status has failed.

2. The business document processing method based on BPMN error boundary event according to claim 1 is characterized in that: In the step S2, the key key of the dictionary list JSON string in the remote dictionary server Redis cache database is the business process modeling notation application service interface queue list BPMN_API_QUEUE_LIST; Each item in the business process modeling notation application service interface queue list BPMN_API_QUEUE_LIST is a dictionary item composed of a key-value pair key-value, which is used to maintain the business target executable interface properties; wherein the dictionary key key represents the unique code of the business target executable interface, which is composed of the prefix BPMN_API_, business type, business code, V and business method increment from front to back, and is consistent with the interface path defined in step S1, and the dictionary value value represents the actual URL address of the corresponding interface.

3. The business document processing method based on BPMN error boundary event according to claim 1 is characterized in that: In the step S4, the execution context method EXE() is an internal method encapsulated by the Bean instance boundary event BORDER_EVT, which is used to capture the error boundary event and execute specific business logic; Execution represents the built-in process environment variable of the workflow. The business target executable interface dictionary key key is taken from the business process modeling symbol application service interface queue list BPMN_API_QUEUE_LIST dictionary list in the Redis cache database of the remote dictionary server.

4. The business document processing method based on BPMN error boundary event according to claim 1 is characterized in that: In step S6, the tracking log method LogUtil.traceLog (JSON string) of the SDKK software development kit is called to store the actual JSON result string generated by the calling process of steps S5 to S6 into the log library to facilitate subsequent manual audits and secondary compensation calls.

5. A system for implementing the business document processing method based on BPMN error boundary event according to any one of claims 1 to 4, characterized in that: include: The target business component executable interface definition module is used to define the target business component executable interface. The interface path is composed of business type, business code, V, version number and / upd from front to back. The version number is automatically incremented from 1 according to the same type of business. All interface request methods are set to send POST. The target business component executable interface publishing module is used to maintain the target business component executable interface in the X1 platform dictionary list. When the X1 platform is initialized, the dictionary list is converted into a JSON string and cached in the remote dictionary server Redis cache database for subscription by the service task serviceTask node; The boundary event software development kit SDK plug-in module is used to define the boundary event BORDER_EVT and inject its dependencies into the process engine bpm-server. When the process engine module is started, the boundary event BORDER_EVT is instantiated as a Bean and initialized into the Spring container to prepare for the next process node subscription; The workflow node subscription executable interface module is responsible for customizing the process node according to the actual business scenario requirements, selecting the target node of the service task node serviceTask type, and selecting the expression method for it. According to the business process modeling symbol BPMN2.0 definition specification, the target node is bound as follows: ${BORDER_EVT.EXE(execution,'Business target executable interface dictionary key')}; The workflow boundary event capture and trigger module is responsible for executing the process engine bpm-server on the workflow side and capturing error boundary events. The workflow decides whether to throw the BpmnError error boundary event and whether to call the business document interface based on the execution result of the task method runTask(), and notifies the business side to execute the corresponding logic. The business document processing and log audit module is responsible for the built-in logging SDK software development kit in each target business component on the business component side. The logging SDK software development kit provides unified logging logic; it updates the business document status busiStatus and the process node status flowStatus according to the actual execution situation, encapsulates the execution process as JSON and string it into the log library, thereby ensuring the consistency of the two states.

6. A business document processing device based on BPMN error boundary events, characterized in that: The method comprises a memory and a processor; the memory is used to store a computer program, and the processor is used to implement the method according to any one of claims 1 to 4 when executing the computer program.

7. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented. < / object>

Citation Information

Patent Citations

  • Workflow engine implement method based on dynamic language and event processing mechanism

    CN103279840A

  • Managing user information on an e-commerce system

    US7100195B1