CN113687882B - Activiti-based flow rollback method, activiti-based flow rollback device and storage medium - Google Patents

Activiti-based flow rollback method, activiti-based flow rollback device and storage medium Download PDF

Info

Publication number
CN113687882B
CN113687882B CN202110973535.7A CN202110973535A CN113687882B CN 113687882 B CN113687882 B CN 113687882B CN 202110973535 A CN202110973535 A CN 202110973535A CN 113687882 B CN113687882 B CN 113687882B
Authority
CN
China
Prior art keywords
flow
instance
current node
flow instance
activiti
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.)
Active
Application number
CN202110973535.7A
Other languages
Chinese (zh)
Other versions
CN113687882A (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

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 activiti-based flow rollback method, a activiti-based flow rollback device and a storage medium. A activiti-based flow rollback method comprises the following steps: acquiring a current node needing task skip in activiti workflow; calling a corresponding sub-flow instance according to the current node; acquiring a root flow instance corresponding to the sub-flow instance; deleting task information of the current node, each flow instance corresponding to the current node and other additional information; adding a target node on the root flow instance and establishing target task information on the target node. The activiti-based flow rollback method, the activiti-based flow rollback device and the storage medium disclosed by the invention have the advantages that rollback is realized without connecting wires among nodes, the flexibility is realized, and the rollback from a sub-flow to a parent flow can be realized.

Description

Activiti-based flow rollback method, activiti-based flow rollback device and storage medium
Technical Field
The embodiment of the invention relates to an information processing technology, in particular to a activiti-based flow rollback method, a activiti-based flow rollback device and a storage medium.
Background
Activiti is a business process management (Business Process Management, BPM) platform that is suitable for developers and system administrators. The method is an open-source, flexible and easily-expandable executable flow language framework covering the fields of business flow management, workflow, service collaboration and the like.
When applying activiti, it is often necessary to make a jump between flows, including rollback from a child flow to a parent flow. However, the current activiti engine technical framework only supports the realization of the flow rollback in the sub-flow or the parent flow through the connection of specific two nodes, and the flow rollback mechanism is not flexible enough.
Disclosure of Invention
The invention provides a activiti-based flow rollback method, a activiti-based flow rollback device and a storage medium, which can realize rollback from a child flow instance node to a parent flow instance node.
In a first aspect, an embodiment of the present invention provides a method for rollback flow based on activiti, including:
Acquiring a current node needing task skip in activiti workflow;
Calling a corresponding sub-flow instance according to the current node;
Acquiring a root flow instance corresponding to the sub-flow instance;
deleting task information of the current node, each flow instance corresponding to the current node and other additional information;
adding target nodes on root flow instance and establishing target task information on target nodes
In a second aspect, an embodiment of the present invention further provides a flow rollback device based on activiti, including:
the node acquisition module is used for acquiring a current node needing task jump in activiti workflow;
the flow instance calling module is used for calling the corresponding sub-flow instance according to the current node; acquiring a root flow instance corresponding to the sub-flow instance;
The information deleting module is used for deleting the task information of the current node, each flow 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 flow 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 capable of running on the processor, where the processor implements the activiti-based flow rollback method as in the first aspect when the processor executes the program.
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 program is executed by a processor to implement the method for fallback based on activiti as in the first aspect.
The method, the device and the storage medium for returning the flow based on activiti provided by the embodiment of the invention firstly acquire the current node needing task jump in the activiti workflow; then calling the corresponding sub-process instance according to the current node, acquiring the 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, finally adding the target node on the root process instance and establishing the target task information on the target node, realizing rollback without connecting the nodes by a connecting line, having flexibility and realizing rollback from calling the sub-process to the father process
Drawings
Fig. 1 is a flowchart of a process rollback method based on activiti according to an embodiment of the present invention;
fig. 2 is a flowchart of another process rollback method based on activiti according to an embodiment of the present invention;
Fig. 3 is a schematic structural diagram of a flow rollback device 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 invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Fig. 1 is a flowchart of a flow rollback method based on activiti according to an embodiment of the present invention, as shown in fig. 1, a flow rollback method based on activiti according to the present embodiment includes:
step S110, a current node needing task skip in activiti workflow is obtained.
The activiti-based flow rollback method provided by the embodiment is applied to a activiti-based flow management platform. Based on activiti engine technical framework, rollback can only be realized in a manner of establishing connection through specific two nodes in the internal of a sub-process or a parent process, and the flexibility is not high. In order to solve the problem, in this embodiment, a corresponding root flow instance is found according to a sub-flow instance corresponding to a current node that performs task skipping as required, then task information and each flow instance of the current node are deleted, and a target node is added and target task information is established on the root flow instance, so that flow rollback from the current node to the target node is achieved, and flow rollback can be achieved without establishing a connection between the nodes. In this embodiment, the current node in the activiti workflow that needs to be task-skipped is obtained first.
Step S120, calling the corresponding sub-flow instance according to the current node.
And after the current node needing to carry out task jump is obtained, calling a corresponding sub-flow instance according to the current node. Specifically, the corresponding sub-flow instance can be called according to the task identifier of the current node, which needs to perform task jump.
Step S130, a root flow instance corresponding to the sub-flow instance is obtained.
After the current node calls the corresponding sub-process instance, the root process instance corresponding to the sub-process instance can be obtained according to the corresponding relation between the sub-process instance and the parent process instance and the corresponding relation between the parent process instance and the root process instance. The root flow instance, the father flow instance and the child flow instance are tree structures. In the process of acquiring the root flow instance corresponding to the child flow instance, a parent flow instance corresponding to the child flow instance may be acquired first; and then acquiring a root flow instance corresponding to the parent flow instance.
Step S140, deleting task information of the current node, each flow instance corresponding to the current node, and other additional information.
After determining the current node and the corresponding flow instances requiring task jump, firstly deleting the task information of the current node, and the corresponding flow instances and other additional information of the current node. At this time, all relevant information of the current node needing to perform task jump is deleted.
Step S150, adding a target node on the root flow instance and establishing target task information on the target node.
And finally, adding a target node on the acquired root flow instance and establishing target task information on the target node. 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 flow instance, and new task target information is established on the root flow instance, that is, the parent flow instance, then the child flow instance corresponding to the original current node is rolled back to the parent flow instance, so that the flow rollback is completed.
The process rollback method based on activiti provided in this embodiment firstly obtains a current node needing task skip in activiti workflow; and then calling the corresponding sub-process instance according to the current node, acquiring the 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, realizing rollback without connecting the nodes by a connecting line, having flexibility, and realizing rollback from calling the sub-process to the father process.
The following describes the activiti-based flow rollback method according to an embodiment of the present invention in further detail.
Fig. 2 is a flowchart of another flow rollback method based on activiti according to an embodiment of the present invention, as shown in fig. 2, where the flow rollback method based on activiti according to the present embodiment includes:
In step S210, the associated sub-process instance (execution) is found by the current task identifier (TaskId) of the current task (currentTask).
Step S220, find its parent process instance through execution (parentExecution).
In step S230, the Super flow instance is searched through parentExecution (rootExecution). The Super flow instance is the root flow instance.
In step S240, the currentTask records are deleted and the process instances exetution, parentExecution, rootExecution and other additional information associated therewith are purged.
In step S250, at rootExecution, the target task (TARGETTASK) information of the target node is added, and the flow node is rolled back to the target node.
Fig. 3 is a schematic structural diagram of a flow rollback device based on activiti according to an embodiment of the present invention, as shown in fig. 3, where the flow rollback device based on activiti provided in this embodiment includes:
The node obtaining module 31 is configured to obtain activiti a current node in the workflow, where the current node needs to perform task jump.
A flow instance calling module 32, configured to call a corresponding sub-flow instance according to the current node; and obtaining a root flow instance corresponding to the sub-flow instance.
The information deleting module 33 is configured to delete task information of the current node, each flow instance corresponding to the current node, and other additional information.
The task establishment module 34 is configured to add a target node to the root flow instance and establish target task information on the target node.
The activiti-based flow rollback device provided by the embodiment of the invention can execute the activiti-based flow rollback method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Further, based on the embodiment shown in fig. 3, the process instance calling module 32 is specifically configured to obtain a parent process instance corresponding to the child process instance; and obtaining a root flow instance corresponding to the parent flow instance.
Further, based on 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, based on the embodiment shown in fig. 3, the flow instance calling module 32 is specifically configured to call the corresponding sub-flow instance according to the task identifier of the current node that needs to perform task jump.
Fig. 4 is a schematic structural diagram of a computer device according to an embodiment of the present invention, and as shown in fig. 4, the computer device 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, one processor 41 being taken as an example in fig. 4; the processor 41, the memory 42, the input means 43 and the output means 44 in the computer device may be connected by a bus or by other means, in fig. 4 by way of example.
The memory 42 is used as a computer readable storage medium, and may be used to store a software program, a computer executable program, and modules, such as program instructions/modules corresponding to the activiti-based flow rollback method in the embodiment of the present invention (e.g., the node acquisition module 31, the flow instance calling module 32, the information deletion module 33, and the task creation module 34 in the activiti-based flow rollback apparatus). The processor 41 executes various functional applications of the computer device and data processing by running software programs, instructions and modules stored in the memory 42, i.e. implements the above-described activiti-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, at least one application program required for functions; the storage data area may store data created according to the use of the terminal, etc. In addition, 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 comprise memory located remotely from processor 41, which may be connected to the computer device via 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 means 43 may be used to receive entered numeric or character information and to generate key signal inputs related to user settings and function control of the computer device. The output device 44 may include a display device such as a display screen.
Embodiments of the present invention also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform a activiti-based flow rollback method, the method comprising:
Acquiring a current node needing task skip in activiti workflow;
Calling a corresponding sub-flow instance according to the current node;
Acquiring a root flow instance corresponding to the sub-flow instance;
deleting task information of the current node, each flow instance corresponding to the current node and other additional information;
adding a target node on the root flow instance and establishing target task information on the target node.
Of course, the storage medium containing the computer executable instructions provided in the embodiments of the present invention is not limited to the method operations described above, and may also perform the related operations in the activiti-based flow rollback method provided in any embodiment of the present invention.
From the above description of embodiments, it will be clear to a person skilled in the art that the present invention may be implemented by means of software and necessary general purpose hardware, but of course also by means of hardware, although in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as a floppy disk, a read-only memory (ROM), a random access memory (Random Access Memory, RAM), a FLASH memory (FLASH), a hard disk, or an optical disk of a computer, etc., and include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments of the present invention.
It should be noted that, in the embodiment of the flow rollback device based on activiti, each unit and module included are only divided according to the functional logic, but are not limited to the above-mentioned division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present invention.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. 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, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (8)

1. A activiti-based flow rollback method, comprising:
Acquiring a current node needing task skip in activiti workflow;
Calling a corresponding sub-flow instance according to the current node;
acquiring a root flow instance corresponding to the sub-flow instance;
deleting the task information of the current node, each flow instance corresponding to the current node and other additional information;
adding a target node on the root flow instance and establishing target task information on the target node;
The obtaining the root process instance corresponding to the sub-process instance includes:
acquiring a parent process instance corresponding to the child process instance;
acquiring a root flow instance corresponding to the parent flow instance;
the root flow instance, parent flow instance, child flow instance are tree structures.
2. The method of claim 1, wherein deleting the task information of the current node and each flow instance 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 father process instance and other additional information corresponding to the current node.
3. The method according to any one of claims 1-2, wherein the invoking the corresponding sub-flow instance according to the current node comprises:
And calling a corresponding sub-flow instance according to the task identifier needing to carry out task jump in the current node.
4. A activiti-based flow rollback apparatus, comprising:
the node acquisition module is used for acquiring a current node needing task jump in activiti workflow;
The flow instance calling module is used for calling the corresponding sub-flow instance according to the current node; acquiring a root flow instance corresponding to the sub-flow instance;
the information deleting module is used for deleting the task information of the current node, each flow instance corresponding to the current node and other additional information;
The task establishing module is used for adding a target node on the root flow instance and establishing target task information on the target node;
The flow instance calling module is specifically configured to obtain a parent flow instance corresponding to the child flow instance; acquiring a root flow instance corresponding to the parent flow instance; the root flow instance, parent flow instance, child flow instance are tree structures.
5. The apparatus of claim 4, wherein the information deleting module is specifically configured to delete task information of the current node and a child process instance, a parent process instance, and other additional information corresponding to the current node.
6. The apparatus according to any one of claims 4 to 5, wherein the flow instance calling module is specifically configured to call a corresponding sub-flow instance according to the task identifier that needs to perform task skipping in the current node.
7. 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 a activiti-based flow rollback method as claimed in any one of claims 1 to 3 when the program is executed.
8. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements a activiti-based flow rollback method as claimed in any one of claims 1 to 3.
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 CN113687882A (en) 2021-11-23
CN113687882B true 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 (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8365170B2 (en) * 2008-11-13 2013-01-29 International Business Machines Corporation Realizing jumps in an executing process instance

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN113687882A (en) 2021-11-23

Similar Documents

Publication Publication Date Title
CN111277639B (en) Method and device for maintaining data consistency
WO2019028992A1 (en) Multi-module version dependency relationship construction method, device, server and storage medium
CN111258565B (en) Method, system, server and storage medium for generating applet
CN111814089A (en) Page rendering method and device, rendering server and storage medium
CN109214785B (en) Workflow implementation method, server and system
CN112988123B (en) DDD-oriented software design method and system
US8224933B2 (en) Method and apparatus for case-based service composition
CN113687882B (en) Activiti-based flow rollback method, activiti-based flow rollback device and storage medium
CN112395339A (en) Method and device for checking data access between systems, computer equipment and storage medium
CN113127335A (en) System testing method and device
CN111625323A (en) Distributed task processing method, device, equipment and computer readable storage medium
CN115629743A (en) Service component arranging method, service scheduling method and device, electronic equipment and storage medium
CN111080250B (en) Flow backspacing compensation method and device, storage medium and electronic equipment
CN112231011B (en) Activiti-based flow chart adjustment method and device, electronic equipment and storage medium
CN112418796B (en) Sub-process task node activation method and device, electronic equipment and storage medium
CN115061796A (en) Execution method and system for calling between subtasks and electronic equipment
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
CN113885886A (en) Method, device, system and storage medium for processing activity service
CN110597572B (en) Service call relation analysis method and computer system
CN108763498B (en) User identity identification method and device, electronic equipment and readable storage medium
CN111400060A (en) Equipment linkage method, device, server and medium
CN111652580A (en) Method and device for processing data of nodes
CN110944047A (en) Distributed application monitoring method and device
CN114785862B (en) Processing method and related device for custom routing information

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