CN116774983A - Workflow method based on flow - Google Patents

Workflow method based on flow Download PDF

Info

Publication number
CN116774983A
CN116774983A CN202310755755.1A CN202310755755A CN116774983A CN 116774983 A CN116774983 A CN 116774983A CN 202310755755 A CN202310755755 A CN 202310755755A CN 116774983 A CN116774983 A CN 116774983A
Authority
CN
China
Prior art keywords
task
flow processing
flow
class
strategy
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
CN202310755755.1A
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.)
Beijing Jiuzhou Hengsheng Electric Technology Co ltd
Original Assignee
Beijing Jiuzhou Hengsheng Electric Technology 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 Beijing Jiuzhou Hengsheng Electric Technology Co ltd filed Critical Beijing Jiuzhou Hengsheng Electric Technology Co ltd
Priority to CN202310755755.1A priority Critical patent/CN116774983A/en
Publication of CN116774983A publication Critical patent/CN116774983A/en
Pending legal-status Critical Current

Links

Abstract

The application provides a workflow method based on a Flowable, which comprises the following steps: storing codes of a flow processing strategy class, wherein the codes of the flow processing strategy class accord with a flow processing method of a flow processing strategy interface, the parameters of the flow processing method comprise task instance ID and flow processing parameters, the flow processing parameters are json character strings, and the return value is an Object type; registering the flow processing strategy class as Spring business Service by using Spring @ Service annotation and storing the Spring business Service in a container; associating a flow task in the flow model with a flow processing strategy class; and calling the spring flow processing strategy business service in the container on the Web flow processing interface. The application realizes that the business is abstracted and packaged into the flow processing strategy class, and the flow processing strategy class can be multiplexed only by correlating with the specific user task configuration, thereby improving the code multiplexing rate.

Description

