CN117950763A - Flow processing method based on activiti workflow engine - Google Patents

Flow processing method based on activiti workflow engine Download PDF

Info

Publication number
CN117950763A
CN117950763A CN202410138773.XA CN202410138773A CN117950763A CN 117950763 A CN117950763 A CN 117950763A CN 202410138773 A CN202410138773 A CN 202410138773A CN 117950763 A CN117950763 A CN 117950763A
Authority
CN
China
Prior art keywords
flow
task
node
workflow engine
current task
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.)
Pending
Application number
CN202410138773.XA
Other languages
Chinese (zh)
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.)
Wisdri Engineering and Research Incorporation Ltd
Original Assignee
Wisdri Engineering and Research Incorporation 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 Wisdri Engineering and Research Incorporation Ltd filed Critical Wisdri Engineering and Research Incorporation Ltd
Priority to CN202410138773.XA priority Critical patent/CN117950763A/en
Publication of CN117950763A publication Critical patent/CN117950763A/en
Pending legal-status Critical Current

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/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • 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/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/3005Arrangements for executing specific machine instructions to perform operations for flow control
    • G06F9/30069Instruction skipping instructions, e.g. SKIP
    • 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/4488Object-oriented
    • G06F9/4492Inheritance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/08Logistics, e.g. warehousing, loading or distribution; Inventory or stock management
    • G06Q10/083Shipping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/103Workflow collaboration or project management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Strategic Management (AREA)
  • Human Resources & Organizations (AREA)
  • Data Mining & Analysis (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Economics (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • General Business, Economics & Management (AREA)
  • Operations Research (AREA)
  • Marketing (AREA)
  • Databases & Information Systems (AREA)
  • Computational Linguistics (AREA)
  • Development Economics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application provides a flow processing method based on activiti workflow engine, which comprises the following steps: acquiring and analyzing information of a current task node from a database table of a activiti workflow engine, determining information of the current task node and a target task node to be skipped, and forming a task flow set; acquiring a service interface of an engine to initialize a command executor object for executing a custom command, wherein the custom command is used for jumping to a target task node; creating a container object and binding a custom command in springboot items integrated with the engine; and rewriting the inheritance logic and newly adding a target task comprising the target task node and the original task flow. According to the method, the logical framework of activiti is dynamically rewritten by analyzing the database table, the dynamic jump of the task nodes of the ERP system is realized by using the custom command, the operation convenience and the use efficiency of the workflow system are improved, and the labor cost is reduced.

Description

Flow processing method based on activiti workflow engine
Technical Field
The application relates to the technical field of computer application, in particular to a flow processing method based on activiti workflow engine.
Background
An enterprise resource planning (ENTERPRISE RESOURCE PLANNING, ERP) system is a comprehensive informatization system centering on an enterprise, integrates various business modules in the enterprise, including purchasing, selling, warehouse management, production planning, financial management and the like, and has a remarkable promotion effect on the improvement of the working efficiency of the enterprise. The informatization of the vehicle logistics management is based on the development preliminary implementation of a logistics management ERP system. However, with the change of the logistics transportation business process and the continuous increase of the system data volume, the function of the traditional logistics management ERP system cannot meet the latest business requirements of enterprises.
The conventional workflow engine is adopted in the prior ERP system to realize workflow scheduling, and the conventional workflow engine can not record the sources of tasks and can only be executed according to well-defined connection, and can not be executed if the tasks are not connected, so that the conventional workflow engine is adopted in the development process of the logistics management ERP system, and at least the following two problems exist:
First, the process error is difficult to correct in time, and the process operation error rate is high. Since business management of an enterprise often involves a situation where one employee faces multiple complex businesses, misoperation of the employee often occurs. However, the traditional workflow engine does not support the system flow rollback function, which results in difficulty in timely correction after data operation errors occur.
Secondly, the business processing flow is immobilized, and is difficult to adapt to special business scenes with flexible and changeable flows. In some special business scenarios, the flow of business processes is variable, such as waiting for a preliminary inspection task in the scrap flow. In logistics transportation, most scrap steel vehicles need to go through a primary inspection process. But some vehicles need to skip the execution of the task because they have already been detected, and jump directly to waiting for the scrap yard to admit the permission task. The traditional workflow engine cannot realize the jump of the task node, so that the scrap steel flow cannot be normally completed.
Disclosure of Invention
In order to solve the technical problems, the application provides a flow processing method based on activiti workflow engine, which dynamically rewrites the logic framework of activiti by analyzing the database table, and uses the custom command to realize the dynamic jump of task nodes of the ERP system, thereby improving the operation convenience and the use efficiency of the workflow system and reducing the labor cost.
In a first aspect, the present application provides a method for processing a flow based on activiti workflow engine, the method comprising:
S1, acquiring and analyzing information of a current task node from a database table of a activiti workflow engine, determining a first identifier of the current task node and a second identifier of a target task node to be skipped, positioning a flow definition and a flow instance of the current task node according to the first identifier, marking, and storing the flow definition and the flow instance as a task flow set;
S2, acquiring a service interface provided by a activiti workflow engine, initializing a command executor object, loading a command interceptor of the command executor object into a call chain, and storing the task flow set in an object entity corresponding to the command executor, wherein the command executor object is used for executing a custom command, and the custom command is used for jumping from the current task node to the target task node;
S3, creating a bean object in a springboot project integrating the activiti workflow engine, injecting the created bean object into the springboot framework by using a construction function mode, and binding the custom command into the construction function corresponding to the bean object;
s4, rewriting inheritance logic in the service interface, and adding a target task based on the rewritten inheritance logic, wherein the target task comprises the target task node and all task flows before the current task node.
Through the above processes, the new process logic for jumping to the target task node can be injected into the object entity in the integrated springboot and activiti development environment to enable the reconstructed logic to be effective, so that the task nodes can jump at will based on the new logic workflow, and the original process definition and the information of other tasks can not be influenced.
In one possible implementation manner, the step S1 includes:
S11, responding to a jump instruction from the current task node to the target task node, and triggering a data query request;
S12, responding to a data query request, acquiring a first identifier ProcessInstanceID of a running process instance of the current task node and a second identifier of the target task node from a process instance table and a historical task table of the database table, and detecting the legitimacy of the first identifier and the second identifier;
S13, under the condition that the first identifier and the second identifier are legal, acquiring information of the flow instance, processDefinitionID of flow definition corresponding to the flow instance and information of the flow definition from a flow instance table and a historical task table of the database table to form a task flow set of a current task; and acquiring the information of the target task node to form a task flow set of the target task.
In one possible implementation manner, the task flow set of the current task is used for comparing and analyzing the task state after the jump; and the task flow set of the target task is used for testing the state of the task node after the jump.
In one possible implementation, the current task is a flow instance generated from a history of existing flow definitions; the current task includes: the method comprises the steps of flow definition information, flow instance information, last task node information, next task node information and executor information, wherein the last node information and the next node information are used for supporting rollback of a flow node.
In one possible implementation manner, the step S4 includes:
S41, acquiring a flow definition of the current task node running flow instance and corresponding flow resources from a database table carried by the activiti workflow engine;
s42, acquiring current flow model parameters through bpmnModel of the activiti workflow engine, and redefining execution logic of a current task by using a method provided by the service interface taskservice;
S43, skipping logic constraint defined by the flow, judging the next step outlet of the current task according to a historical task table in the database table, and adding a flow connection line between the target task and the current task;
S44, mapping the flow definition corresponding to the current task node into a flow definition object, replacing a next outlet of the current task in the flow definition object with the target task node, and generating the target task based on the flow definition object.
In one possible embodiment, the method further comprises:
When the current task node includes a plurality of next-step exits, steps S43 to S44 are re-executed, and the next-step exits are re-matched.
In one possible implementation, the step S44 includes:
Mapping the flow definition corresponding to the current task node into a flow definition object by modifying the attribute of the ProcessEngine object in the activiti workflow engine, and replacing the next step outlet of the current task in the flow definition object by the target task node; and generating the target task based on the flow definition object after the next step of outlet replacement.
Alternatively, this step may be implemented through the internal service class interface provided by activiti. The internal service is directly used for operation, the bottom layer is not required to be analyzed, and the development time is greatly saved.
In the application, the next step of export is judged based on the data in the database table, and corresponding operation is realized through the internal service class, so that the jump logic can be placed in the service layer, thereby ensuring the flexibility and low coupling of the logic change of the workflow.
In one possible implementation manner, the step S4 includes:
The inheritance logic in the service interface is rewritten, the original current task is deleted, and a target task is newly added based on the rewritten inheritance logic; the deleting the original current task comprises the following steps:
before deleting the current task, saving the information of the current task in an object entity of the current task;
And when deleting the code of the current task, if the transmission value acquired from the last task node is false, retaining the information of the current task.
Through the process, the key information of the original task can be stored in the corresponding entity before the original task is deleted, so that other information except the latest node of the newly added target task is consistent with the original task, and the dynamic jump effect which does not influence the definition of the original flow is realized.
In one possible embodiment, the method further comprises: in response to a user operation, information of any original task is saved/deleted.
Based on the method, the enterprise user can freely decide whether to store the original flow information according to the actual situation, and convenience of system operation is greatly improved.
In one possible implementation, the workflow is developed directly based on a command pattern provided by an internal service interface of the acitiviti workflow engine, the method further comprising:
Based on acitiviti the workflow engine directly generates an execution log, the development tasks for the workflow support debugging through the execution log.
The technical scheme provided by the application can directly change the operation rule of a certain flow, and when all flows need to operate according to the new rule, compared with the method for directly changing the underlying file, the scheme does not need to repeatedly execute the new method, thereby realizing the dynamic jump effect.
In a second aspect, a computing device is provided, the computing device comprising a memory and a processor, the memory storing at least one program, the at least one program being executable by the processor to implement the activiti workflow engine-based flow processing method as provided in the first aspect.
In a third aspect, a computer readable storage medium is provided, in which at least one program is stored, the at least one program being executed by a processor to implement a method of workflow processing based on activiti workflow engine as provided in the first aspect.
The technical scheme provided by the application at least comprises the following technical effects:
The application improves activiti task allocation mechanism, changes and analyzes the frame and database table of activiti, and realizes the automatic jump of workflow task through user-defined command; analyzing activiti a workflow engine database table to logically track the target task after automatic jump, judging whether the whole process after jump normally runs, and early warning the abnormal process in real time to ensure the reliability of the workflow;
Compared with other workflow engine technologies, the application optimizes acitiviti workflow engines, increases the convenience of system operation and reduces the labor cost; the logical framework of activiti is dynamically rewritten by analyzing the database table of activiti workflow engine, and the dynamic jump of task nodes of the ERP system is realized by using the custom command, so that the operation convenience and the use efficiency of the workflow system are improved. And compared with the traditional workflow engine, the workflow processing method has higher flow processing efficiency and wider applicable scene.
Drawings
FIG. 1 is a flow chart of a flow processing method based on activiti workflow engine provided by an embodiment of the present application;
FIG. 2 is a flow chart of override inheritance logic provided by an embodiment of the present application;
FIG. 3 is a flow chart of another method for processing a workflow based on activiti workflow engine according to an embodiment of the present application.
Detailed Description
For further illustration of the various embodiments, the application is provided with the accompanying drawings. The accompanying drawings, which are incorporated in and constitute a part of this disclosure, illustrate embodiments and together with the description, serve to explain the principles of the embodiments. With reference to these matters, one of ordinary skill in the art will understand other possible embodiments and advantages of the present application. The components in the figures are not drawn to scale and like reference numerals are generally used to designate like components. The term "at least one" in the present application means one or more, and the term "plurality" in the present application means two or more.
The application will now be further described with reference to the drawings and detailed description.
The application provides a flow processing method based on activiti workflow engine, which dynamically rewrites the logic framework of activiti by analyzing the database table of activiti workflow engine, and uses the custom command to realize the dynamic jump of task nodes of ERP system, thereby improving the operation convenience and the use efficiency of workflow system and reducing the labor cost.
The flow processing method based on activiti workflow engine provided by the application can be executed by computing equipment. By way of example, the computing device may be a terminal device or server, the terminal device being, for example, a personal computer, desktop computer, tablet mobile smartphone, or the like; the server is, for example, a single physical server, a server cluster formed by a plurality of physical servers, or a distributed file system, or a cloud server cluster for providing cloud storage, cloud services, cloud databases, cloud computing, cloud functions, network services, cloud communication, middleware services, domain name services, security services, a content delivery network (content delivery network, CDN), big data, an artificial intelligence platform, and other basic cloud computing services, which is not limited in this application.
Fig. 1 is a flowchart of a flow processing method based on activiti workflow engine according to an embodiment of the present application, and referring to fig. 1, the method includes steps S1 to S4, which may be executed by a computing device.
S1, acquiring and analyzing information of a current task node from a database table of a activiti workflow engine, determining a first identification of the current task node and a second identification of a target task node to be jumped, positioning a flow definition and a flow instance of the current task node according to the first identification, marking, and storing the flow definition and the flow instance as a task flow set.
In one possible implementation, this step S1 includes:
And S11, responding to a jump instruction from the current task node to the target task node, and triggering a data query request.
S12, responding to the data query request, acquiring a first identifier ProcessInstanceID of a current task node running process instance and a second identifier of a target task node from a database table process instance table and a historical task table, and detecting the legitimacy of the first identifier and the second identifier.
S13, under the condition that the first identifier and the second identifier are legal, acquiring information of a flow instance, processDefinitionID of flow definition corresponding to the flow instance and information of the flow definition from a flow instance table and a historical task table of a database table to form a task flow set of the current task; and acquiring information of the target task node to form a task flow set of the target task.
In one possible implementation, the task flow set of the current task is used for comparing and analyzing the task state after the jump; the task flow set of the target task is used for testing the state of the task node after the jump.
Through the process, the specific information of the running process instance and the specific information of the target task are acquired based on the data query method, and the queried data are divided into two parts for information comparison analysis and task dynamic jump effect test respectively.
In the embodiment of the application, a dynamic jump effect can be realized between the current task node and the target task node, and the dynamic jump effect refers to that: the task nodes of the workflow can jump at will, and the original flow definition and the information of other tasks are not affected.
In one possible implementation, the current task is a flow instance generated from historical existing flow definitions; the current tasks include: the information of the flow definition, the information of the flow instance, the information of the last task node, the information of the next task node and the information of the executor are used for supporting the rollback of the flow node.
S2, acquiring activiti a service interface provided by a workflow engine, initializing a command executor (commandexcutor) object, loading a command interceptor (commandintereptor) of the command executor object into a call chain, and storing a task flow set in an object entity corresponding to the command executor, wherein the command executor object is used for executing a custom command, and the custom command is used for jumping from a current task node to a target task node.
S3, creating a bean object in springboot items of the integrated activiti workflow engine, injecting the created bean object into a springboot framework in a constructor mode, and binding a custom command into the constructor corresponding to the bean object.
Springboot is a Java development framework that supports rapid application development. Activiti, as a Java-based workflow engine, can help handle complex business processes. By integrating springboot and activiti, efficient and flexible workflow application projects can be quickly developed.
Illustratively, the goal of integrating activiti in springboot items is achieved by adding Spring Boot Web Starter, ACTIVITI ENGINE, ACTIVITI SPRING components, and other dependent items to the item profile. After the dependencies are configured, a activiti configuration class is created for configuring and initializing the engine of activiti. In this activiti configuration class, a flow engine (ProcessEngine) is defined and configured. Next, parameters of the workflow model are defined using activiti modelers. The workflow model describes the various flow nodes of the business flow and the logical relationships between the nodes.
Through the above processes, the new process logic for jumping to the target task node can be injected into the object entity in the integrated springboot and activiti development environment to enable the reconstructed logic to be effective, so that the task nodes can jump at will based on the new logic workflow, and the original process definition and the information of other tasks can not be influenced.
S4, rewriting inheritance logic in the service interface, and newly adding a target task based on the rewritten inheritance logic, wherein the target task comprises a target task node and all task flows before the current task node.
In one possible implementation, this step S4 deletes the original current task after overwriting the inheritance logic within the service interface. The process of deleting the original current task comprises the following steps: before deleting the current task, storing the information of the current task in an object entity of the current task; when deleting the code of the current task, if the transmission value obtained from the last task node is false, the information of the current task is reserved.
Through the process, the key information of the original task can be stored in the corresponding entity before the original task is deleted, so that other information except the latest node of the newly added target task is consistent with the original task, and the dynamic jump effect which does not influence the definition of the original flow is realized.
In one possible implementation, information for any original task is saved/deleted in response to a user operation. Based on the method, the enterprise user can freely decide whether to store the original flow information according to the actual situation, and convenience of system operation is greatly improved.
Fig. 2 is a flowchart of the overwrite inheritance logic according to an embodiment of the present application, and as shown in fig. 2, the flow of the overwrite inheritance logic includes steps 100 to 400 described below.
100. Acquiring information of a current task node;
200. inheriting the flow command class to create a corresponding command executor object to carry the custom command;
300. Injecting springboot a custom command representing the reconstructed task flow logic into the framework;
400. the inheritance logic is rewritten. After step 400, the original task can be deleted and the target task can be newly added based on the rewritten inheritance logic.
In one possible embodiment, the present step S4 includes the following steps S41 to S44.
S41, acquiring a flow definition of a current task node running flow instance and corresponding flow resources from a database table carried by the activiti workflow engine.
S42, acquiring current flow model parameters through bpmnModel of activiti workflow engine, and redefining execution logic of the current task by using a method provided by a service interface taskservice.
Alternatively, this step may be implemented through the internal service class interface provided by activiti. The internal service is directly used for operation, the bottom layer is not required to be analyzed, and the development time is greatly saved.
S43, skipping logic constraint defined by the flow, judging the next outlet of the current task according to the historical task table in the database table, and adding a flow connection line between the target task and the current task.
In the embodiment of the application, the next step of export is judged based on the data in the database table, and corresponding operation is realized through the internal service class, so that the jump logic can be placed in the service layer, thereby ensuring the flexibility and low coupling of the logic change of the workflow.
S44, mapping the flow definition corresponding to the current task node into a flow definition object, replacing the next outlet of the current task in the flow definition object with the target task node, and generating the target task based on the flow definition object.
Illustratively, the object methods used to create the different task flow instances are inherited from the activiti base class. The overwrite inheritance logic refers to the process definition object used to redefine the current task.
In one possible implementation, step S44 includes: mapping the flow definition corresponding to the current task node into a flow definition object by modifying the attribute of the ProcessEngine object in the activiti workflow engine, and replacing the next step outlet of the current task in the flow definition object by the target task node; and generating a target task based on the flow definition object after the next step of export is replaced.
In one possible implementation, if step S43 determines that the current task node includes a plurality of next exits, the correct next flow information cannot be matched, so by re-executing steps S43 to S44, the next exits are obtained by re-matching, so as to continuously track and promote the correctness of the flow logic.
In order to facilitate understanding of the above-described processes from step S41 to step S44, another flowchart of a process processing method based on activiti workflow engine is provided in the embodiment of the present application, as shown in fig. 3, after obtaining information such as a process definition of a current task node, determining a next exit according to the information in a database table, and determining custom logic (corresponding to a custom command); a logic connection line is additionally arranged between the target task and the current task, and the target task node is used for covering the next step of outlet of the original current task node; finally, the creation of the target task does not affect the completion of the original current task, which can proceed.
The technical scheme provided by the embodiment of the application can directly change the operation rule of a certain flow, and when all flows need to operate according to the new rule, compared with the method for directly changing the bottom file, the scheme does not need to repeatedly execute a new method, thereby realizing the dynamic jump effect.
In one possible implementation, the workflow is developed directly based on command patterns provided by an internal service interface of the acitiviti workflow engine, in which example the computing device may generate execution logs directly based on the acitiviti workflow engine, with debugging through the execution logs being supported for the development tasks of the workflow.
The application discloses a flow processing method based on activiti workflow engine, which can be used for workflow optimization of a logistics management ERP system. The task allocation mechanism of activiti is improved, the framework and the database table of activiti are changed and analyzed, and the automatic jump of workflow tasks is realized through a custom command; analyzing activiti a workflow engine database table to logically track the target task after automatic jump, judging whether the whole process after jump normally runs, and early warning the abnormal process in real time to ensure the reliability of the workflow;
Therefore, compared with other workflow engine technologies, the application optimizes acitiviti workflow engines, increases the convenience of system operation and reduces the labor cost; the logical framework of activiti is dynamically rewritten by analyzing the database table of activiti workflow engine, and the dynamic jump of task nodes of the ERP system is realized by using the custom command, so that the operation convenience and the use efficiency of the workflow system are improved. And compared with the traditional workflow engine, the workflow processing method has higher flow processing efficiency and wider applicable scene. By way of example, when the scheme of the application is deployed in a production environment for use, such as a logistics management and control ERP system of a wine steel group, the working efficiency of logistics management and control of all posts of the storage and transportation part can be greatly improved, the process cooperation among posts is enhanced, and the actual requirements of production work can be fully met.
The present application provides a computing device comprising a processor, a memory, a bus, and a computer program stored in and executable on said memory, the processor comprising one or more processing cores, the memory 802 being connected to the processor by the bus, the memory being for storing program instructions, said processor implementing all or part of the steps of the above-described method embodiments provided by the present application when said computer program is executed.
Further, as an executable scheme, the computing device may be a computer unit, and the computer unit may be a computing device such as a desktop computer, a notebook computer, a palm computer, and a cloud server. The computer unit may include, but is not limited to, a processor, a memory. It will be appreciated by those skilled in the art that the constituent structures of the computer unit described above are merely examples of the computer unit and are not limiting, and may include more or fewer components than those described above, or may combine certain components, or different components. For example, the computer unit may further include an input/output device, a network access device, a bus, etc., which is not limited by the embodiment of the present application.
The present application also provides a computer readable storage medium storing a computer program which when executed by a processor implements the steps of the above-described method of an embodiment of the present application.
The modules/units integrated with the computer unit may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a software distribution medium, and so forth. It should be noted that the content of the computer readable medium can be appropriately increased or decreased according to the requirements of the legislation and the patent practice in the jurisdiction.
It should be understood that the specific order or hierarchy of steps in the method flows disclosed in the embodiments described above are examples of exemplary approaches. Based on design preferences, it is understood that the specific order or hierarchy of steps in the processes may be rearranged without departing from the scope of the present disclosure. The accompanying method claims present elements of the various steps in a sample order, and are not meant to be limited to the specific order or hierarchy presented.
In the foregoing detailed description, various features are grouped together in a single embodiment for the purpose of streamlining the disclosure. This method of disclosure is not to be interpreted as reflecting an intention that the claimed embodiments of the subject matter require more features than are expressly recited in each claim. Rather, as the following claims reflect, application lies in less than all features of a single disclosed embodiment. Thus the following claims are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate preferred embodiment of this application.
The foregoing description includes examples of one or more embodiments. It is, of course, not possible to describe every conceivable combination of components or methodologies for purposes of describing the aforementioned embodiments, but one of ordinary skill in the art may recognize that many further combinations and permutations of various embodiments are possible. Accordingly, the embodiments described herein are intended to embrace all such alterations, modifications and variations that fall within the scope of the appended claims. Furthermore, as used in the specification or claims, the term "comprising" is intended to be inclusive in a manner similar to the term "comprising," as interpreted when employed as a transitional word in a claim. Furthermore, any use of the term "or" in the specification of the claims is intended to mean "non-exclusive or".
While the application has been particularly shown and described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the application as defined by the appended claims.

Claims (10)

1. A method for processing a flow based on activiti workflow engine, the method comprising:
S1, acquiring and analyzing information of a current task node from a database table of a activiti workflow engine, determining a first identifier of the current task node and a second identifier of a target task node to be skipped, positioning a flow definition and a flow instance of the current task node according to the first identifier, marking, and storing the flow definition and the flow instance as a task flow set;
S2, acquiring a service interface provided by a activiti workflow engine, initializing a command executor object, loading a command interceptor of the command executor object into a call chain, and storing the task flow set in an object entity corresponding to the command executor, wherein the command executor object is used for executing a custom command, and the custom command is used for jumping from the current task node to the target task node;
S3, creating a bean object in a springboot project integrating the activiti workflow engine, injecting the created bean object into the springboot framework by using a construction function mode, and binding the custom command into the construction function corresponding to the bean object;
s4, rewriting inheritance logic in the service interface, and adding a target task based on the rewritten inheritance logic, wherein the target task comprises the target task node and all task flows before the current task node.
2. The activiti workflow engine based flow processing method as claimed in claim 1, wherein said step S1 includes:
S11, responding to a jump instruction from the current task node to the target task node, and triggering a data query request;
S12, responding to a data query request, acquiring a first identifier ProcessInstanceID of a running process instance of the current task node and a second identifier of the target task node from a process instance table and a historical task table of the database table, and detecting the legitimacy of the first identifier and the second identifier;
S13, under the condition that the first identifier and the second identifier are legal, acquiring information of the flow instance, processDefinitionID of flow definition corresponding to the flow instance and information of the flow definition from a flow instance table and a historical task table of the database table to form a task flow set of a current task; and acquiring the information of the target task node to form a task flow set of the target task.
3. The activiti workflow engine based flow processing method as claimed in claim 2 wherein the task flow set of the current task is used for comparison and analysis with the task state after jump; and the task flow set of the target task is used for testing the state of the task node after the jump.
4. The activiti workflow engine based flow processing method of claim 2 wherein the current task is a flow instance generated from historical existing flow definitions; the current task includes: the method comprises the steps of flow definition information, flow instance information, last task node information, next task node information and executor information, wherein the last node information and the next node information are used for supporting rollback of a flow node.
5. The method for processing a workflow based on activiti workflow engine as claimed in claim 1, wherein said step S4 comprises:
S41, acquiring a flow definition of the current task node running flow instance and corresponding flow resources from a database table carried by the activiti workflow engine;
s42, acquiring current flow model parameters through bpmnModel of the activiti workflow engine, and redefining execution logic of a current task by using a method provided by the service interface taskservice;
S43, skipping logic constraint defined by the flow, judging the next step outlet of the current task according to a historical task table in the database table, and adding a flow connection line between the target task and the current task;
S44, mapping the flow definition corresponding to the current task node into a flow definition object, replacing a next outlet of the current task in the flow definition object with the target task node, and generating the target task based on the flow definition object.
6. The activiti workflow engine based flow processing method as claimed in claim 5 further comprising:
When the current task node includes a plurality of next-step exits, steps S43 to S44 are re-executed, and the next-step exits are re-matched.
7. The activiti workflow engine based flow processing method as claimed in claim 5, wherein said step S44 includes:
Mapping the flow definition corresponding to the current task node into a flow definition object by modifying the attribute of the ProcessEngine object in the activiti workflow engine, and replacing the next step outlet of the current task in the flow definition object by the target task node;
And generating the target task based on the flow definition object after the next step of outlet replacement.
8. The activiti workflow engine based flow processing method as claimed in claim 1, wherein said step S4 includes:
The inheritance logic in the service interface is rewritten, the original current task is deleted, and a target task is newly added based on the rewritten inheritance logic; the deleting the original current task comprises the following steps:
before deleting the current task, saving the information of the current task in an object entity of the current task;
And when deleting the code of the current task, if the transmission value acquired from the last task node is false, retaining the information of the current task.
9. The activiti workflow engine based flow processing method of claim 1 or 8, wherein the method further comprises: in response to a user operation, information of any original task is saved/deleted.
10. The activiti workflow engine based flow processing method of claim 1 wherein a workflow is developed directly based on command patterns provided by an internal service interface of the acitiviti workflow engine, the method further comprising:
Based on acitiviti the workflow engine directly generates an execution log, the development tasks for the workflow support debugging through the execution log.
CN202410138773.XA 2024-01-31 2024-01-31 Flow processing method based on activiti workflow engine Pending CN117950763A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410138773.XA CN117950763A (en) 2024-01-31 2024-01-31 Flow processing method based on activiti workflow engine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410138773.XA CN117950763A (en) 2024-01-31 2024-01-31 Flow processing method based on activiti workflow engine

Publications (1)

Publication Number Publication Date
CN117950763A true CN117950763A (en) 2024-04-30

Family

ID=90804751

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410138773.XA Pending CN117950763A (en) 2024-01-31 2024-01-31 Flow processing method based on activiti workflow engine

Country Status (1)

Country Link
CN (1) CN117950763A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118132138A (en) * 2024-05-06 2024-06-04 苏州锐盈智能科技有限公司 Workflow driving method and system based on database flow data model
CN118656152A (en) * 2024-08-22 2024-09-17 浪潮软件股份有限公司 Method and system for backing back tasks according to historical task ID based on flow

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118132138A (en) * 2024-05-06 2024-06-04 苏州锐盈智能科技有限公司 Workflow driving method and system based on database flow data model
CN118132138B (en) * 2024-05-06 2024-08-02 苏州锐盈智能科技有限公司 Workflow driving method and system based on database flow data model
CN118656152A (en) * 2024-08-22 2024-09-17 浪潮软件股份有限公司 Method and system for backing back tasks according to historical task ID based on flow

Similar Documents

Publication Publication Date Title
US8340995B2 (en) Method and system of using artifacts to identify elements of a component business model
US7761530B2 (en) Configuration change management tool
US8706771B2 (en) Systems and methods for analyzing and transforming an application from a source installation to a target installation
CN117950763A (en) Flow processing method based on activiti workflow engine
US11392393B2 (en) Application runtime configuration using design time artifacts
US10296305B2 (en) Method and device for the automated production and provision of at least one software application
US8630969B2 (en) Systems and methods for implementing business rules designed with cloud computing
US20160217423A1 (en) Systems and methods for automatically generating application software
CN112835924A (en) Real-time computing task processing method, device, equipment and storage medium
US11307971B1 (en) Computer analysis of software resource load
CN101753619B (en) Method and system for extending service model
US9740994B2 (en) Simulation of supply chain plans using data model
US20100161676A1 (en) Lifecycle management and consistency checking of object models using application platform tools
US20130014082A1 (en) Method of configuring business logic supporting multi-tenancy
CN112085289B (en) Program maintenance task processing method, device, equipment and storage medium
US20140149186A1 (en) Method and system of using artifacts to identify elements of a component business model
US20200356885A1 (en) Service management in a dbms
CN114996319B (en) Data processing method, device and equipment based on rule engine and storage medium
CN113010441B (en) Model issuing method and device, electronic equipment and storage medium
CN115222345A (en) Auditing operation method and device
CN113220592A (en) Processing method and device for automated testing resources, server and storage medium
US20110047001A1 (en) Method and system for creating an instance of an adaptable business object
US20110246249A1 (en) Simulation of supply chain plans using web service
Popović et al. A domain-specific language for managing ETL processes
KR102728658B1 (en) Method and system for SEPARATING DATA USING ARTIFICIAL INTELLIGENCE IN ENTERPRISE RESOURCE PLANNING ENVIRONMENT

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