CN115686888B - Rule-based disposal behavior flow arrangement method, device and application - Google Patents

Rule-based disposal behavior flow arrangement method, device and application Download PDF

Info

Publication number
CN115686888B
CN115686888B CN202211714595.8A CN202211714595A CN115686888B CN 115686888 B CN115686888 B CN 115686888B CN 202211714595 A CN202211714595 A CN 202211714595A CN 115686888 B CN115686888 B CN 115686888B
Authority
CN
China
Prior art keywords
handler
class
behavior
handling
abstraction
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
CN202211714595.8A
Other languages
Chinese (zh)
Other versions
CN115686888A (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.)
Zhejiang Chengyun Digital Technology Co ltd
Original Assignee
Zhejiang Chengyun Digital 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 Zhejiang Chengyun Digital Technology Co ltd filed Critical Zhejiang Chengyun Digital Technology Co ltd
Priority to CN202211714595.8A priority Critical patent/CN115686888B/en
Publication of CN115686888A publication Critical patent/CN115686888A/en
Application granted granted Critical
Publication of CN115686888B publication Critical patent/CN115686888B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The application provides a rule-based disposal behavior flow arrangement method, a device and an application, and the method comprises the following steps: acquiring handling behaviors of a plurality of associated cases, defining handler tags which correspond to the handling behaviors one by one, and constructing a handler parameter base class and handler parameter classes according to the handler tags, wherein each handler parameter class inherits the handler parameter base class; constructing a top-level handler abstraction class, the top-level handler abstraction class including a plurality of concrete handler abstraction classes, each concrete handler abstraction class including a plurality of handler implementation classes; and constructing a strategy factory, wherein the mapping relation of the handler label and the handler parameter class and the handler implementation class is defined to realize the corresponding handling behavior. The scheme can improve the expansibility of the interface and the handling behavior flow, realize high reusability of codes, improve the development expansion and realize the automatic execution of arranging a plurality of handling behaviors.

Description

