CN113687882A - Process rollback method, device and storage medium based on activiti - Google Patents

Process rollback method, device and storage medium based on activiti Download PDF

Info

Publication number
CN113687882A
CN113687882A CN202110973535.7A CN202110973535A CN113687882A CN 113687882 A CN113687882 A CN 113687882A CN 202110973535 A CN202110973535 A CN 202110973535A CN 113687882 A CN113687882 A CN 113687882A
Authority
CN
China
Prior art keywords
current node
process instance
instance
task
sub
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110973535.7A
Other languages
Chinese (zh)
Other versions
CN113687882B (en
Inventor
焦传金
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Pudong Development Bank Co Ltd
Original Assignee
Shanghai Pudong Development Bank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Pudong Development Bank Co Ltd filed Critical Shanghai Pudong Development Bank Co Ltd
Priority to CN202110973535.7A priority Critical patent/CN113687882B/en
Publication of CN113687882A publication Critical patent/CN113687882A/en
Application granted granted Critical
Publication of CN113687882B publication Critical patent/CN113687882B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • G06F9/4484Executing subprograms
    • G06F9/4486Formation of subprogram jump address
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a flow rollback method, a flow rollback device and a storage medium based on activitti. A flow rollback method based on activiti comprises the following steps: acquiring a current node which needs to carry out task skipping in an activiti workflow; calling a corresponding sub-process example according to the current node; acquiring a root process instance corresponding to the sub-process instance; deleting the task information of the current node, each process instance corresponding to the current node and other additional information; and adding a target node on the root process instance and establishing target task information on the target node. The method, the device and the storage medium for process rollback based on activiti disclosed by the invention can realize rollback without connecting nodes through wires, have flexibility and can realize rollback of calling a child process to a parent process.

Description

Process rollback method, device and storage medium based on activiti
Technical Field
The embodiment of the invention relates to an information processing technology, in particular to a flow rollback method and device based on activitti and a storage medium.
Background
Activti is a Business Process Management (BPM) platform, and is suitable for developers and system administrators. The method is an open-source, flexible and easily-extensible executable process language framework covering the fields of business process management, workflow, service collaboration and the like.
When applying activiti, jumps between flows often need to be made, which include a fallback from a child flow to a parent flow. However, the existing activiti engine technical framework only supports the realization of flow rollback in a manner of connecting a specific two nodes inside a sub-flow or a parent flow, and the flow rollback mechanism is not flexible enough.
Disclosure of Invention
The invention provides a process rollback method, a device and a storage medium based on activitti, which can realize rollback from a child process instance node to a parent process instance node.
In a first aspect, an embodiment of the present invention provides an activiti-based process fallback method, including:
acquiring a current node which needs to carry out task skipping in an activiti workflow;
calling a corresponding sub-process example according to the current node;
acquiring a root process instance corresponding to the sub-process instance;
deleting the task information of the current node, each process instance corresponding to the current node and other additional information;
adding a target node on the root process instance and establishing target task information on the target node
In a second aspect, an embodiment of the present invention further provides an activity based process rollback apparatus, including:
the node acquisition module is used for acquiring a current node which needs to carry out task skipping in the activitti workflow;
the flow instance calling module is used for calling the corresponding sub-flow instance according to the current node; acquiring a root process instance corresponding to the sub-process instance;
the information deleting module is used for deleting the task information of the current node, each process instance corresponding to the current node and other additional information;
and the task establishing module is used for adding a target node on the root process instance and establishing target task information on the target node.
In a third aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the program to implement the method for fallback based on activiti in the first aspect.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the activiti-based flow rollback method according to the first aspect.
According to the process rollback method, device and storage medium based on activiti provided by the embodiment of the invention, firstly, a current node needing task skipping in an activiti workflow is obtained; then calling a corresponding sub-process instance according to the current node, acquiring a root process instance corresponding to the sub-process instance, deleting the task information of the current node and each process instance corresponding to the current node and other additional information, finally adding a target node on the root process instance and establishing target task information on the target node, realizing rollback without connecting the nodes through a connecting line, having flexibility, and realizing rollback from calling the sub-process to a parent process
Drawings
Fig. 1 is a flowchart of an activti-based process fallback method according to an embodiment of the present invention;
fig. 2 is a flowchart of another method for fallback based on an activiti procedure according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a flowchart rollback apparatus based on activiti according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Fig. 1 is a flowchart of an activti-based process fallback method according to an embodiment of the present invention, and as shown in fig. 1, the activti-based process fallback method according to the embodiment includes:
and step S110, acquiring the current node which needs to carry out task jumping in the activiti workflow.
The process rollback method based on activiti provided by the embodiment is applied to an activiti-based process management platform. Based on the activiti engine technical framework, rollback can be realized only in a mode of establishing connection through two specific nodes in a sub-process or a parent process, and the flexibility is not high. In order to solve the problem, in this embodiment, according to a sub-process instance corresponding to a current node that needs to perform task skipping, a corresponding root process instance is found, then task information and each process instance of the current node are deleted, a target node is added to the root process instance, and target task information is established, so that process rollback from the current node to the target node is realized, and the process rollback can be realized without establishing a connection line between nodes. In this embodiment, the current node that needs to perform task skipping in the activiti workflow is obtained first.
And step S120, calling the corresponding sub-process example according to the current node.
And after the current node needing to carry out task jumping is obtained, calling the corresponding sub-process example according to the current node. Specifically, the corresponding sub-process instance may be called according to a task identifier that requires task jumping in the current node.
Step S130, a root process instance corresponding to the sub-process instance is obtained.
After the corresponding child process instance called by the current node is acquired, the root process instance corresponding to the child process instance can be acquired according to the corresponding relationship between the child process instance and the parent process instance thereof and the corresponding relationship between the parent process instance and the root process instance thereof. Wherein, the root process instance, the father process instance and the son process instance are tree structures. In the process of obtaining the root process instance corresponding to the sub-process instance, a parent process instance corresponding to the sub-process instance may be obtained first; and then acquiring a root process instance corresponding to the parent process instance.
In step S140, the task information of the current node, and each process instance and other additional information corresponding to the current node are deleted.
After determining the current node and the corresponding process instances which need to carry out task jumping, firstly deleting the task information of the current node and the process instances and other additional information corresponding to the current node. At this time, all the relevant information of the current node which needs to carry out task skipping is deleted.
And step S150, adding a target node on the root process instance and establishing target task information on the target node.
And finally, adding a target node and establishing target task information on the target node on the acquired root process instance. The established target task information is the task information of the deleted current node. That is, new target task information is established on the root process instance, and the new task target information is established on the root process instance, that is, the parent process instance, and then the child process instance corresponding to the original current node is returned to the parent process instance, thereby completing the process return.
In the process fallback method based on activiti provided by this embodiment, a current node that needs to perform task jumping in an activiti workflow is first obtained; then, the corresponding sub-process instance is called according to the current node, the root process instance corresponding to the sub-process instance is obtained, then the task information of the current node, the process instances corresponding to the current node and other additional information are deleted, the target node is added on the root process instance, and the target task information is established on the target node, and the backspacing is realized without connecting the nodes through a connecting line, so that the flexibility is realized, and the backspacing from calling the sub-process to the father process can be realized.
The method for flowchart rollback based on activitti according to the embodiment of the present invention is further described in detail below with an embodiment.
Fig. 2 is a flowchart of another activity-based procedure fallback method according to an embodiment of the present invention, and as shown in fig. 2, the activity-based procedure fallback method according to the embodiment of the present invention includes:
in step S210, the sub-process instance (execution) is found according to the current task identifier (TaskId) of the current task (currentTask).
In step S220, the parent process instance (parenterexecution) is searched for by execution.
Step S230, looks up its Super flow instance (rootExecution) through parenteexecution. Super process instance is the root process instance.
In step S240, the currentTask record is deleted, and the flow instances execution, parenterexecution, rootExecution and other additional information associated therewith are cleared.
Step S250, adding target node target task (targetTask) information to the rootExecution, and returning the flow node to the target node.
Fig. 3 is a schematic structural diagram of an activity based process rollback apparatus according to an embodiment of the present invention, and as shown in fig. 3, the activity based process rollback apparatus according to the embodiment includes:
the node obtaining module 31 is configured to obtain a current node that needs to perform task skipping in the activiti workflow.
A flow instance calling module 32, configured to call a corresponding sub-flow instance according to the current node; and acquiring a root process instance corresponding to the sub-process instance.
And an information deleting module 33, configured to delete the task information of the current node and each process instance and other additional information corresponding to the current node.
And the task establishing module 34 is used for adding a target node on the root process instance and establishing target task information on the target node.
The activti-based process rollback device provided by the embodiment of the invention can execute the activti-based process rollback method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Further, on the basis of the embodiment shown in fig. 3, the flow instance calling module 32 is specifically configured to obtain a parent flow instance corresponding to the child flow instance; and acquiring a root process instance corresponding to the parent process instance.
Further, on the basis of the embodiment shown in fig. 3, the information deleting module 33 is specifically configured to delete the task information of the current node and the sub-process instance, the parent-process instance, and other additional information corresponding to the current node.
Further, on the basis of the embodiment shown in fig. 3, the flow instance invoking module 32 is specifically configured to invoke a corresponding sub-flow instance according to a task identifier that needs to perform task jumping in the current node.
Fig. 4 is a schematic structural diagram of a computer apparatus according to an embodiment of the present invention, as shown in fig. 4, the computer apparatus includes a processor 41, a memory 42, an input device 43, and an output device 44; the number of processors 41 in the computer device may be one or more, and one processor 41 is taken as an example in fig. 4; the processor 41, the memory 42, the input device 43 and the output device 44 in the computer apparatus may be connected by a bus or other means, and the connection by the bus is exemplified in fig. 4.
The memory 42 is used as a computer-readable storage medium, and can be used for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the method for workflow rollback based on activiti according to the embodiment of the present invention (for example, the node obtaining module 31, the workflow instance invoking module 32, the information deleting module 33, and the task establishing module 34 in the workflow rollback apparatus based on activiti). The processor 41 executes various functional applications and data processing of the computer device by running software programs, instructions and modules stored in the memory 42, that is, implements the above-described activita-based flow rollback method.
The memory 42 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 42 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, memory 42 may further include memory located remotely from processor 41, which may be connected to a computer device over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 43 may be used to receive input numeric or character information and to generate key signal inputs related to user settings and function controls of the computer apparatus. The output device 44 may include a display device such as a display screen.
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, where the computer-executable instructions are executed by a computer processor to perform a method for process rollback based on activiti, and the method includes:
acquiring a current node which needs to carry out task skipping in an activiti workflow;
calling a corresponding sub-process example according to the current node;
acquiring a root process instance corresponding to the sub-process instance;
deleting the task information of the current node, each process instance corresponding to the current node and other additional information;
and adding a target node on the root process instance and establishing target task information on the target node.
Of course, the storage medium provided by the embodiment of the present invention contains computer-executable instructions, and the computer-executable instructions are not limited to the method operations described above, and may also perform related operations in the activiti-based flow rollback method provided by any embodiment of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the flowchart rollback apparatus based on activitti, the included units and modules are only divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A process rollback method based on activiti is characterized by comprising the following steps:
acquiring a current node which needs to carry out task skipping in an activiti workflow;
calling a corresponding sub-process example according to the current node;
acquiring a root process instance corresponding to the sub-process instance;
deleting the task information of the current node, and each process instance and other additional information corresponding to the current node;
and adding a target node on the root process instance and establishing target task information on the target node.
2. The method according to claim 1, wherein the obtaining the root process instance corresponding to the sub-process instance comprises:
acquiring a parent process instance corresponding to the child process instance;
and acquiring a root process instance corresponding to the parent process instance.
3. The method of claim 2, wherein the deleting task information of the current node and process instances and other additional information corresponding to the current node comprises:
and deleting the task information of the current node and the sub-process instance, the parent process instance and other additional information corresponding to the current node.
4. The method according to any one of claims 1 to 3, wherein the invoking the corresponding sub-process instance according to the current node comprises:
and calling a corresponding sub-process instance according to the task identifier needing task skipping in the current node.
5. A process rollback device based on activiti is characterized by comprising:
the node acquisition module is used for acquiring a current node which needs to carry out task skipping in the activitti workflow;
the flow instance calling module is used for calling the corresponding sub-flow instance according to the current node; acquiring a root process instance corresponding to the sub-process instance;
the information deleting module is used for deleting the task information of the current node, each process instance corresponding to the current node and other additional information;
and the task establishing module is used for adding a target node on the root process instance and establishing target task information on the target node.
6. The apparatus according to claim 5, wherein the flow instance invoking module is specifically configured to obtain a parent flow instance corresponding to the child flow instance; and acquiring a root process instance corresponding to the parent process instance.
7. The apparatus of claim 6, wherein the information deleting module is specifically configured to delete the task information of the current node and the sub-process instance, the parent process instance, and other additional information corresponding to the current node.
8. The apparatus according to any one of claims 5 to 7, wherein the flow instance invoking module is specifically configured to invoke a corresponding sub-flow instance according to the task identifier that needs to perform task jumping in the current node.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the activiti-based procedure fallback method as claimed in any one of claims 1 to 4 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored, the program, when being executed by a processor, implementing the activita-based process fallback method as set forth in any one of claims 1 to 4.
CN202110973535.7A 2021-08-24 2021-08-24 Activiti-based flow rollback method, activiti-based flow rollback device and storage medium Active CN113687882B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110973535.7A CN113687882B (en) 2021-08-24 2021-08-24 Activiti-based flow rollback method, activiti-based flow rollback device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110973535.7A CN113687882B (en) 2021-08-24 2021-08-24 Activiti-based flow rollback method, activiti-based flow rollback device and storage medium

Publications (2)

Publication Number Publication Date
CN113687882A true CN113687882A (en) 2021-11-23
CN113687882B CN113687882B (en) 2024-04-19

Family

ID=78581776

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110973535.7A Active CN113687882B (en) 2021-08-24 2021-08-24 Activiti-based flow rollback method, activiti-based flow rollback device and storage medium

Country Status (1)

Country Link
CN (1) CN113687882B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100122251A1 (en) * 2008-11-13 2010-05-13 International Business Machines Corporation Realizing jumps in an executing process instance
CN109670664A (en) * 2018-09-11 2019-04-23 深圳平安财富宝投资咨询有限公司 Flow implementation method, user equipment, storage medium and device based on workflow
CN110517018A (en) * 2019-08-26 2019-11-29 深圳前海环融联易信息科技服务有限公司 A kind of any jump method of node based on activiti workflow and device
CN110619473A (en) * 2019-09-19 2019-12-27 福建博思软件股份有限公司 Method for realizing reverse circulation based on Activiti workflow

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100122251A1 (en) * 2008-11-13 2010-05-13 International Business Machines Corporation Realizing jumps in an executing process instance
CN109670664A (en) * 2018-09-11 2019-04-23 深圳平安财富宝投资咨询有限公司 Flow implementation method, user equipment, storage medium and device based on workflow
CN110517018A (en) * 2019-08-26 2019-11-29 深圳前海环融联易信息科技服务有限公司 A kind of any jump method of node based on activiti workflow and device
CN110619473A (en) * 2019-09-19 2019-12-27 福建博思软件股份有限公司 Method for realizing reverse circulation based on Activiti workflow

Also Published As

Publication number Publication date
CN113687882B (en) 2024-04-19

Similar Documents

Publication Publication Date Title
CN109684057B (en) Task processing method and device and storage medium
CN111277639B (en) Method and device for maintaining data consistency
CN111752799A (en) Service link tracking method, device, equipment and storage medium
CN111090423B (en) Webhook framework system and method for realizing active calling and event triggering
CN108509523A (en) Structuring processing method, equipment and the readable storage medium storing program for executing of block chain data
CN110764894A (en) Timed task management method, device, equipment and storage medium
CN110517018A (en) A kind of any jump method of node based on activiti workflow and device
CN115794202A (en) Data configuration method and engine, file system and computer storage medium
CN112579319A (en) Service calling method and device based on LRU Cache optimization
US8224933B2 (en) Method and apparatus for case-based service composition
CN113098854B (en) Task arranging method, system, storage medium and electronic equipment
CN108536447B (en) Operation and maintenance management method
CN114020840A (en) Data processing method, device, server, storage medium and product
CN112395339A (en) Method and device for checking data access between systems, computer equipment and storage medium
CN117376092A (en) Fault root cause positioning method, device, equipment and storage medium
CN113687882B (en) Activiti-based flow rollback method, activiti-based flow rollback device and storage medium
CN113409153A (en) Business process management system, business process processing method, equipment and storage medium
CN111080250B (en) Flow backspacing compensation method and device, storage medium and electronic equipment
CN112418796B (en) Sub-process task node activation method and device, electronic equipment and storage medium
CN114610413A (en) Method, device, equipment and storage medium for executing synchronous and asynchronous tasks based on Java
CN111124386B (en) Animation event processing method, device, equipment and storage medium based on Unity
CN114139079A (en) API request processing method, device, equipment and storage medium
CN114237824A (en) Fault positioning method and device, computer readable medium and electronic equipment
CN114564286A (en) Rule engine warning method and rule engine warning system
CN112148803A (en) Method, device and equipment for calling tasks in block chain and readable storage medium

Legal Events

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