Workflow method based on flow
Technical Field
The application belongs to the technical field of workflows, and particularly relates to a workflow method based on a Flowable.
Background
Workflow refers to "automation of a part or the whole of a business process in a computer application environment". Is an abstract and generalized description of workflow and business rules between its operational steps.
The open source flow engines which are relatively commonly used at present are as follows: osworkflow, jbpm, activiti, flowable, camunda. The above process engine has the following problems that 1, the process engine cannot be reused, and the application process engine is usually related to a specific process for developing personalized business logic, so that too tight binding exists between the application process engine and the related process, and the business codes are inconvenient to multiplex. 2. Code redundancy, because service codes can not be multiplexed, when the conditions of similar functions and different flows are met, similar services can only be realized again aiming at new flows, and a large amount of code redundancy is caused. 3. The service codes cannot be flexibly configured, a large number of similar codes are scattered in the code file because the service codes cannot be multiplexed, and when the service is changed, the modification is very troublesome and very inflexible.
Disclosure of Invention
The embodiment of the application provides a workflow method based on a Flowable, which can solve the problems that the existing workflow engine code is redundant and cannot be flexibly configured.
In a first aspect, the present application provides a workflow method based on a flow, including:
storing codes of a flow processing strategy class, wherein the codes of the flow processing strategy class accord with a flow processing method of a flow processing strategy interface, the parameters of the flow processing method comprise task instance ID and flow processing parameters, the flow processing parameters are json character strings, and the return value is an Object type;
registering the flow processing strategy class as Spring business Service by using Spring @ Service annotation and storing the Spring business Service in a container;
associating a flow task in the flow model with a flow processing strategy class;
and calling the spring flow processing strategy business service in the container on the Web flow processing interface.
Further, in the step of associating the flow tasks and the policy classes in the flow model, the method specifically comprises the following steps,
in the flow model list, receiving flow task strategy class relation parameters input by a user through a task configuration module, wherein the flow task strategy class relation parameters comprise task IDs, strategy class full names and task expansion information;
sending the process task strategy class relation parameters to the process task processing strategy configuration interface;
checking whether a task corresponding to a task ID in the process task strategy class relation parameters exists or not; and if the task ID, the strategy class full name and the task expansion information are stored in a flow task strategy class relation table.
Further, in the step of "calling the Spring business service in the container on the Web process processing interface", the method specifically includes the following steps,
calling a web flow processing interface of the back-end server; the interface entry is a task instance ID and a flow processing parameter JSON character string;
after receiving the participation, the web flow processing interface checks whether a task instance exists; checking whether the task corresponding to the task instance exists or not; checking whether a task strategy class relation corresponding to the task exists or not;
acquiring corresponding flow processing strategy service from the Spring container through the class full names in the task strategy class relation;
and executing the flow processing method of the flow processing strategy service.
Further, before the step of acquiring the corresponding flow processing policy service from the Spring container by the class full name in the task policy class relationship, the method further comprises the following steps,
and checking whether the user ID has processing authority for the task according to the logged-in user ID and the task corresponding to the task instance.
Compared with the prior art, the embodiment of the application has the beneficial effects that: the application realizes that the business is abstracted and packaged into the flow processing strategy class, and the flow processing strategy class can be multiplexed only by correlating with the specific user task configuration, thereby improving the code multiplexing rate. On the other hand, on the premise that the flow processing strategy class can be reused, the development is not required to be repeated, and the code redundancy is greatly reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method according to an embodiment of the present application.
Description of the embodiments
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in the present description and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
Furthermore, the terms "first," "second," "third," and the like in the description of the present specification and in the appended claims, are used for distinguishing between descriptions and not necessarily for indicating or implying a relative importance.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
The technical scheme provided by the embodiment of the application is described by a specific embodiment.
Examples
Referring to fig. 1, a workflow method based on a Flowable includes the steps of:
s101, storing codes of a flow processing strategy class, wherein the codes of the flow processing strategy class accord with a flow processing method of a flow processing strategy interface, the participation of the flow processing method comprises a task instance ID and flow processing parameters, the flow processing parameters are json character strings, and the return value is an Object type;
s102, registering the flow processing strategy class as Spring business Service by using Spring @ Service annotation and storing the Spring business Service in a container;
s103, associating the flow tasks in the flow model with the flow processing strategy class;
s104, calling the spring flow process strategy business service in the container on the Web flow process interface.
Specifically, in the step S101, the code of the flow processing policy class is written by the developer according to the flow processing method rule of the flow processing policy interface.
In the step S103, the user may select a flow model to be configured through the flow model selection interface in the Flowable workflow engine, and after selecting one flow model, configure all the flow tasks in the flow model.
By the method, the embodiment of the application realizes that the business is abstracted and packaged into the flow processing strategy class, and the flow processing strategy class can be multiplexed only by associating with the specific user task configuration, thereby improving the code multiplexing rate. And on the premise that the flow processing strategy class can be reused, the development is not required to be repeated, and the code redundancy is greatly reduced.
In an alternative embodiment, in the step of associating the flow tasks and policy classes in the flow model, specifically comprising the steps of,
in the flow model list, receiving flow task strategy class relation parameters input by a user through a task configuration module, wherein the flow task strategy class relation parameters comprise task IDs, strategy class full names and task expansion information;
sending the process task strategy class relation parameters to the process task processing strategy configuration interface; specifically, the flow task processing policy configuration interface is a Web interface.
Checking whether a task corresponding to a task ID in the process task strategy class relation parameters exists or not; and if the task ID, the strategy class full name and the task expansion information are stored in a flow task strategy class relation table.
Specifically, the task configuration module is a module which is established based on the flow process engine and is used for configuring the flow tasks and the flow processing strategy class, and a user can inquire the flow model in the task configuration module, select one flow model and display all the flow tasks under the flow model. A process task may also be selected in the task configuration module, on which the relevant task configuration is performed (the task policy class relationship configuration is only one of the task configurations).
The flow task policy class relation table is used for storing the relation between the flow task and the flow task policy class, all the flow task policy classes and the expansion information.
In an alternative embodiment, in the step of invoking Spring business services in the container on the Web process interface, specifically comprising the steps of,
calling a web flow processing interface of the back-end server; the interface entry is a task instance ID and a flow processing parameter JSON character string;
after receiving the participation, the web flow processing interface checks whether a task instance exists; checking whether the task corresponding to the task instance exists or not; checking whether a task strategy class relation corresponding to the task exists or not; specifically, when the above verification results are all present, the next step is entered.
Acquiring corresponding flow processing strategy service from the Spring container through the class full names in the task strategy class relation;
and executing the flow processing method of the flow processing strategy service.
By the method, multiplexing of service codes is realized, and redundancy degree of the codes is reduced.
In an alternative embodiment, before the step of "obtaining the corresponding flow processing policy service from the Spring container by the class full name in the task policy class relation", the method further comprises the following steps,
and checking whether the user ID has processing authority for the task according to the logged-in user ID and the task corresponding to the task instance.
Through the steps, before the corresponding flow processing strategy service is acquired from the Spring container, whether the user has corresponding permission can be checked, and safety is ensured.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, the specific names of the functional units and modules are only for distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
The embodiment of the application also provides a network device, which comprises: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, which when executed by the processor performs the steps of any of the various method embodiments described above.
Embodiments of the present application also provide a computer readable storage medium storing a computer program which, when executed by a processor, implements steps for implementing the various method embodiments described above.
Embodiments of the present application provide a computer program product which, when run on a mobile terminal, causes the mobile terminal to perform steps that enable the implementation of the method embodiments described above.
The present application may be implemented in whole or in part by a computer program which, when executed by a processor, performs the steps of the various method embodiments described above, and which may be embodied in a computer readable storage medium. 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 at least: any entity or device capable of carrying computer program code to a photographing device/terminal apparatus, recording medium, computer Memory, read-Only Memory (ROM), random access Memory (RAM, random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media. Such as a U-disk, removable hard disk, magnetic or optical disk, etc. In some jurisdictions, computer readable media may not be electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (4)

1. A Flowable-based workflow method, comprising:
storing codes of a flow processing strategy class, wherein the codes of the flow processing strategy class accord with a flow processing method of a flow processing strategy interface, the parameters of the flow processing method comprise task instance ID and flow processing parameters, the flow processing parameters are json character strings, and the return value is an Object type;
registering the flow processing strategy class as Spring business Service by using Spring @ Service annotation and storing the Spring business Service in a container;
associating a flow task in the flow model with a flow processing strategy class;
and calling the spring flow processing strategy business service in the container on the Web flow processing interface.
2. The method of claim 1, wherein in the step of associating flow tasks and policy classes in the flow model, the method comprises the steps of,
in the flow model list, receiving flow task strategy class relation parameters input by a user through a task configuration module, wherein the flow task strategy class relation parameters comprise task IDs, strategy class full names and task expansion information;
sending the process task strategy class relation parameters to the process task processing strategy configuration interface;
checking whether a task corresponding to a task ID in the process task strategy class relation parameters exists or not; and if the task ID, the strategy class full name and the task expansion information are stored in a flow task strategy class relation table.
3. The method of claim 1, wherein in step "invoke Spring business services in said container on a Web process interface", specifically comprising the steps of,
calling a web flow processing interface of the back-end server; the interface entry is a task instance ID and a flow processing parameter JSON character string;
after receiving the participation, the web flow processing interface checks whether a task instance exists; checking whether the task corresponding to the task instance exists or not; checking whether a task strategy class relation corresponding to the task exists or not;
acquiring corresponding flow processing strategy service from the Spring container through the class full names in the task strategy class relation;
and executing the flow processing method of the flow processing strategy service.
4. The method of claim 3, further comprising, prior to the step of "obtaining the corresponding process policy service from the Spring container by the class full name in the task policy class relationship",
and checking whether the user ID has processing authority for the task according to the logged-in user ID and the task corresponding to the task instance.
CN202310755755.1A 2023-06-26 2023-06-26 Workflow method based on flow Pending CN116774983A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310755755.1A CN116774983A (en) 2023-06-26 2023-06-26 Workflow method based on flow

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310755755.1A CN116774983A (en) 2023-06-26 2023-06-26 Workflow method based on flow

Publications (1)

Publication Number Publication Date
CN116774983A true CN116774983A (en) 2023-09-19

Family

ID=87985566

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310755755.1A Pending CN116774983A (en) 2023-06-26 2023-06-26 Workflow method based on flow

Country Status (1)

Country Link
CN (1) CN116774983A (en)

Similar Documents

Publication Publication Date Title
CN110287383B (en) Method and device for checking field information
CN110069941A (en) A kind of interface access authentication method, apparatus and computer-readable medium
US20030216927A1 (en) System and method for automated safe reprogramming of software radios
CN110601880A (en) Cloud platform, service processing method, command interface and computer equipment
EP1540586A2 (en) An adaptive management method and system with automatic dependency resolution
CN106951795A (en) A kind of application data access partition method and device
CN104363112A (en) Parameter management method and parameter management device
CN108733374A (en) Application program homepage development approach and terminal device
CN115328759A (en) Form verification method and device
CN112363997B (en) Data version management method, device and storage medium
CN116774983A (en) Workflow method based on flow
CN114157662B (en) Cloud platform parameter adaptation method, device, terminal equipment and storage medium
CN109857450A (en) A kind of verification service orchestration method and device
CN112417402B (en) Authority control method, authority control device, authority control equipment and storage medium
CN111652580B (en) Method and device for processing data of nodes
CN112261072B (en) Service calling method, device, equipment and storage medium
CN115511622A (en) Intelligent contract upgrading method, device, equipment and storage medium
CN112860398A (en) Data processing method, device, equipment and medium based on rule engine
CN112788017A (en) Safety verification method, device, equipment and medium
CN111125232A (en) Method and device for accessing public cloud asset information
CN109194734A (en) Information push method, device, server and readable storage medium storing program for executing
US11657033B2 (en) Systems and methods for maintaining data quality in a data store receiving both low and high quality data
CN117235026A (en) Log processing method and related device
CN114710334A (en) Access policy adjustment method and system for server
CN115455485A (en) Database access method, device, client and 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