Rule-based disposal behavior flow arrangement method, device and application
Technical Field
The present application relates to the field of computer software development, and in particular, to a method, an apparatus, and an application for arranging a procedure of a disposition behavior based on a rule.
Background
Case law enforcement procedures in urban management scenes are complex and changeable, cross-department cooperation is needed, a great amount of manpower and time are consumed for completing the procedure of one case completely, and in actual scenes, case error handling situations can occur when law enforcement personnel with insufficient business understanding or irregular operation exist, so that operations such as auditing, returning and the like of a responsibility department in the next link are caused, and the manpower resource consumption of one case is very serious. Therefore, the intellectualization of the case law enforcement process through the algorithm is an important way to reduce the human resource consumption and improve the user experience.
The case law enforcement process based on the city management scene has a plurality of links such as reporting, handling, dispatching departments, dispatching individuals, disposing, auditing, rechecking and handling, and each link corresponds to a plurality of disposing behaviors. For a user, according to local administrative laws and personnel responsibility conditions, a law enforcement process of a case is completed through mutual cooperation of a plurality of responsibility departments and law enforcement personnel; for research and development personnel, the case law enforcement process is customized according to local administrative laws and personnel responsibility conditions when a project is landed, and then customized development is carried out according to the actual case law enforcement process.
For research and development personnel, when research and development are performed on different disposal execution interfaces, front-end personnel and rear-end personnel need to jointly debug and butt joint disposal behavior interfaces one by one, and the interfaces cannot be unified, so that the research and development cost is increased; when a disposal behavior needs to be added, a new disposal behavior interface needs to be developed and joint debugging and butt joint are carried out again, and the disposal behavior interface has no expansibility; when the requirement of one handling behavior is changed, a large amount of time is consumed only by analyzing and identifying the influence of the modification on other modules in the whole situation, and each affected handling behavior interface needs to be modified correspondingly and is readjusted with the front end, which is caused by insufficient expansibility of the whole law enforcement process; when a dispatching department and a personal handling behavior are required to be dispatched and executed when a certain rule is met, a handling behavior interface meeting a specific requirement needs to be added, and automatic dispatching cannot be carried out.
In summary, it can be found that there are various problems in the current arrangement of the disposal behavior flow, such as non-uniform interfaces of different disposal behaviors, no expansibility of the disposal behavior interfaces, low code reusability of the law enforcement flow, poor expansibility, and incapability of arranging multiple disposal behaviors for automatic execution by the law enforcement processing flow.
Disclosure of Invention
The embodiment of the application provides a rule-based disposal behavior flow arrangement method, device and application, which can unify interfaces of a plurality of disposal behaviors, improve the expansibility of the interfaces and the disposal behavior flow, realize high reusability of codes, improve the expansion development property, and realize the automatic execution of the arrangement of the plurality of disposal behaviors.
In a first aspect, an embodiment of the present application provides a method for arranging a flow of treatment behaviors based on rules, where the method includes:
acquiring handling behaviors of a plurality of associated cases, defining handler tags which correspond to the handling behaviors one by one, and constructing a handling interface written with a generic parameter entry execution method, wherein each handling behavior accesses the same handling interface;
constructing a handler parameter base class and handler parameter classes according to the handling behaviors and the corresponding handler labels, wherein each handler parameter class inherits the handler parameter base class and defines a mapping relation between each handler label and the handler parameter class;
constructing a top-level handler abstract class, defining a service abstract method and an extended node by the top-level handler abstract class through a generic parameter entry execution method of a handling interface, and reserving the expansibility of the service abstract method and the extended node;
the top level handler abstraction class contains a plurality of concrete handler abstraction classes inheriting the top level handler abstraction class, a universal behavior template method of each type of handling behavior is defined in the concrete handler abstraction class, and the expansibility of the universal behavior template method is reserved;
constructing a plurality of handler implementation classes that inherit the concrete handler abstraction class, each of the handler implementation classes corresponding to a class of the handling behavior, defining a mapping relationship of each of the handler tags to the handler implementation classes, the handler implementation classes being invoked based on the handler tags of the handling behavior.
In a second aspect, an embodiment of the present application provides a device for scheduling a flow of treatment behaviors based on rules, including:
an acquisition module: acquiring handling behaviors of a plurality of associated cases, defining handler tags which correspond to the handling behaviors one by one, and constructing a handling interface written with a generic parameter entry execution method, wherein each handling behavior accesses the same handling interface;
a first building block: constructing a handler parameter base class and handler parameter classes according to the handling behaviors and the corresponding handler labels, wherein each handler parameter class inherits the handler parameter base class and defines a mapping relation between each handler label and the handler parameter class;
a second building block: constructing a top-level handler abstract class, defining a business abstract method and an extended node by the top-level handler abstract class through a generic parameter entry execution method of a handling interface, and reserving expansibility of the business abstract method and the extended node;
a definition module: the top level handler abstraction class contains a plurality of concrete handler abstraction classes inheriting the top level handler abstraction class, a universal behavior template method of each type of handling behavior is defined in the concrete handler abstraction class, and the expansibility of the universal behavior template method is reserved;
an execution module: constructing a plurality of handler implementation classes that inherit the concrete handler abstraction class, each of the handler implementation classes corresponding to a class of the handling behavior, defining a mapping relationship of each of the handler tags to the handler implementation classes, the handler implementation classes being invoked based on the handler tags of the handling behavior.
In a third aspect, an embodiment of the present application provides a method for extending a rule-based procedure of a treatment behavior, including:
when a complete handling flow is arranged and a new handling behavior needs to be expanded, defining a handler implementation class of the handling behavior, inheriting the handler implementation class to a concrete handler abstract class conforming to the general behavior of the handler implementation class, and realizing the service of the handling behavior by realizing and rewriting a general behavior template method defined in the concrete handler abstract class to complete the expansion of the new handling behavior.
In a fourth aspect, an embodiment of the present application provides an electronic apparatus, including a memory and a processor, where the memory stores a computer program, and the processor is configured to execute the computer program to perform a method for arranging a rule-based treatment behavior flow or a method for extending a rule-based treatment behavior flow.
In a fifth aspect, embodiments of the present application provide a readable storage medium having stored therein a computer program comprising program code for controlling a process to execute a process, the process comprising a method of rule-based treatment behavior flow orchestration or a method of extending a rule-based treatment behavior flow.
The main contributions and innovation points of the invention are as follows: the scheme adopts an interface generalization calling mode, and uniformly calls a plurality of disposal behavior interfaces through one inlet, so that the calling method is simplified, and a map structure is adopted to receive parameters, so that a user does not need to care about the definition of the entity interface of the participating class, and only needs to transmit the needed parameters; the method is characterized in that an abstract method of the handling behavior is defined in a top-level handler abstract class, then the abstract method is written in a general behavior template method form by a concrete handler abstract class, the expansibility of the abstract method is reserved, the abstract method can be directly expanded when a new abstract method or an existing abstract method is changed, the internal logic of the general behavior template method needs to be modified when the existing abstract method is changed, only a proper expansion point needs to be found for development when a new abstract method is added, the expansion is open, and the code reusability is high; according to the scheme, a label variable is defined in a top-level handler abstract class and used for accessing a handler label corresponding to each handling behavior, after the current handling behavior is executed, if the handler label of the next handling behavior is judged to exist in the label variable, the next handling behavior is automatically executed, and by analogy, a responsibility chain can be formed, so that a complex and variable law enforcement flow can be combined through the existing handling behaviors, and the automation completion can be realized.
The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more thorough understanding of the application.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a flow diagram of a method for rule-based treatment behavior flow orchestration according to an embodiment of the application;
FIG. 2 is a flow diagram illustrating a law enforcement procedure for a location according to an embodiment of the present application;
fig. 3 is a schematic diagram of unifying treatment behavior interfaces according to an embodiment of the present application;
FIG. 4 is a schematic flow chart diagram illustrating instantiation of a handler tag as a handler entry class by way of a generalized call in an embodiment of the present application;
FIG. 5 is a diagram illustrating the structure of a handler entry base class and a handler entry class containing parameters according to an embodiment of the present application;
FIG. 6 is a diagram illustrating the structure of a handler entry base class and a handler entry class according to an embodiment of the present application;
FIG. 7 is a schematic structural diagram of a top level handler abstract class in accordance with an embodiment of the present application;
FIG. 8 is a schematic diagram of a relationship between a top level handler abstract class and a concrete handler abstract class in accordance with an embodiment of the present application;
FIG. 9 is a block diagram of an execution handling apparatus based on rule orchestration according to an embodiment of the present application;
fig. 10 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings in which the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of one or more embodiments of the specification, as detailed in the claims which follow.
It should be noted that: in other embodiments, the steps of the corresponding methods are not necessarily performed in the order shown and described herein. In some other embodiments, the method may include more or fewer steps than those described herein. Moreover, a single step described in this specification may be broken down into multiple steps for description in other embodiments; multiple steps described in this specification may be combined into a single step in other embodiments.
Example one
An embodiment of the present application provides a method for arranging a treatment behavior flow based on rules, and with reference to fig. 1, the method includes:
acquiring handling behaviors of a plurality of associated cases, defining handler tags which correspond to the handling behaviors one by one, and constructing a handling interface written with a generic parameter entry execution method, wherein each handling behavior accesses the same handling interface;
constructing a handler parameter base class and handler parameter classes according to the handling behaviors and the corresponding handler labels, wherein each handler parameter class inherits the handler parameter base class and defines a mapping relation between each handler label and the handler parameter class;
constructing a top-level handler abstract class, defining a business abstract method and an extended node by the top-level handler abstract class through a generic parameter entry execution method of a handling interface, and reserving expansibility of the business abstract method and the extended node;
the top level handler abstraction class contains a plurality of concrete handler abstraction classes inheriting the top level handler abstraction class, a universal behavior template method of each type of handling behavior is defined in the concrete handler abstraction class, and the expansibility of the universal behavior template method is reserved;
constructing a plurality of handler implementation classes that inherit the concrete handler abstraction class, each of the handler implementation classes corresponding to a class of the handling behavior, defining a mapping relationship of each of the handler tags to the handler implementation classes, the handler implementation classes being invoked based on the handler tags of the handling behavior.
In some embodiments, the handler tag has uniqueness, and the handling interface employs a Map structure to receive parameters of a handling behavior.
Specifically, after the handling interface is changed into a generalized calling mode, all handling behavior interfaces can be unified into one interface request address, the calling mode is simplified, and in addition, the Map structure is adopted to receive parameters, so that the client does not need to concern about entity structure definition of the participating classes, and only needs to transmit the needed parameters.
In particular, unifying the interfaces of all the handling behaviors can avoid the problem that a plurality of handling interfaces need to be developed for different handling result customizations in a traditional mode.
In some embodiments, the law enforcement process in a certain place is divided into four handling behaviors of reporting, processing, auditing and committing, as shown in fig. 2, a tag is defined for each handling behavior, the tag of the reporting behavior is REPORT, the tag of the processing behavior is hand, the tag of the auditing behavior is CHECK, the tag of the committing behavior is CLOSE, and interfaces of the four handling behaviors are unified into an interface address "http (s)// ip: port/context/HANDLE", as shown in fig. 3.
Specifically, when the front end requests the handling interface, the corresponding tag access is transmitted.
Specifically, the generic parameter entry execution method parameterizes the type of the parameter, determines what specific type the parameter is when actually calling, and enables multiple different data types to execute the same code when using the generic parameter entry execution method, so that the code expansibility is stronger.
In some embodiments, the handler entry base class extracts common parameters of the handling behaviors, the common parameters include handler labels and case numbers of cases to which the current handling behaviors belong, each of the handler entry subclasses includes parameters specific to one type of handling behaviors, the handler entry base class has only one, and the number of the handler entry subclasses is the same as the number of the handling behaviors.
Specifically, the common parameter may be set according to the actual situation of the case except for including the handler tag and the case number of the case to which the current handling behavior belongs, and the scheme is not specifically limited herein.
Specifically, as shown in fig. 4, the participated handler tag is instantiated into the handler participatory class by means of a generalized call according to the common parameters in the handler participatory class.
In some embodiments, as shown in fig. 5, baseeventlhandlecmd is the handler entry base class, common parameters in the handler entry base class are tag (handler tag) and caseID (case number), reportCmd is a handler entry subclass of reporting behavior, a specific parameter thereof is reportAddr (address), handleCmd is a handler entry subclass of processing behavior, a specific parameter thereof is handleResult, checkCmd is a handler entry subclass of auditing behavior, a specific parameter thereof is checkResult, closeCmd is a handler entry subclass of handling behavior, and a specific parameter thereof is closeson (cause of solution).
Specifically, the handler entry subclass directly or indirectly inherits the handler entry base class, the handler entry subclass corresponding to each handling behavior may include a lower-dimensional handler entry subclass, and the lower-dimensional handler entry subclass inherits the higher-dimensional handler entry subclass, as shown in fig. 6, the handler entry subclass for reporting behavior includes a lower-dimensional handler entry subclass for AI reporting behavior and a handler entry subclass for mobile reporting behavior.
In some embodiments, the top level handler abstraction class defines handler execution flows according to the generic paramete execution method, the handler execution flows including pre-execution, business abstraction methods, and post-execution of execution handling behaviors, and preserving extensibility of each of the handler execution flow nodes.
In some embodiments, as shown in fig. 7, a top level handler abstraction class abstract eventhandler is defined, which defines the handler execution flow by implementing an execution method handle (T parameter) in the handle interface as: pre-execute beforeexecutive (), execute method executor (T parameter), post-execute afterexecutive (), in addition, the top level handler abstract class possesses private methods executprocessor () and clear () and holds EVENT _ CONTEXT and successor tag attributes.
Specifically, execute (T parameter) is a service abstraction method for executing a handling behavior, and before execution of the service abstraction method by the concrete handler abstraction class and after execution of the service abstraction method by the afterExecutor () are extension nodes, which are convenient for service extension, for example, preprocessing data by the before execution of the service abstraction method by the concrete handler abstraction class, and recording logs by the after execution of the service abstraction method by the concrete handler abstraction class. The contents of beforeExecutor () and afterExecutor () may be extended accordingly according to different service abstraction methods.
Specifically, EVENT _ CONTEXT is a Thread copy object for solving a data transfer problem between flow nodes in a primary handler execution flow, and Thread is a local variable of Thread.
Specifically, after the execution flow of the processor is finished, the abstract class of the top-level processor automatically calls a private method clear () to play resources, so that the waste of the resources is avoided.
Specifically, the sucessorag is a handler tag that is automatically executed, and is used to determine whether a next handling action needs to be automatically executed according to the handler tag after an execution flow of a handler is completed, so as to implement an automation function.
In some embodiments, a tag variable is defined in the top-level handler abstraction class, where the tag variable is used to access the handler tag, and after a service abstraction method defined in the top-level handler abstraction class is executed, it is determined whether a handler tag required for a next handling behavior exists in the tag variable, and if so, a corresponding handling behavior is executed according to the handler tag.
Specifically, after the current handling behavior is executed, if the label of the next handling behavior is determined to exist, the corresponding handling behavior is automatically executed, and by analogy, a responsibility chain can be formed to fulfill the purpose of arranging the handling behaviors, so that a plurality of handling behaviors of a case can be guaranteed to be orderly completed.
In some embodiments, in the "define a generic behavior template method for each type of handling behavior in the concrete handler abstraction class" step, the concrete handler abstraction class inherits a business abstraction method in the top level handler abstraction class and rewrites the business abstraction method in the top level handler abstraction class resulting in a generic behavior template method for a plurality of handling behaviors, the generic behavior template method comprising a common point for the plurality of handling behaviors.
Specifically, a common behavior template method for defining a plurality of handling behaviors can be realized by abstracting a common service to the common behavior template method among a plurality of handlers, the common behavior to be changed can be rewritten according to an extension point, and the service behavior specific to each handler can be realized according to the extension point.
In some embodiments, as shown in FIG. 8, concrete handler abstraction classes AbstractAccepHandler and AbstractProcessHandler are defined that inherit from the top level handler abstraction class AbstractEventHandler, which is characterized in that some share common points, but not completely common, for different handling behaviors in the handler execution flow, so that the common points for different handling behaviors are rewritten to a common behavior template by a business abstraction method.
For example, web-side reporting and AI reporting have common service logic such as operation records and attachment records, but since there are some service differences between reporting terminals, a concrete handler abstract class is used to define the common service logic of web-side reporting and AI reporting to obtain a concrete handler abstract class.
Take the handler abstract class abstract process handler in fig. 8 as an example:
the abstract processhandler is a flow handler abstract class, in which a service abstract method execute (T parameter) in the top-level handler abstract class abstract handler is rewritten, and common behaviors required by flow handling services are defined in the flow handler abstract class in a refined manner, which is specifically shown as follows:
1. common check (T parameter), which is the first execution method executed by the flow handler, is used for checking parameters and services. It is divided into three methods to be executed, which are respectively: check checkcheckcheckcheckweigher (T parameter), service justification checkcheckcheckcheckcheckweigy (T parameter), service checkcheckcheckbiz (T parameter). The checkParameter and checkLegality are implemented by a template method of the process handler abstract class, which provides general capability for the subclass handler. And checkBiz (T parameter) is an abstract method that is rewritten by subclasses for subclass handlers to handle behavior-specific traffic checks.
2. The service executeBiz (T parameter) is executed, rewritten by the subclass, for the subclass handler to implement the service capabilities specific to the class corresponding handling behavior.
3. And executing an operation record executeOperationRecord (T parameter), and realizing a flow handler abstract type template method, wherein the method is used for carrying out general operation log record on flow related law enforcement business.
4. And executing an attachment operation executeFileOperation (T parameter), and realizing a flow handler abstract class template method, wherein the method is used for executing attachment information record commonly used by flow related law enforcement business.
5. The method is realized by a workflow integration execluteflow (T parameter) execution method and a flow handler abstract type template method, and is used for completing nodes, allocating backlogs, setting flow parameters and other related operations of the integrated workflow commonly used by flow related law enforcement services.
6. The method is realized by executing a closing work executeContainingWork (T parameter) and a process handler abstract class template method, and is used for performing operations such as node state recording, case information updating and the like through node information returned by a workflow after executing completion workflow integration commonly used by process related law enforcement services.
7. Executing an extended service executeExtBiz (T parameter), and rewriting by subclasses, and when the flow handler abstract class template method cannot meet the service execution of specific handling behaviors, performing capability extension by rewriting the method.
8. The notification message notifyMsg () is realized by a process handler abstract type template method, and is used for sending a message notification after the execution of the process related law enforcement service is finished, so that the possible cross-service capability expansion is facilitated.
9. Executing a responsibility chain executeConscer (T paramter), rewriting by a subclass, integrating an algorithm platform or other business rules for a subclass handler according to the requirement of a specific business of the subclass handler, arranging a handling behavior needing intelligent circulation based on the result of the rules, and executing the responsibility chain by maintaining an attribute successorTag held in a top-level handler abstract class AbstractEventHandler.
In the scheme, a service abstraction method of an execution process is defined in a top-level handler abstraction class, then the service abstraction method in the execution process is realized by the concrete handler abstraction class, common points of a plurality of handling behaviors are written into a universal behavior template in the realization of the service abstraction method, and the expansibility of the universal behavior template is reserved and a new abstraction method extension point is designed, so that the purposes of rewriting the universal behavior and expanding the service abstraction method are achieved.
In some embodiments, in the step of "constructing a plurality of handler implementation classes that inherit the concrete handler abstraction class, each handler implementation class corresponding to a type of the handling behavior", the handler implementation class is extended according to extensibility of the concrete handler abstraction class, and at least one handling method corresponding to the handling behavior is defined in the handler implementation class.
In some specific embodiments, a concrete handler abstract class abstract handler is taken as an example, and includes three subclasses, namely, handleProcessHandler, checkProcessHandler and CloseProcessHandler, a handling behavior corresponding to the HandleProcessHandler is "processing", the handler is used in the HandleProcessHandler to implement a class rewriting abstract method, and the handling operation obtained by implementing the class through the handler is as follows:
1. the processing service checks checkBiz (T parameter), which performs checks specific to the processing operation, such as: and checking whether the case information is complete, whether the processing conditions are met, and the like.
2. The processing service executes executeBiz (T parameter) to perform a service specific to the processing operation, such as: recording processing departments, processing persons, processing time, processing on-site photos, processing results, and the like.
3. The responsibility chain executes executeConscer (T paramter) to perform intelligent scene integration, such as: integrating an automatic audit rule, acquiring whether an automatic audit condition is met through the rule, if so, arranging an audit handler CheckProcessHandler needing to be automatically executed by maintaining a successoRTag field in a parent AbstractEventHandler as 'CHECK', and realizing the service effect of automatically auditing after finishing processing operation when the rule is met.
The corresponding handling behavior of the CheckProcessHandler is 'audit', an abstract method is rewritten in the CheckProcessHandler by using the handler abstract class, and the obtained audit operation is as follows:
1. audit transaction check checkBiz (T parameter), which performs checks specific to the audit operation, such as: whether the person has audit authority, etc.
2. The audit service executes executeBiz (T parameter), and performs services specific to the audit operation, such as: and recording the auditing result, the auditing opinions, the auditing time and the like.
3. The responsibility chain executes executeExecutuceSesor (T paramter) to perform intelligent scene integration, such as: integrating automatic proposal settling rules, if the automatic proposal settling conditions are met, arranging a proposal handler CloseProcessHandler needing to be automatically executed by maintaining a successTag field in a parent AbstractEventHandler as 'CLOSE', and realizing the business effect of automatically settling the proposal after finishing the auditing operation when the rules are met.
The corresponding handling behavior of the CloseProcessHandler is 'end plan', and the handler abstract class is used for rewriting abstract methods in the CloseProcessHandler, so that the obtained end plan operation is as follows:
1. the end-to-end service checks checkcheckcheckbiz (T parameter), performs end-to-end operation specific checks, such as: whether the case information meets the case settlement standard, whether the person has the permission of case settlement, and the like.
2. The filing service executes executeBiz (T parameter) and performs services specific to the audit action, such as: record the reason for the settlement, etc.
3. A notification message notifyMsg () for carrying out the message notification after the settlement, such as: after the proposal is settled, APP message pushing or short messages are sent to the mobile terminal of the manager, and MQ messages are sent to facilitate the third party to acquire the notification across services to carry out service expansion.
Specifically, in addition to the two methods that must be implemented by the service check checkBiz and the service execution executeBiz, the service extension may be implemented by rewriting any method, for example, in the CloseProcessHandler, executeaoperationarrecord (T parameter) may be rewritten to change the original operation record logic, or execute extbox (T parameter) may be rewritten to implement some extensible services, such as statistics of the case outcome number, extensible services, and the like,
In some embodiments, a policy factory is defined that uses two Map structures to maintain a mapping of the handler tag to a handler entry class and a mapping of the handler tag to the handler implementation class, respectively, and saves the mappings to memory.
Specifically, the mapping relationship is stored in a memory so as to be called in real time.
In some embodiments, the mapping relationship may be maintained using two MAP structures of STRATGY _ HANDLER _ MAP and STRATGY _ PARAMETER _ MAP, and the following four methods are provided for mapping:
1.addStrategy(String tag, AbstractEventHandler<
Figure 252431DEST_PATH_IMAGE001
> handler, Class<
Figure 116482DEST_PATH_IMAGE002
extends BaseEventHandleCmd>parameterClz, borolean isooverride), new strategy mapping method. In the case of newly added services orIn the case of service change, the handler entry corresponding to the handler Tag and the handler implementation class need to be replaced or newly added, so in the handler policy factory, a method for increasing the mapping relationship needs to be provided, and it is determined whether to overwrite the original mapping relationship when the handler Tag exists according to the fact or false of the iso override parameter in the entry.
getStrategHandler (String Tag), which gets the method of the corresponding handler through the handler Tag.
Parameter (String Tag, map parameter Map), get the corresponding handler entry class through handler Tag and resolve the method of generalized call entry parameter Map.
Execute (String tag, map parameter Map), policy execution method, which calls getStrategHandler (String tag) and parseParameter (String tag, map parameter Map) method to get the specific handler mapped by handler tag and the join parameter of the handler, and executes the handler (T parameter) method of the handler interface EventHandler realized by the policy execution method to complete the execution of the law enforcement flow.
In some embodiments, when a caller passes in a handler tag, the handler policy factory calls a corresponding handler enlistment subclass and a handler implementation class according to the handler tag, enlisting using the handler enlistment subclass to perform a corresponding handling behavior.
When a new handling behavior needs to be added, a method for expanding the flow of the handling behavior based on the rule is adopted, and the steps are as follows:
when a complete handling flow is organized and a new handling behavior needs to be expanded, defining a handler implementation class of the handling behavior, inheriting the handler implementation class to a concrete handler abstract class conforming to the general behavior of the handler implementation class, realizing the service of the handling behavior by realizing and rewriting a general behavior template method defined in the concrete handler abstract class, and completing the expansion of the new handling behavior.
Example two
Based on the same concept, referring to fig. 9, the present application further proposes a rule-based disposition behavior flow arrangement device, including:
an acquisition module: acquiring handling behaviors of a plurality of associated cases, defining handler tags which correspond to the handling behaviors one by one, and constructing a handling interface written with a generic parameter entry execution method, wherein each handling behavior accesses the same handling interface;
a first building block: constructing a handler parameter base class and handler parameter classes according to the handling behaviors and the corresponding handler labels, wherein each handler parameter class inherits the handler parameter base class and defines a mapping relation between each handler label and the handler parameter class;
a second building block: constructing a top-level handler abstract class, defining a business abstract method and an extended node by the top-level handler abstract class through a generic parameter entry execution method of a handling interface, and reserving expansibility of the business abstract method and the extended node;
a definition module: the top level handler abstraction class contains a plurality of concrete handler abstraction classes inheriting the top level handler abstraction class, a universal behavior template method of each type of handling behavior is defined in the concrete handler abstraction class, and the expansibility of the universal behavior template method is reserved;
an execution module: constructing a plurality of handler implementation classes that inherit the concrete handler abstraction class, each of the handler implementation classes corresponding to a class of the handling behavior, defining a mapping relationship of each of the handler tags to the handler implementation classes, the handler implementation classes being invoked based on the handler tags of the handling behavior.
EXAMPLE III
The present embodiment also provides an electronic device, referring to fig. 10, comprising a memory 404 and a processor 402, wherein the memory 404 stores a computer program, and the processor 402 is configured to execute the computer program to perform the steps in any of the above method embodiments.
Specifically, the processor 402 may include a Central Processing Unit (CPU), or A Specific Integrated Circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
Memory 404 may include, among other things, mass storage 404 for data or instructions. By way of example, and not limitation, memory 404 may include a hard disk drive (hard disk drive, HDD for short), a floppy disk drive, a solid state drive (SSD for short), flash memory, an optical disk, a magneto-optical disk, tape, or a Universal Serial Bus (USB) drive or a combination of two or more of these. Memory 404 may include removable or non-removable (or fixed) media, where appropriate. The memory 404 may be internal or external to the data processing apparatus, where appropriate. In a particular embodiment, the memory 404 is a Non-Volatile (Non-Volatile) memory. In particular embodiments, memory 404 includes Read-only memory (ROM) and Random Access Memory (RAM). The ROM may be mask-programmed ROM, programmable ROM (PROM), erasable PROM (EPROM), electrically Erasable PROM (EEPROM), electrically rewritable ROM (EAROM), or FLASH memory (FLASH), or a combination of two or more of these, where appropriate. The RAM may be a static random-access memory (SRAM) or a dynamic random-access memory (DRAM), where the DRAM may be a fast page mode dynamic random-access memory 404 (FPMDRAM), an extended data output dynamic random-access memory (EDODRAM), a synchronous dynamic random-access memory (SDRAM), or the like.
Memory 404 may be used to store or cache various data files needed for processing and/or communication purposes, as well as possibly computer program instructions executed by processor 402.
The processor 402 may implement any of the above-described embodiments of the rule orchestration based execution handling methods by reading and executing computer program instructions stored in the memory 404.
Optionally, the electronic apparatus may further include a transmission device 406 and an input/output device 408, where the transmission device 406 is connected to the processor 402, and the input/output device 408 is connected to the processor 402.
The transmitting device 406 may be used to receive or transmit data via a network. Specific examples of the network described above may include wired or wireless networks provided by communication providers of the electronic devices. In one example, the transmission device includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmitting device 406 may be a Radio Frequency (RF) module configured to communicate with the internet via wireless.
The input and output devices 408 are used to input or output information. In the present embodiment, the input information may be various treatment behaviors, treatment parameters, and the like, and the output information may be treatment results of the treatment behaviors, and the like.
Alternatively, in this embodiment, the processor 402 may be configured to execute the following steps by a computer program:
s101, acquiring handling behaviors of a plurality of associated cases, defining handler tags corresponding to the handling behaviors one by one, and constructing a handling interface written with a generic parameter entry execution method, wherein each handling behavior accesses the same handling interface;
s102, constructing a handler parameter base class and handler parameter classes according to the handling behaviors and the corresponding handler labels, wherein each handler parameter class inherits the handler parameter base class and defines a mapping relation between each handler label and the handler parameter class;
s103, constructing a top-level handler abstract class, defining a service abstract method and an extended node by the top-level handler abstract class through a generic reference execution method of a handling interface, and reserving the expansibility of the service abstract method and the extended node;
s104, the top level handler abstract class comprises a plurality of concrete handler abstract classes inheriting the top level handler abstract class, a universal behavior template method of each type of handling behaviors is defined in the concrete handler abstract class, and the expansibility of the universal behavior template method is reserved;
s105, constructing a plurality of handler implementation classes inheriting concrete handler abstract classes, wherein each handler implementation class corresponds to one type of the handling behaviors, a mapping relation between each handler tag and each handler implementation class is defined, and the handler implementation classes are called based on the handler tags of the handling behaviors.
It should be noted that, for specific examples in this embodiment, reference may be made to examples described in the foregoing embodiments and optional implementations, and details of this embodiment are not described herein again.
In general, the various embodiments may be implemented in hardware or special purpose circuits, software, logic or any combination thereof. Some aspects of the invention may be implemented in hardware, while other aspects may be implemented in firmware or software which may be executed by a controller, microprocessor or other computing device, although the invention is not limited thereto. While various aspects of the invention may be illustrated and described as block diagrams, flow charts, or using some other pictorial representation, it is well understood that these blocks, apparatus, systems, techniques or methods described herein may be implemented in, as non-limiting examples, hardware, software, firmware, special purpose circuits or logic, general purpose hardware or controller or other computing devices, or some combination thereof.
Embodiments of the invention may be implemented by computer software executable by a data processor of the mobile device, such as in a processor entity, or by hardware, or by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets and/or macros can be stored in any device-readable data storage medium and they include program instructions for performing particular tasks. The computer program product may comprise one or more computer-executable components configured to perform embodiments when the program is run. The one or more computer-executable components may be at least one software code or a portion thereof. Further in this regard it should be noted that any block of the logic flow as in figure 10 may represent a program step, or an interconnected logic circuit, block and function, or a combination of a program step and a logic circuit, block and function. The software may be stored on physical media such as memory chips or memory blocks implemented within the processor, magnetic media such as hard or floppy disks, and optical media such as, for example, DVDs and data variants thereof, CDs. The physical medium is a non-transitory medium.
It should be understood by those skilled in the art that various features of the above embodiments can be combined arbitrarily, and for the sake of brevity, all possible combinations of the features in the above embodiments are not described, but should be considered as within the scope of the present disclosure as long as there is no contradiction between the combinations of the features.
The above examples are merely illustrative of several embodiments of the present application, and the description is more specific and detailed, but not to be construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (12)

