A workflow engine-based process data processing method and device
By identifying discrepancies and dynamically and adaptively migrating process instances in the Flowable workflow engine, deadlocks and state inconsistencies caused by changes in process definition data are resolved, ensuring the continuity of enterprise business processes.
Patent Information
- Application Number
- CN202511087692.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-05
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2045-08-05
AI Technical Summary
When the process definition data changes, especially when the branch process involving the gateway node changes, the Flowable workflow engine cannot effectively support the migration of running process instances, resulting in deadlock or state inconsistency problems, and destroying the continuity of the business process.
By identifying the differences between the new and old versions of process definition data, the system dynamically and adaptively migrates running process instances. This includes virtual completion mapping and token eviction for missing branches, assigning new tokens to new branches, and rolling back modified branches to ensure that process instances execute correctly according to the new version of process definition data.
It enables dynamic adaptive migration of running process instances when branch processes change at gateway nodes, avoiding deadlock and state inconsistency issues and ensuring the continuity of enterprise business processes.
Smart Images

Figure CN120579948B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of process data processing, and in particular to a process data processing method and device based on a workflow engine. Background Art
[0002] The Flowable workflow engine is a lightweight open source workflow engine that supports the BPMN 2.0 specification. It is increasingly used to build business process management (BPM) systems in manufacturing companies such as steel, and can implement complex business process processing across different business departments.
[0003] When process definition data changes, the Flowable workflow engine provides a service class (ProcessMigrationService) to migrate running process instances to the new process definition data without disrupting existing business processes. However, this migration service does not natively support complex process definition data changes, such as changes to branch processes involving gateway nodes (Inclusive Gateway or Parallel Gateway) within the process. As a result, after migrating a running process instance to the new process definition data, the branch process changes at the gateway node cause the number of branches and execution tokens in the running process instance to mismatch with the number of branches in the new version of the process definition data. This can cause the Join Gateway node to fail to correctly collect all branch data, leading to deadlocks or inconsistent states, disrupting the continuity of the business process. Therefore, an improved process processing solution for the Flowable workflow engine is urgently needed to address these technical issues. Summary of the Invention
[0004] In view of this, the present application proposes a process data processing method and device based on a workflow engine, which is applied to the Flowable workflow engine. It can realize dynamic adaptive migration of running process instances when the branch process of the gateway node of the target process changes, thereby avoiding deadlock or state inconsistency problems caused by the migration of running process instances, and ensuring the continuity of the enterprise business process operation.
[0005] In a first aspect, the present application proposes a process data processing method based on a workflow engine, which is applied to the Flowable workflow engine. The method comprises:
[0006] In response to detecting that a version of process definition data of a target process has been changed, identifying difference information between a new version of process definition data and an old version of process definition data of the target process;
[0007] Determine, based on the difference information, whether a branch process change of a gateway node occurs in the target process; if a branch process change of a gateway node occurs, obtain a running process instance of the target process, and determine whether a current active node of the running process instance is located in the branch process of the gateway node;
[0008] If the current active node of the running process instance is located in the branch process of the gateway node, dynamic adaptive migration is performed on the branch process of the gateway node of the running process instance based on the difference information and the type of the gateway node, so as to dynamically migrate the running process instance to the new version of the process definition data; wherein the gateway node includes an inclusive gateway node and / or a parallel gateway node.
[0009] In an optional embodiment, the performing of dynamic adaptive migration of the branch process of the gateway node of the running process instance based on the difference information and the type of the gateway node to dynamically migrate the running process instance to the new version of the process definition data includes:
[0010] Determine, based on the difference information and the type of the gateway node, missing branches, newly added branches, and modified branches of a branch set when the gateway node executes according to the new version of the process definition data relative to a currently activated branch set of the running process instance;
[0011] Virtual completion mapping and token recovery are performed on the missing branch, a new token is allocated to the newly added branch to activate the task execution flow of the newly added branch according to the new version process definition data and the context data of the running process instance, and the process is rolled back on the modified branch to reconstruct the task execution flow according to the new version process definition data and the context data of the running process instance.
[0012] In an optional embodiment, determining, based on the difference information and the type of the gateway node, missing branches, newly added branches, and modified branches of a branch set when the gateway node executes according to the new version of the process definition data relative to a currently activated branch set of the running process instance includes:
[0013] When the gateway node is an inclusive gateway node, re-condition mapping of the branch process is performed on the inclusive gateway node according to the new conditional expression of the inclusive gateway node in the new version of the process definition data to generate an expected branch set;
[0014] The expected branch set is compared with the currently activated branch set of the running process instance to determine the missing branches, new branches and modified branches of the expected branch set relative to the currently activated branch set, thereby obtaining the missing branches, new branches and modified branches of the branch set when the gateway node is executed according to the new version of the process definition data relative to the currently activated branch set of the running process instance.
[0015] In an optional embodiment, determining, based on the difference information and the type of the gateway node, missing branches, newly added branches, and modified branches of a branch set when the gateway node executes according to the new version of the process definition data relative to a currently activated branch set of the running process instance includes:
[0016] When the gateway node is a parallel gateway node, the definition branch set of the parallel gateway node in the new version of the process definition data is compared with the currently activated branch set of the running process instance to determine the missing branches, new branches and modified branches of the definition branch set relative to the currently activated branch set, thereby obtaining the missing branches, new branches and modified branches of the branch set when the gateway node is executed according to the new version of the process definition data relative to the currently activated branch set of the running process instance.
[0017] In an optional embodiment, the method comprises:
[0018] If the current active node of the running process instance is located after the branch process of the gateway node, performing virtual completion mapping and token recovery on the current active node;
[0019] Roll back the running process instance to the previous process node of the gateway node, and allocate a new token to the previous process node to reactivate the task execution flow pointing to the gateway node according to the new version of the process definition data and the context data of the previous process node.
[0020] In an optional embodiment, the method comprises:
[0021] In response to detecting that a version of the process definition data of the target process has been rolled back, freezing the new version of the process definition data of the target process and reactivating the old version of the process definition data;
[0022] If the current active node of the running process instance is located in the branch process of the gateway node, then according to the difference information and the type of the gateway node, a dynamic adaptive rollback is performed on the branch process of the gateway node of the running process instance to dynamically roll back the running process instance to the old version of the process definition data.
[0023] In an optional embodiment, the performing of a dynamic adaptive rollback on the branch process of the gateway node of the running process instance based on the difference information and the type of the gateway node to dynamically roll back the running process instance to the old version of the process definition data includes:
[0024] Determine, based on the difference information and the type of the gateway node, missing branches, newly added branches, and modified branches of a branch set when the gateway node is executed according to the old version of the process definition data relative to a currently activated branch set of the running process instance;
[0025] Virtual completion mapping and token recovery are performed on the missing branch, a new token is allocated to the newly added branch to activate the task execution flow of the newly added branch according to the old version process definition data and the context data of the running process instance, and the process is rolled back on the modified branch to reconstruct the task execution flow according to the old version process definition data and the context data of the running process instance.
[0026] In an optional embodiment, determining, based on the difference information and the type of the gateway node, missing branches, newly added branches, and modified branches of a branch set when the gateway node executes according to the old version of the process definition data relative to a currently activated branch set of the running process instance includes:
[0027] When the gateway node is an inclusive gateway node, re-condition mapping of the branch process is performed on the inclusive gateway node according to the old conditional expression of the inclusive gateway node in the old version process definition data to generate an expected branch set;
[0028] The expected branch set is compared with the currently activated branch set of the running process instance to determine the missing branches, new branches and modified branches of the expected branch set relative to the currently activated branch set, thereby obtaining the missing branches, new branches and modified branches of the branch set when the gateway node is executed according to the old version of the process definition data relative to the currently activated branch set of the running process instance.
[0029] In an optional embodiment, the method comprises:
[0030] If the current active node of the running process instance is located after the branch process of the gateway node, performing virtual completion mapping and token recovery on the current active node;
[0031] Roll back the running process instance to a previous process node of the gateway node, and allocate a new token to the previous process node to reactivate the task execution flow pointing to the gateway node according to the old version process definition data and the context data of the previous process node.
[0032] In a second aspect, the present application further proposes a process data processing device based on a workflow engine, which is applied to a Flowable workflow engine. The device comprises:
[0033] a version detection module, configured to, in response to detecting that a version of process definition data of a target process has been changed, identify difference information between the new version process definition data and the old version process definition data of the target process;
[0034] an instance acquisition module, configured to determine, based on the difference information, whether a branch process change of a gateway node occurs in the target process; if a branch process change of a gateway node occurs, obtain a running process instance of the target process and determine whether a current active node of the running process instance is located in the branch process of the gateway node;
[0035] An instance migration module is configured to perform dynamic adaptive migration of the branch process of the gateway node of the running process instance based on the difference information and the type of the gateway node if the current active node of the running process instance is located in the branch process of the gateway node, so as to dynamically migrate the running process instance to the new version of the process definition data; wherein the gateway node includes an inclusive gateway node and / or a parallel gateway node.
[0036] This application can at least achieve the following beneficial effects:
[0037] This application identifies the difference information between the new version process definition data and the old version process definition data of the target process, and determines whether the branch process of the gateway node of the target process has changed based on the difference information. If the branch process of the gateway node has changed, the running process instance of the target process is obtained, and it is determined whether the current active node of the running process instance is located in the branch process of the gateway node. If the current active node of the running process instance is located in the branch process of the gateway node, then according to the difference information and the type of the gateway node, the branch process of the gateway node of the running process instance is dynamically adaptively migrated to dynamically migrate the running process instance to the new version process definition data. Thus, this application can realize the dynamic adaptive migration of all running process instances when the branch process of the gateway node of the target process changes, avoid deadlock or state inconsistency caused by the migration of the running process instance, and ensure the continuity of the enterprise business process operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. It should be understood that the following drawings only illustrate certain embodiments of the present application and should not be regarded as limiting the scope of the present application.
[0039] Figure 1 is a flowchart of a process data processing method based on a workflow engine in the first embodiment;
[0040] Figure 2 is an exemplary structural diagram of a target process including an inclusive gateway node;
[0041] Figure 3 is an exemplary structural diagram of a target process including parallel gateway nodes;
[0042] Figure 4 yes Figure 2 The schematic diagram of the structure of the target process after the change is shown;
[0043] Figure 5 yes Figure 3 The schematic diagram of the structure of the target process after the change is shown;
[0044] Figure 6 This is a partial flow chart of a process data processing method based on a workflow engine in the second embodiment;
[0045] Figure 7 is a partial flow chart of a process data processing method based on a workflow engine in the third embodiment;
[0046] Figure 8 is a partial flow chart of a process data processing method based on a workflow engine in a fourth embodiment;
[0047] Figure 9 is a partial flow chart of a process data processing method based on a workflow engine in a fifth embodiment;
[0048] Figure 10 is a partial flow chart of a process data processing method based on a workflow engine in a sixth embodiment;
[0049] Figure 11 is a structural diagram of a process data processing device based on a workflow engine in the first embodiment;
[0050] Figure 12 It is a partial structural diagram of a process data processing device based on a workflow engine in the second embodiment. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings of the embodiments of the present application. However, it should be understood that the described embodiments are only some exemplary embodiments of the present application, not all embodiments, and therefore the following detailed description of the embodiments of the present application is not intended to limit the scope of protection claimed in this application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of this application.
[0052] It should be noted that the terms "first", "second", etc. in the description and claims of this application are only used to distinguish and describe similar objects, rather than to describe a specific order or sequence, and cannot be understood as indicating or implying relative importance.
[0053] As mentioned above, the Flowable workflow engine does not provide native support for process instance migration for complex process definition data changes, such as changes to branch processes involving gateway nodes (Inclusive Gateway or Parallel Gateway) in the process. As a result, after the running process instance is migrated to the new process definition data, the branch process of the gateway node will change, causing the branches and execution tokens (Token) of the running process instance to not match the number of branches in the new version of the process definition data. The aggregation gateway (Join Gateway) node will not be able to correctly collect all branch data, resulting in deadlock or state inconsistency problems, which will destroy the continuity of the business process. To this end, the present application proposes a process data processing method and device based on a workflow engine, which is applied to the Flowable workflow engine. It can realize dynamic adaptive migration of running process instances when the branch process of the gateway node of the target process changes, thereby avoiding deadlock or state inconsistency problems caused by the migration of running process instances and ensuring the continuity of the enterprise business process operation.
[0054] Figure 1 FIG. 1 is a flowchart of a process data processing method based on a workflow engine in the first embodiment. Figure 1 As shown, the method is applied to the Flowable workflow engine and includes the following steps:
[0055] Step 110 , in response to detecting that a version of the process definition data of the target process has changed, identifying difference information between the new version of the process definition data of the target process and the old version of the process definition data;
[0056] Step 120: Determine, based on the difference information, whether a branch process change of a gateway node occurs in the target process; if a branch process change of a gateway node occurs, obtain a running process instance of the target process and determine whether a current active node of the running process instance is located in the branch process of the gateway node;
[0057] Step 130: If the current active node of the running process instance is located in the branch process of the gateway node, dynamic adaptive migration is performed on the branch process of the gateway node of the running process instance based on the difference information and the type of the gateway node, so as to dynamically migrate the running process instance to the new version of the process definition data; wherein the gateway node includes an inclusive gateway node and / or a parallel gateway node.
[0058] In this embodiment, the process definition data of the target process may have multiple versions. When the version of the process definition data of the target process changes, difference information between the new version of the process definition data of the target process and the old version of the process definition data can be identified. The difference information between the new version of the process definition data of the target process and the old version of the process definition data can be identified by comparing the process structures of the new version of the process definition data of the target process with the old version of the process definition data using an application programming interface for process definition data comparison and parsing.
[0059] In this embodiment, after identifying the difference between the new version of the target process's process definition data and the old version of the process definition data, a determination can be made based on the difference to determine whether a gateway node branch process change has occurred in the target process. If a gateway node branch process change has occurred, the pre-migration running process instance (Process Instance) of the target process is obtained, and a further determination is made as to whether the current active node of the running process instance is located within the gateway node branch process. The pre-migration running process instance of the target process is a process instance running according to the old version of the target process's process definition data.
[0060] In this implementation, the gateway node may include an inclusive gateway node and / or a parallel gateway node. An inclusive gateway node, also known as an inclusive gateway node, is characterized in that it can activate one or more branches that meet a conditional expression based on a conditional expression, while a parallel gateway node always activates all parallel branches.
[0061] Figure 2 is an exemplary structural diagram of a target process including an inclusive gateway node, Figure 3is an exemplary structural diagram of a target process including parallel gateway nodes. Figure 2 As shown, the target process includes multiple process nodes, starting with process node A. The inclusive gateway node B selects whether to run branches C1, C2, and C3 based on whether the current process meets conditions 1, 2, and 3. Then, the parallel branches that meet the conditions and are activated converge at the aggregation gateway node D and end at the subsequent process node E. Figure 3 As shown, the target process includes multiple process nodes, starting with process node A. Parallel gateway node B has multiple parallel branches C1, C2, and C3. The parallel branches then converge at aggregation gateway node D and end at subsequent process node E. The above process structure can be defined in the Flowable workflow engine using process definition data (Process Definition) that conforms to the BPMN specification.
[0062] Take the fault handling process in the actual enterprise business process management (BPM) system as an example. Assume that the fault handling process is Figure 2 The process structure shown is constructed as follows: the user initiates a fault report, and the inclusive gateway node selects one or more departments that meet the conditions for fault processing based on the current fault type, and then aggregates them through the aggregation gateway node (such as expert review), and finally ends through the subsequent process nodes. Assume that the fault handling process is as follows Figure 3 The process structure shown is constructed as follows: a user initiates a fault report, which is simultaneously transferred to multiple departments for fault processing in the parallel gateway stage, then aggregated through the aggregation gateway node (such as expert review), and finally terminated through the subsequent process node.
[0063] In the Flowable workflow engine, the target process mentioned above will undergo version changes as the business organization structure and business processes evolve. For example, Figure 4 yes Figure 2 The structural diagram of the target process after the change is shown. Figure 5 yes Figure 3 The schematic diagram of the changed structure of the target process is shown.
[0064] like Figure 4 As shown, Figure 2 The branch process that includes gateway node B in the process structure of the target process shown in the figure has changed, that is, the condition of branch C1 remains unchanged, but the task execution node has changed (from C1 to C11). The change in the task execution node may be a change in the task operation option or the task executor, etc. The branches C2 and C3 corresponding to conditions 2 and 3 have also changed to branches C4 and C5 corresponding to conditions 4 and 5. Figure 5 As shown, Figure 3The branch process of the parallel gateway node B in the process structure of the target process shown is changed, that is, the task execution node of branch C1 is changed (from C1 to C11), and branches C2 and C3 are cancelled and become branch C4.
[0065] These process changes can be reflected in the new version of the target process's process definition data. By identifying the differences between the new and old versions of the target process's process definition data, it can be discovered that the target process has undergone branch process changes at the gateway node (inclusive gateway node and / or parallel gateway node). The migration of running process instances involving such branch changes at the gateway node is not compatible with the native migration service class of the Flowable workflow engine. This will cause the branches and execution tokens of the migrated running process instances to not match the number of branches in the new version of the process definition data. This can lead to deadlocks or inconsistent states when the process reaches the aggregation gateway node D and fails to correctly collect all branch data.
[0066] To maintain business process continuity and prevent ongoing business processes from being interrupted, dynamic, adaptive, and seamless migration is required for all running process instances of the target process. This migration ensures that all running process instances of the target process are migrated to the new version of the target process definition data. These running process instances represent process instances of the target process initiated concurrently by multiple users in the business management system.
[0067] Specifically, this embodiment can extend the application programming interface (API) in the Flowable workflow engine. By obtaining all running process instances of the target process before migration, the current active node of the running process instance of the target process is queried, and whether the current active node of the running process instance of the target process is located in a branch process of the gateway node is determined. If the current active node of the running process instance of the target process is located in a branch process of the gateway node, that is, the running process instance is running to the branch node of the gateway node, the branch process of the gateway node of the running process instance can be dynamically adaptively migrated using the corresponding adaptive migration strategy based on the difference between the new version process definition data of the target process and the old version process definition data, as well as whether the gateway node type is an inclusive gateway node or a parallel gateway node. This dynamically migrates all running process instances of the target process to the new version process definition data of the target process. This allows for dynamic adaptive migration of all running process instances when the branch process of the gateway node of the target process changes, thereby avoiding deadlock or state inconsistency caused by the migration of running process instances and ensuring the continuity of enterprise business processes.
[0068] In some embodiments, as Figure 6 As shown, in step 130, the step of performing dynamic adaptive migration on the branch process of the gateway node of the running process instance based on the difference information and the type of the gateway node to dynamically migrate the running process instance to the new version of the process definition data may include the following steps:
[0069] Step 210: Determine, based on the difference information and the type of the gateway node, missing branches, newly added branches, and modified branches of a branch set when the gateway node executes according to the new version of the process definition data relative to a currently activated branch set of the running process instance;
[0070] Step 220, perform virtual completion mapping and token recovery on the missing branch, allocate a new token to the newly added branch to activate the task execution flow of the newly added branch according to the new version process definition data and the context data of the running process instance, and perform process rollback on the modified branch to reconstruct the task execution flow according to the new version process definition data and the context data of the running process instance.
[0071] In this embodiment, after obtaining the running process instance of the target process, the currently activated branch set of the running process instance can be further queried. The currently activated branch set of the running process instance represents the branch set that is currently activated and active by the gateway node of the running process instance.
[0072] In the Flowable workflow engine, each running process instance can be represented by a process instance id. When the process flow is transferred to multiple branch processes of the gateway node, each running process instance will be split accordingly to generate multiple execution tokens (Token) for identifying the branch processes. The execution token (Token) can also be called the execution id (executionId). When multiple branch processes converge to the aggregation gateway node, they will be merged into one execution token, thereby activating the execution flow of the main process.
[0073] This embodiment compares the branch set when the gateway node executes according to the new version of the process definition data of the target process (not actually activated for execution) with the currently activated branch set of the running process instance to obtain the missing branches, new branches, and modified branches of the branch set when the gateway node executes according to the new version of the process definition data of the target process relative to the currently activated branch set of the running process instance.
[0074] A missing branch refers to a branch that exists in the currently activated branch set of the running process instance but is not included in the branch set when the gateway node executes according to the new version of the process definition data of the target process; a newly added branch refers to a branch that does not exist in the currently activated branch set of the running process instance but is included in the branch set when the gateway node executes according to the new version of the process definition data of the target process; a modified branch refers to a branch that exists in both the currently activated branch set of the running process instance and the branch set when the gateway node executes according to the new version of the process definition data of the target process, but the task execution node has changed.
[0075] In one embodiment, the branch set when the gateway node executes according to the new version of the process definition data of the target process may have overlapping branches with the currently activated branch set of the running process instance, that is, branches that exist in both the currently activated branch set of the running process instance and the branch set when the gateway node executes according to the new version of the process definition data of the target process and have the same task execution node. For overlapping branches, the current execution flow and execution token in the running process instance can be kept unchanged.
[0076] Then, for the identified missing branches, new branches and modified branches, different adaptive migration strategies can be adopted, namely, virtually completing the mapping and token recovery for the missing branches, allocating new tokens to the new branches to activate the task execution flow of the new branches according to the new version of the process definition data and the context data of the running process instance, and performing process rollback on the modified branches to reconstruct the task execution flow according to the new version of the process definition data and the context data of the running process instance.
[0077] Virtual completion mapping for the missing branch means marking the missing branch as virtually completed in the running process instance to prevent it from being waited on by the aggregation gateway node. Token recycling for the missing branch means recycling the execution token assigned to the missing branch by the running process instance before entering the aggregation gateway node to prevent it from being received by the aggregation gateway node and avoid inconsistent process states.
[0078] Assigning a new token to the newly added branch to activate the task execution flow of the newly added branch according to the new version of the process definition data and the context data of the running process instance means that through the context data of the running process instance, the task execution flow of the new branch is newly created in the running process instance according to the new version of the process definition data, the task execution node corresponding to the branch is executed and an execution token is assigned, thereby ensuring that the execution flow of the branch can be correctly received by the aggregation gateway node when the flow is transferred.
[0079] The process of rolling back the modified branch to reconstruct the task execution flow according to the new version of the process definition data and the context data of the running process instance can be understood as a combination of the above two processing methods, which means marking the modified branch as a virtual completion state in the running process instance, and recycling the token of the modified branch at the same time. At the same time, through the context data of the running process instance, the branch activated in the running process instance is redirected to the new task execution node corresponding to the branch according to the new version of the process definition data and an execution token is allocated.
[0080] Therefore, by adopting different adaptive migration strategies for the identified missing branches, new branches, and modified branches, it is possible to ensure that the gateway node of the running process instance can generate the task execution flow according to the new version of the process definition data, thereby ensuring that the flow is transferred to the aggregation gateway node and can correctly receive the execution token of each branch process, avoiding deadlock or state inconsistency caused by the migration of the running process instance, and ensuring the continuity of the enterprise business process operation.
[0081] In one embodiment, in step 210, determining, based on the difference information and the type of the gateway node, the missing branches, newly added branches, and modified branches of the branch set when the gateway node executes according to the new version of the process definition data relative to the currently activated branch set of the running process instance may include:
[0082] When the gateway node is an inclusive gateway node, re-condition mapping of the branch process is performed on the inclusive gateway node according to the new conditional expression of the inclusive gateway node in the new version of the process definition data to generate an expected branch set;
[0083] The expected branch set is compared with the currently activated branch set of the running process instance to determine the missing branches, new branches and modified branches of the expected branch set relative to the currently activated branch set, thereby obtaining the missing branches, new branches and modified branches of the branch set when the gateway node is executed according to the new version of the process definition data relative to the currently activated branch set of the running process instance.
[0084] by Figure 2 and Figure 4 Take the branch process change of the inclusive gateway node in the target process as an example. Since the condition of branch C1 of inclusive gateway node B remains unchanged but the task execution node is changed (from C1 to C11), branches C2 and C3 corresponding to conditions 2 and 3 have been deleted in the new version of the process definition data and replaced with branches C4 and C5 corresponding to conditions 4 and 5. If the current active branch set of the running process instance is Figure 2 The branches (C1 and C2) that meet conditions 1 and 2, that is, the currently activated branch set of the running process instance is {C1, C2}.
[0085] Based on the new conditional expression in the new version of the process definition data of the inclusive gateway node B, the branch process of the inclusive gateway node B is re-conditionally mapped to generate an expected branch set. Assuming that according to the context data of the running process instance, when the inclusive gateway node B performs conditional mapping according to the new conditional expression in the new version of the process definition data, it can activate branches that meet conditions 1 and 4 (C11 and C4), then the expected branch set is {C11, C4}. Comparing the above expected branch set {C11, C4} with the currently activated branch set {C1, C2} of the running process instance, it can be obtained that the branch set of the gateway node when executing according to the new version of the process definition data relative to the currently activated branch set of the running process instance is missing branch C2, newly added branch C4, and modified branch C11 (relative to the C1 condition, only the task execution node changes).
[0086] In one embodiment, in step 210, determining, based on the difference information and the type of the gateway node, the missing branches, newly added branches, and modified branches of the branch set when the gateway node executes according to the new version of the process definition data relative to the currently activated branch set of the running process instance may include:
[0087] When the gateway node is a parallel gateway node, the definition branch set of the parallel gateway node in the new version of the process definition data is compared with the currently activated branch set of the running process instance to determine the missing branches, new branches and modified branches of the definition branch set relative to the currently activated branch set, thereby obtaining the missing branches, new branches and modified branches of the branch set when the gateway node is executed according to the new version of the process definition data relative to the currently activated branch set of the running process instance.
[0088] by Figure 3 and Figure 5 For example, consider a branch process change involving a parallel gateway node in the target process. Because the task execution node executed by branch C1 of parallel gateway node B changes from C1 to C11, branches C2 and C3 are deleted from the new process definition, replaced by a newly added branch C4. Due to the characteristics of parallel gateway nodes, the currently active branch set for the running process instance is {C1, C2, C3}.
[0089] According to the comparison between the defined branch set {C11, C4} of the parallel gateway node B in the new version of the process definition data and the currently activated branch set {C1, C2, C3} of the running process instance, it can be obtained that the branch set when the gateway node is executed according to the new version of the process definition data is missing branches C2 and C3 relative to the currently activated branch set of the running process instance, the newly added branch is C4, and the modified branch is C11 (relative to C1, only the task execution node changes).
[0090] In one embodiment, Figure 7 As shown, the method may further include the following steps:
[0091] Step 310: If the current active node of the running process instance is located after the branch process of the gateway node, perform virtual completion mapping and token recovery on the current active node;
[0092] Step 320: Roll back the running process instance to the previous process node of the gateway node, and allocate a new token to the previous process node to reactivate the task execution flow pointing to the gateway node according to the new version process definition data and the context data of the previous process node.
[0093] In this embodiment, if the current active node of the running process instance is located after the branch process of the gateway node, that is, the execution flow of each branch of the gateway node has been completed and has flowed to the process node after the aggregate gateway node, then the dynamic migration of the branch process of the gateway node can be achieved through process rollback, that is, the current active node is virtually mapped and the token is recycled, and the running process instance is rolled back to the previous process node of the gateway node, and a new token is allocated to the previous process node to reactivate the task execution flow pointing to the gateway node according to the new version of the process definition data and the context data of the previous process node. At this time, since the branch process of the newly pointed gateway node is already a new branch process defined according to the new version of the process definition data, this rollback can ensure that the new execution flow flows according to the new version of the process definition data, ensuring that there will be no deadlock and process state inconsistency when flowing to the aggregate gateway node.
[0094] Or Figure 2 and Figure 4 Taking the branch process change of the inclusive gateway node in the target process shown as an example, assuming that the current active node of the running process instance has flowed to process node E, the currently active process node E can be virtually completed mapped and token recovered at this time, and the running process instance can be rolled back to the previous process node A of the gateway node B. A new execution token is assigned to the previous process node A to reactivate the task execution flow pointing to the new gateway node B according to the new version of the process definition data and the context data of the previous process node.
[0095] In one embodiment, Figure 8 As shown, the method may further include the following steps:
[0096] Step 410 , in response to detecting that the version of the process definition data of the target process has been rolled back, freezing the new version of the process definition data of the target process and reactivating the old version of the process definition data;
[0097] Step 420: If the current active node of the running process instance is located in the branch process of the gateway node, a dynamic adaptive rollback is performed on the branch process of the gateway node of the running process instance based on the difference information and the type of the gateway node, so as to dynamically roll back the running process instance to the old version of the process definition data.
[0098] In this embodiment, when a problem occurs with the new version of the process definition data of the target process, the version of the process definition data of the target process needs to be rolled back. Since the built-in rollback mechanism of the native Flowable workflow engine does not support version rollback involving branch changes of gateway nodes, this embodiment can freeze the new version of the process definition data of the target process and reactivate the old version of the process definition data when detecting that the version of the process definition data of the target process has been rolled back. By obtaining the running process instance of the target process, it is determined whether the current active node of the running process instance is located in the branch process of the gateway node, thereby performing a rollback process that is opposite to the migration process of the aforementioned process instance. In this case, after the running process instance of the target process has been migrated to the new version of the process definition data, the running process instance of the target process is already a process instance running according to the old version of the process definition data of the target process.
[0099] Specifically, if the current active node of the running process instance is located in the branch process of the gateway node, then based on the difference information and the type of the gateway node, a dynamic adaptive rollback is performed on the branch process of the gateway node of the running process instance to dynamically roll back the running process instance to the old version of the process definition data. In this way, deadlock or state inconsistency problems caused by rolling back the running process instance to the old version of the process definition data can be avoided, and the continuity of the enterprise business process operation can be ensured. It can be understood that performing a dynamic adaptive rollback on the branch process of the gateway node of the running process instance can be the reverse process of the dynamic adaptive migration in the aforementioned embodiment.
[0100] In one embodiment, Figure 9 As shown, in step 420, based on the difference information and the type of the gateway node, performing dynamic adaptive rollback on the branch process of the gateway node of the running process instance to dynamically roll back the running process instance to the old version of the process definition data may include the following steps:
[0101] Step 510: Determine, based on the difference information and the type of the gateway node, missing branches, newly added branches, and modified branches of a branch set when the gateway node executes according to the old version of the process definition data relative to a currently activated branch set of the running process instance;
[0102] Step 520, perform virtual completion mapping and token recovery on the missing branch, allocate a new token to the newly added branch to activate the task execution flow of the newly added branch according to the old version process definition data and the context data of the running process instance, and perform process rollback on the modified branch to reconstruct the task execution flow according to the old version process definition data and the context data of the running process instance.
[0103] The definitions of missing branches, newly added branches, and modified branches in this embodiment are the same as those in the previous embodiment and will not be repeated here. Thus, by adopting different adaptive rollback strategies for identified missing branches, newly added branches, and modified branches, this embodiment ensures that the gateway node of a running process instance can roll back to the old version of the process definition data to generate the task execution flow, thereby ensuring that the flow to the aggregation gateway node can correctly receive the execution tokens of each branch process, avoiding deadlock or state inconsistency caused by the rollback of the running process instance, and ensuring the continuity of the enterprise business process operation.
[0104] In one embodiment, in step 510, determining, based on the difference information and the type of the gateway node, the missing branches, newly added branches, and modified branches of the branch set when the gateway node executes according to the old version of the process definition data relative to the currently activated branch set of the running process instance may include:
[0105] When the gateway node is an inclusive gateway node, re-condition mapping of the branch process is performed on the inclusive gateway node according to the old conditional expression of the inclusive gateway node in the old version process definition data to generate an expected branch set;
[0106] The expected branch set is compared with the currently activated branch set of the running process instance to determine the missing branches, new branches and modified branches of the expected branch set relative to the currently activated branch set, thereby obtaining the missing branches, new branches and modified branches of the branch set when the gateway node is executed according to the old version of the process definition data relative to the currently activated branch set of the running process instance.
[0107] Or Figure 2 and Figure 4 Taking the branch process change of the inclusive gateway node in the target process shown as an example, when the running process instance has been executed according to the new version of the process definition data, the current active branch set of the running process instance is Figure 4 The branches (C11 and C4) that meet conditions 1 and 4, that is, the current activated branch set of the running process instance is {C11, C4}.
[0108] Based on the old conditional expression of the inclusive gateway node B in the old version of the process definition data, the inclusive gateway node B is re-conditionally mapped to the branch process to generate an expected branch set. Assuming that according to the context data of the running process instance, when the inclusive gateway node B performs conditional mapping according to the old conditional expression in the old version of the process definition data, it can activate branches (C1 and C2) that meet conditions 1 and 2, then the expected branch set is {C1, C2}. Comparing the above expected branch set {C1, C2} with the currently activated branch set {C11, C4} of the running process instance, it can be obtained that the branch set when the gateway node is executed according to the old version of the process definition data relative to the currently activated branch set of the running process instance has a missing branch C4, a newly added branch C2, and a modified branch C1 (relative to the C11 condition, only the task execution node changes).
[0109] In one embodiment, in step 510, determining, based on the difference information and the type of the gateway node, the missing branches, newly added branches, and modified branches of the branch set when the gateway node executes according to the old version of the process definition data relative to the currently activated branch set of the running process instance may include:
[0110] When the gateway node is a parallel gateway node, the definition branch set of the parallel gateway node in the old version of the process definition data is compared with the currently activated branch set of the running process instance to determine the missing branches, new branches and modified branches of the definition branch set relative to the currently activated branch set, thereby obtaining the missing branches, new branches and modified branches of the branch set when the gateway node is executed according to the old version of the process definition data relative to the currently activated branch set of the running process instance.
[0111] Or Figure 3 and Figure 5 Taking the branch process change of the parallel gateway node in the target process shown as an example, when the running process instance has been executed according to the new version of the process definition data, the current activated branch set of the running process instance is {C11, C4}.
[0112] According to the comparison between the defined branch set {C1, C2, C3} of the parallel gateway node B in the old version of the process definition data and the currently activated branch set {C11, C4} of the running process instance, it can be obtained that the branch set when the gateway node is executed according to the old version of the process definition data relative to the currently activated branch set of the running process instance has the missing branch C4, the newly added branches are C2 and C3, and the modified branch is C1 (relative to C11, only the task execution node changes).
[0113] Accordingly, in one embodiment, Figure 10 As shown, the method may further include the following steps:
[0114] Step 610: If the current active node of the running process instance is located after the branch process of the gateway node, perform virtual completion mapping and token recovery on the current active node;
[0115] Step 620: Roll back the running process instance to the previous process node of the gateway node, and allocate a new token to the previous process node to reactivate the task execution flow pointing to the gateway node according to the old version process definition data and the context data of the previous process node.
[0116] In this embodiment, if the current active node of the running process instance is located after the branch process of the gateway node, that is, the execution flow of each branch of the gateway node has been completed according to the new version of the process definition data and has flowed to the process node after the aggregate gateway node, at this time, the dynamic rollback of the branch process of the gateway node can be achieved through process rollback, that is, the current active node is virtually completed and the token is recycled, and the running process instance is rolled back to the previous process node of the gateway node, and a new token is allocated to the previous process node to reactivate the task execution flow pointing to the gateway node according to the old version of the process definition data and the context data of the previous process node. At this time, since the branch process of the newly pointed gateway node is the old branch process defined according to the old version of the process definition data, this rollback can ensure that the execution flow flows according to the old version of the process definition data, and ensures that there will be no deadlock and process state inconsistency when flowing to the aggregate gateway node.
[0117] Figure 11 FIG is a structural diagram of a process data processing device based on a workflow engine in the first embodiment. Figure 11 As shown, the device is applied to the Flowable workflow engine and includes the following modules:
[0118] A version detection module 710 is configured to, in response to detecting that a version of process definition data of a target process has changed, identify difference information between the new version process definition data and the old version process definition data of the target process;
[0119] An instance acquisition module 720 is configured to determine, based on the difference information, whether a branch process change of a gateway node occurs in the target process; if a branch process change of a gateway node occurs, obtain a running process instance of the target process and determine whether a current active node of the running process instance is located in the branch process of the gateway node;
[0120] The instance migration module 730 is used to perform dynamic adaptive migration on the branch process of the gateway node of the running process instance based on the difference information and the type of the gateway node if the current active node of the running process instance is located in the branch process of the gateway node, so as to dynamically migrate the running process instance to the new version of the process definition data; wherein the gateway node includes an inclusive gateway node and / or a parallel gateway node.
[0121] In one embodiment, Figure 12 As shown, the instance migration module 730 includes the following units:
[0122] A branch comparison unit 810 is configured to determine, based on the difference information and the type of the gateway node, missing branches, newly added branches, and modified branches in a branch set when the gateway node executes according to the new version of the process definition data relative to a currently activated branch set of the running process instance;
[0123] The branch migration unit 820 is used to virtually complete the mapping and token recovery of the missing branch, allocate a new token to the newly added branch to activate the task execution flow of the newly added branch according to the new version process definition data and the context data of the running process instance, and perform process rollback on the modified branch to reconstruct the task execution flow according to the new version process definition data and the context data of the running process instance.
[0124] In one embodiment, the branch comparison unit 810 may be configured to:
[0125] When the gateway node is an inclusive gateway node, re-condition mapping of the branch process is performed on the inclusive gateway node according to the new conditional expression of the inclusive gateway node in the new version of the process definition data to generate an expected branch set;
[0126] The expected branch set is compared with the currently activated branch set of the running process instance to determine the missing branches, new branches and modified branches of the expected branch set relative to the currently activated branch set, thereby obtaining the missing branches, new branches and modified branches of the branch set when the gateway node is executed according to the new version of the process definition data relative to the currently activated branch set of the running process instance.
[0127] In one embodiment, the branch comparison unit 810 may be configured to:
[0128] When the gateway node is a parallel gateway node, the definition branch set of the parallel gateway node in the new version of the process definition data is compared with the currently activated branch set of the running process instance to determine the missing branches, new branches and modified branches of the definition branch set relative to the currently activated branch set, thereby obtaining the missing branches, new branches and modified branches of the branch set when the gateway node is executed according to the new version of the process definition data relative to the currently activated branch set of the running process instance.
[0129] In one embodiment, the instance migration module 730 is also used to perform virtual completion mapping and token recovery on the current active node if the current active node of the running process instance is located after the branch process of the gateway node; roll back the running process instance to the previous process node of the gateway node, and allocate a new token to the previous process node to reactivate the task execution flow pointing to the gateway node according to the new version of the process definition data and the context data of the previous process node.
[0130] In one embodiment, the version detection module 710 is also used to freeze the new version process definition data of the target process and reactivate the old version process definition data in response to detecting that the version of the process definition data of the target process has been rolled back; the instance migration module 730 is also used to perform a dynamic adaptive rollback on the branch process of the gateway node of the running process instance based on the difference information and the type of the gateway node if the current active node of the running process instance is located in the branch process of the gateway node, so as to dynamically roll back the running process instance to the old version process definition data.
[0131] In one embodiment, the instance migration module 730 is further configured to:
[0132] Determine, based on the difference information and the type of the gateway node, missing branches, newly added branches, and modified branches of a branch set when the gateway node is executed according to the old version of the process definition data relative to a currently activated branch set of the running process instance;
[0133] Virtual completion mapping and token recovery are performed on the missing branch, a new token is allocated to the newly added branch to activate the task execution flow of the newly added branch according to the old version process definition data and the context data of the running process instance, and the process is rolled back on the modified branch to reconstruct the task execution flow according to the old version process definition data and the context data of the running process instance.
[0134] In one embodiment, the instance migration module 730 is further configured to:
[0135] When the gateway node is an inclusive gateway node, re-condition mapping of the branch process is performed on the inclusive gateway node according to the old conditional expression of the inclusive gateway node in the old version process definition data to generate an expected branch set;
[0136] The expected branch set is compared with the currently activated branch set of the running process instance to determine the missing branches, new branches and modified branches of the expected branch set relative to the currently activated branch set, thereby obtaining the missing branches, new branches and modified branches of the branch set when the gateway node is executed according to the old version of the process definition data relative to the currently activated branch set of the running process instance.
[0137] In one embodiment, the instance migration module 730 is further configured to:
[0138] When the gateway node is a parallel gateway node, the definition branch set of the parallel gateway node in the old version of the process definition data is compared with the currently activated branch set of the running process instance to determine the missing branches, new branches and modified branches of the definition branch set relative to the currently activated branch set, thereby obtaining the missing branches, new branches and modified branches of the branch set when the gateway node is executed according to the old version of the process definition data relative to the currently activated branch set of the running process instance.
[0139] In one embodiment, the instance migration module 730 is further configured to:
[0140] If the current active node of the running process instance is located after the branch process of the gateway node, performing virtual completion mapping and token recovery on the current active node;
[0141] Roll back the running process instance to a previous process node of the gateway node, and allocate a new token to the previous process node to reactivate the task execution flow pointing to the gateway node according to the old version process definition data and the context data of the previous process node.
[0142] In summary, the workflow engine-based process data processing method and device of this embodiment identifies the difference information between the new version process definition data and the old version process definition data of the target process, and determines whether a gateway node branch process change has occurred in the target process based on the difference information. If a gateway node branch process change has occurred, the running process instance of the target process is obtained, and it is determined whether the current active node of the running process instance is located in the branch process of the gateway node. If the current active node of the running process instance is located in the branch process of the gateway node, dynamic adaptive migration is performed on the branch process of the gateway node of the running process instance based on the difference information and the type of the gateway node, so as to dynamically migrate the running process instance to the new version process definition data. Thus, dynamic adaptive migration of all running process instances can be achieved when the branch process of the gateway node of the target process changes, avoiding deadlock or state inconsistency caused by the migration of running process instances, and ensuring the continuity of enterprise business process operation.
[0143] It should be noted that those skilled in the art will understand that the different implementation methods described in the method embodiments of the present application and their explanations and technical effects achieved are also applicable to the device embodiments of the present application and will not be repeated here.
[0144] Furthermore, an embodiment of the present application also provides an electronic device, which may include: a processor and a memory. The memory stores computer program instructions, and the processor can call the computer program instructions in the memory to execute all or part of the steps of the method described in any embodiment of the present application. The computer program instructions in the memory can be implemented in the form of a software functional unit and stored in a computer-readable storage medium when sold or used as a standalone product.
[0145] Furthermore, the present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program. When the computer-readable storage medium is connected to a computer device and the computer program is executed by one or more processors of the computer device, it can execute all or part of the steps of the method described in any embodiment of the present application.
[0146] Furthermore, the present application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which can be executed by one or more processors to perform all or part of the steps of the method described in any embodiment of the present application.
[0147] Through the description of the above embodiments, those skilled in the art can clearly understand that the various embodiments of the present application can be implemented by means of software or software combined with the necessary general hardware platform, and of course can also be implemented by hardware functions. Based on this understanding, the technical solution of the present application can be essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for enabling a computer device, such as but not limited to a personal computer, a server, or a network device, to execute all or part of the steps of the method described in any embodiment of the present application. The aforementioned storage medium may include: various media that can store computer program code, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0148] While the exemplary embodiments of the present application have been described above, it should be understood that the exemplary embodiments are illustrative rather than restrictive, and the scope of protection of the present application is not limited thereto. It should be understood that those skilled in the art may modify and alter the embodiments of the present application without departing from the spirit and scope of the present application, and such modifications and alterations are intended to be within the scope of protection of the present application.
Claims
1. A workflow engine-based process data processing method, applied to the Flowable workflow engine, characterized in that: The method comprises: In response to detecting that a version of process definition data of a target process has been changed, identifying difference information between a new version of process definition data and an old version of process definition data of the target process; Determine, based on the difference information, whether a branch process change of a gateway node occurs in the target process; if a branch process change of a gateway node occurs, obtain a running process instance of the target process, and determine whether a current active node of the running process instance is located in the branch process of the gateway node; If the current active node of the running process instance is located in the branch process of the gateway node, then according to the difference information and the type of the gateway node, dynamic adaptive migration is performed on the branch process of the gateway node of the running process instance to dynamically migrate the running process instance to the new version of the process definition data; wherein, according to the difference information and the type of the gateway node, the missing branches, new branches and modified branches of the branch set when the gateway node is executed according to the new version of the process definition data relative to the currently activated branch set of the running process instance are determined; the missing branches are virtually mapped and tokens are recycled, a new token is allocated to the new branch to activate the task execution flow of the new branch according to the new version of the process definition data and the context data of the running process instance, and the modified branch is rolled back to reconstruct the task execution flow according to the new version of the process definition data and the context data of the running process instance. The gateway node includes an inclusive gateway node and / or a parallel gateway node.
2. The process data processing method based on the workflow engine according to claim 1, characterized in that: The determining, based on the difference information and the type of the gateway node, missing branches, newly added branches, and modified branches of a branch set when the gateway node executes according to the new version of the process definition data relative to a currently activated branch set of the running process instance includes: When the gateway node is an inclusive gateway node, re-condition mapping of the branch process is performed on the inclusive gateway node according to the new conditional expression of the inclusive gateway node in the new version of the process definition data to generate an expected branch set; The expected branch set is compared with the currently activated branch set of the running process instance to determine the missing branches, new branches and modified branches of the expected branch set relative to the currently activated branch set, thereby obtaining the missing branches, new branches and modified branches of the branch set when the gateway node is executed according to the new version of the process definition data relative to the currently activated branch set of the running process instance.
3. The process data processing method based on the workflow engine according to claim 1, characterized in that: The determining, based on the difference information and the type of the gateway node, missing branches, newly added branches, and modified branches of a branch set when the gateway node executes according to the new version of the process definition data relative to a currently activated branch set of the running process instance includes: When the gateway node is a parallel gateway node, the definition branch set of the parallel gateway node in the new version of the process definition data is compared with the currently activated branch set of the running process instance to determine the missing branches, new branches and modified branches of the definition branch set relative to the currently activated branch set, thereby obtaining the missing branches, new branches and modified branches of the branch set when the gateway node is executed according to the new version of the process definition data relative to the currently activated branch set of the running process instance.
4. The process data processing method based on a workflow engine according to claim 2 or 3, characterized in that: The method comprises: If the current active node of the running process instance is located after the branch process of the gateway node, performing virtual completion mapping and token recovery on the current active node; Roll back the running process instance to the previous process node of the gateway node, and allocate a new token to the previous process node to reactivate the task execution flow pointing to the gateway node according to the new version of the process definition data and the context data of the previous process node.
5. The process data processing method based on workflow engine according to claim 4 is characterized in that: The method comprises: In response to detecting that a version of the process definition data of the target process has been rolled back, freezing the new version of the process definition data of the target process and reactivating the old version of the process definition data; If the current active node of the running process instance is located in the branch process of the gateway node, then according to the difference information and the type of the gateway node, a dynamic adaptive rollback is performed on the branch process of the gateway node of the running process instance to dynamically roll back the running process instance to the old version of the process definition data.
6. The process data processing method based on a workflow engine according to claim 5, characterized in that: The step of performing a dynamic adaptive rollback on the branch process of the gateway node of the running process instance according to the difference information and the type of the gateway node, so as to dynamically roll back the running process instance to the old version of the process definition data, includes: Determine, based on the difference information and the type of the gateway node, missing branches, newly added branches, and modified branches of a branch set when the gateway node is executed according to the old version of the process definition data relative to a currently activated branch set of the running process instance; Virtual completion mapping and token recovery are performed on the missing branch, a new token is allocated to the newly added branch to activate the task execution flow of the newly added branch according to the old version process definition data and the context data of the running process instance, and the process is rolled back on the modified branch to reconstruct the task execution flow according to the old version process definition data and the context data of the running process instance.
7. The process data processing method based on a workflow engine according to claim 6, characterized in that: The determining, based on the difference information and the type of the gateway node, missing branches, newly added branches, and modified branches of a branch set when the gateway node is executed according to the old version of the process definition data relative to a currently activated branch set of the running process instance includes: When the gateway node is an inclusive gateway node, re-condition mapping of the branch process is performed on the inclusive gateway node according to the old conditional expression of the inclusive gateway node in the old version process definition data to generate an expected branch set; The expected branch set is compared with the currently activated branch set of the running process instance to determine the missing branches, new branches and modified branches of the expected branch set relative to the currently activated branch set, thereby obtaining the missing branches, new branches and modified branches of the branch set when the gateway node is executed according to the old version of the process definition data relative to the currently activated branch set of the running process instance.
8. The process data processing method based on a workflow engine according to claim 7, characterized in that: The method comprises: If the current active node of the running process instance is located after the branch process of the gateway node, performing virtual completion mapping and token recovery on the current active node; Roll back the running process instance to a previous process node of the gateway node, and allocate a new token to the previous process node to reactivate the task execution flow pointing to the gateway node according to the old version process definition data and the context data of the previous process node.
9. A process data processing device based on a workflow engine, applied to the Flowable workflow engine, characterized in that: The device comprises: a version detection module, configured to, in response to detecting that a version of process definition data of a target process has been changed, identify difference information between the new version process definition data and the old version process definition data of the target process; an instance acquisition module, configured to determine, based on the difference information, whether a branch process change of a gateway node occurs in the target process; if a branch process change of a gateway node occurs, obtain a running process instance of the target process and determine whether a current active node of the running process instance is located in the branch process of the gateway node; An instance migration module is used to perform dynamic adaptive migration on the branch process of the gateway node of the running process instance according to the difference information and the type of the gateway node if the current active node of the running process instance is located in the branch process of the gateway node, so as to dynamically migrate the running process instance to the new version of the process definition data; wherein, according to the difference information and the type of the gateway node, the missing branches, new branches and modified branches of the branch set when the gateway node is executed according to the new version of the process definition data relative to the currently activated branch set of the running process instance are determined; the missing branches are virtually mapped and tokens are recycled, a new token is allocated to the new branch to activate the task execution flow of the new branch according to the new version of the process definition data and the context data of the running process instance, and the modified branch is rolled back to reconstruct the task execution flow according to the new version of the process definition data and the context data of the running process instance. The gateway node includes an inclusive gateway node and / or a parallel gateway node.
Citation Information
Patent Citations
Process change method and device, electronic equipment and computer readable storage medium
CN115953017A