1. A method for arranging a disposal behavior flow based on rules is characterized by comprising the following steps:
acquiring handling behaviors of a plurality of associated cases, defining handler tags which correspond to the handling behaviors one by one, and constructing a handling interface written with a generic parameter entry execution method, wherein each handling behavior accesses the same handling interface;
constructing a handler parameter base class and handler parameter classes according to the handling behaviors and the corresponding handler labels, wherein each handler parameter class inherits the handler parameter base class and defines a mapping relation between each handler label and the handler parameter class;
constructing a top-level handler abstract class, defining a business abstract method and an extended node by the top-level handler abstract class through a generic parameter entry execution method of a handling interface, and reserving expansibility of the business abstract method and the extended node;
the top level handler abstraction class contains a plurality of concrete handler abstraction classes inheriting the top level handler abstraction class, a universal behavior template method of each type of handling behavior is defined in the concrete handler abstraction class, and the expansibility of the universal behavior template method is reserved;
constructing a plurality of handler implementation classes that inherit the concrete handler abstraction class, each of the handler implementation classes corresponding to a class of the handling behavior, defining a mapping relationship of each of the handler tags to the handler implementation classes, the handler implementation classes being invoked based on the handler tags of the handling behavior.
2. The method as claimed in claim 1, wherein the handler tag is unique, and the handling interface adopts a Map structure to receive parameters of a handling behavior.
3. The method as claimed in claim 1, wherein the handler entry base class extracts common parameters of the handling behaviors, the common parameters include handler labels and case numbers of cases to which the current handling behaviors belong, each of the handler entry classes includes parameters specific to a type of handling behaviors, the number of the handler entry classes is the same as the number of the handling behaviors, and there is only one of the handler entry base classes.
4. The method as claimed in claim 1, wherein the top level handler abstract class defines a handler execution flow according to the generic join execution method, the handler execution flow includes a pre-execution, a business abstract method and a post-execution of a handler behavior, and the extensibility of each of the handler execution flow nodes is reserved.
5. The method as claimed in claim 1, wherein a tag variable is defined in the top-level handler abstraction class, the tag variable is used to access the handler tag, when a business abstraction method defined in the top-level handler abstraction class is executed, it is determined whether a handler tag required for a next handling behavior exists in the tag variable, and if so, a corresponding handling behavior is executed according to the handler tag.
6. The method for rule-based process behavior flow orchestration according to claim 1, wherein in the step of "universal behavior template method for defining each type of process behavior in the concrete handler abstraction class", the concrete handler abstraction class inherits the business abstraction methods in the top-level handler abstraction class, and rewrites the business abstraction methods in the top-level handler abstraction class to obtain a universal behavior template method for a plurality of process behaviors, the universal behavior template method comprising a common point of the plurality of process behaviors.
7. The method as claimed in claim 1, wherein in the step of "constructing multiple handler implementation classes that inherit specific handler abstract classes, each handler implementation class corresponding to a type of the handling behavior", the handler implementation classes are extended according to extensibility of the specific handler abstract classes, and at least one handling method corresponding to the handling behavior is defined in the handler implementation classes.
8. The method as claimed in claim 1, wherein a handler policy factory is defined, and the handler policy factory uses two Map structures to maintain the mapping relationship between the handler tag and the handler entry class and the mapping relationship between the handler tag and the handler implementation class, respectively, and stores the mapping relationships in the memory.
9. A method of extending a rule-based flow of treatment behavior, comprising:
when a rule-based disposal behavior flow orchestration method according to claims 1-8 requires the extension of a new disposal behavior, defining a handler implementation class for the disposal behavior, inheriting the handler implementation class to a concrete handler abstraction class that conforms to its general behavior, implementing the handling behavior's business by implementing and rewriting a general behavior template method defined in the concrete handler abstraction class, completing the extension of the new disposal behavior.
10. An apparatus for rule-based process behavior flow orchestration, comprising:
an acquisition module: acquiring handling behaviors of a plurality of associated cases, defining handler tags which correspond to the handling behaviors one by one, and constructing a handling interface written with a generic parameter entry execution method, wherein each handling behavior accesses the same handling interface;
a first building block: constructing a handler parameter base class and handler parameter classes according to the handling behaviors and the corresponding handler labels, wherein each handler parameter class inherits the handler parameter base class and defines a mapping relation between each handler label and the handler parameter class;
a second building block: constructing a top-level handler abstract class, defining a business abstract method and an extended node by the top-level handler abstract class through a generic parameter entry execution method of a handling interface, and reserving expansibility of the business abstract method and the extended node;
a definition module: the top level handler abstraction class contains a plurality of concrete handler abstraction classes inheriting the top level handler abstraction class, a universal behavior template method of each type of handling behavior is defined in the concrete handler abstraction class, and the expansibility of the universal behavior template method is reserved;
an execution module: constructing a plurality of handler implementation classes that inherit the concrete handler abstraction class, each of the handler implementation classes corresponding to a class of the handling behavior, defining a mapping relationship of each of the handler tags to the handler implementation classes, the handler implementation classes being invoked based on the handler tags of the handling behavior.
11. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the computer program to perform a method of orchestrating a rule-based procedure of treatment behavior according to any one of claims 1-8 or a method of extending a rule-based procedure of treatment behavior according to claim 9.
12. A readable storage medium having stored thereon a computer program comprising program code for controlling a process to execute a process, the process comprising a method of rule-based treatment behavior flow orchestration according to any one of claims 1-8 or a method of extending a rule-based treatment behavior flow according to claim 9.
CN202211714595.8A 2022-12-30 2022-12-30 Rule-based disposal behavior flow arrangement method, device and application Active CN115686888B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211714595.8A CN115686888B (en) 2022-12-30 2022-12-30 Rule-based disposal behavior flow arrangement method, device and application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211714595.8A CN115686888B (en) 2022-12-30 2022-12-30 Rule-based disposal behavior flow arrangement method, device and application

Publications (2)

Publication Number Publication Date
CN115686888A CN115686888A (en) 2023-02-03
CN115686888B true CN115686888B (en) 2023-03-21

Family

ID=85057324

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211714595.8A Active CN115686888B (en) 2022-12-30 2022-12-30 Rule-based disposal behavior flow arrangement method, device and application

Country Status (1)

Country Link
CN (1) CN115686888B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1573688A (en) * 2003-06-10 2005-02-02 微软公司 Systems and methods for employing tagged types in a dynamic runtime environment
CN102523308A (en) * 2011-12-31 2012-06-27 北京新媒传信科技有限公司 Application development method and development and application platform system for operating method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8296730B2 (en) * 2008-03-12 2012-10-23 Microsoft Corporation Using extension methods to extend COM objects
CN108345691B (en) * 2018-03-15 2021-03-19 鼎富智能科技有限公司 Data source general processing framework construction method, data source processing method and device
CN115080274A (en) * 2022-07-08 2022-09-20 北京京东拓先科技有限公司 Service processing method, device and system and interface mapping system
CN115357312A (en) * 2022-08-29 2022-11-18 深圳前海环融联易信息科技服务有限公司 Method for entering into and binding service route

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1573688A (en) * 2003-06-10 2005-02-02 微软公司 Systems and methods for employing tagged types in a dynamic runtime environment
CN102523308A (en) * 2011-12-31 2012-06-27 北京新媒传信科技有限公司 Application development method and development and application platform system for operating method

Also Published As

Publication number Publication date
CN115686888A (en) 2023-02-03

Similar Documents

Publication Publication Date Title
US11037077B2 (en) Dynamically optimized distributed cloud computing-based business process management (BPM) system
US20200403998A1 (en) Descendent case role alias
US20200236129A1 (en) Systems and methods for vulnerability scorecard
US11941068B2 (en) Case leaf nodes pointing to business objects or document types
CN111949899B (en) Service integration method and service platform
US9043218B2 (en) Rule compliance using a configuration database
CN112035090A (en) Intelligent contract management system and method based on containerization technology
CN113794636A (en) Dynamic routing arrangement method and system based on Spring Cloud Gateway
Harzenetter et al. Pattern-based deployment models revisited: automated pattern-driven deployment configuration
CN109254765A (en) Timing task management method, apparatus, computer equipment and storage medium
CN115686888B (en) Rule-based disposal behavior flow arrangement method, device and application
US20240127379A1 (en) Generating actionable information from documents
CN106257482B (en) The control of data analysis result is placed
CN111131474A (en) Method, device and medium for managing user protocol based on block chain
CN116151631A (en) Service decision processing system, service decision processing method and device
US20040098294A1 (en) Adaptable resource model
CN110880099B (en) Workflow engine-based task event processing method, device, equipment and medium
CN114036577A (en) Coalition chain-oriented supervision method and supervision digital twin model
Lassoued et al. Modeling contextualized flexible cloud workflow services: an MDE based approach
US20230281054A1 (en) Computer System Execution Environment Builder Tool
Paul et al. The impact of SOA policy-based computing on C2 interoperation and computing
CN109145005B (en) Website system reconstruction method and device
Abdelhamid et al. A Novel Approach for Smart Contracts Using Blockchain
EP1510942A1 (en) Compatibility of tree-structured data
CN116010535A (en) Data information screening method and device, electronic equipment 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
GR01 Patent grant
GR01 Patent grant