CN109783071A - Government affairs rule design method and system based on Drools regulation engine - Google Patents

Government affairs rule design method and system based on Drools regulation engine Download PDF

Info

Publication number
CN109783071A
CN109783071A CN201910054574.XA CN201910054574A CN109783071A CN 109783071 A CN109783071 A CN 109783071A CN 201910054574 A CN201910054574 A CN 201910054574A CN 109783071 A CN109783071 A CN 109783071A
Authority
CN
China
Prior art keywords
rule
drools
service
business
regulation engine
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910054574.XA
Other languages
Chinese (zh)
Other versions
CN109783071B (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.)
Inspur Software Co Ltd
Original Assignee
Inspur Software Group 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 Inspur Software Group Co Ltd filed Critical Inspur Software Group Co Ltd
Priority to CN201910054574.XA priority Critical patent/CN109783071B/en
Publication of CN109783071A publication Critical patent/CN109783071A/en
Application granted granted Critical
Publication of CN109783071B publication Critical patent/CN109783071B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses government affairs rule design methods and system based on Drools regulation engine, belong to government affairs rule process field, technical problems to be solved are how to change development scheme traditional, with process form processing business logic, service logic is separated from application code, to realize unified management;Its method is included in the rule definition page and defines business rule, generates jar file packet corresponding with the business rule in exploitation environment;Service arrangement, service starting are carried out by Drools regulation engine, business rule publication is serviced at the restful that can be called.Its system includes regular definition unit, development block, Drools rules engine service device and rule base.The invention, which realizes, is managed collectively business rule, establishes central rule base, and support is externally provided in a manner of service.

Description

Government affairs rule design method and system based on Drools regulation engine
Technical field
The present invention relates to government affairs rule process fields, the government affairs rule design specifically based on Drools regulation engine Method and system.
Background technique
Government affairs rule refers to government department's business rule involved in transacting business process.Business rule refers to and business Relevant working specification, management article, rules and regulations, professional standard etc..It is said from information system angle, business rule is one fixed The statement of justice or limit service some aspects, is the section business logic in application program.Government affairs rule is multiple with service logic It is miscellaneous, quantity is more, variation it is frequent the features such as.
The processing mode of government department's government affairs rule is to be write service logic with process form processing business logic at present In application code, as the variation of service logic is more and more frequent and becoming increasingly complex of service logic, with traditional Mode is handled, it is necessary to be modified code by change by programmer, maintenance cost is relatively high, is unable to quick response service logic Variation.
Drools is the regulation engine of a open source, is an easily accessed business strategy, is easy to adjust and be easy to pipe The Business Rule Engine of reason.It completely realizes Rete algorithm, provides Eclipse Plugin development support, and realize use Natural language mode describes business rule, meets standard in the industry, speed is fast, high-efficient.
The advantages of how being based on Drools regulation engine, changes exploitation traditional, with process form processing business logic Mode separates service logic from application code, is the technical issues that need to address to realize unified management.
Summary of the invention
Technical assignment of the invention is against the above deficiency, to provide a kind of government affairs rule based on Drools regulation engine and set Method and system are counted, to solve to change development scheme traditional, with process form processing business logic, by service logic from answering It is separated in program code, the problem of to realize unified management.
In a first aspect, the embodiment of the present invention provides a kind of government affairs rule design method based on Drools regulation engine, packet It includes:
The page is defined in rule and defines business rule, and jar text corresponding with the business rule is generated in exploitation environment Part packet;
Service arrangement, service starting are carried out by Drools regulation engine, by business rule publication at can call Restful service.
In present embodiment, by Drools rules engines processes service logic, it is managed collectively service logic, realizes and establishes Central rule base externally provides the rule service cloud of restful supporting, and service logic is divided from application code From realizing unified management, be enable to respond quickly that government affairs rule is complicated, variation is fast, improves the flexibility of operation system, reduce industry The research and development cost of business system.
Preferably, the page is defined in rule and define business rule, comprising: define the page in rule and fill in rule encoding, rule Then title, business scope, the operation system, keyword description and rule description.
Preferably, jar file packet corresponding with the business rule is generated in exploitation environment, comprising: in exploitation environment In integrate Drools regulation engine provide exploitation plug-in unit;Entity is write by the linguistic norm of Drools in exploitation plug-in unit Java class and business rule drl file, and modify pom.xml file;Maven install order is run to generate and the business The corresponding jar file packet of rule.
Preferably, address is taken by configuring Drools private in exploitation environment obtain exploitation plug-in unit, the exploitation plug-in unit Plug-in unit is developed for Eclipse.
Preferably, service arrangement is carried out by regulation engine, comprising: by the corresponding groupId of jar file packet, ArtifactId, version, rule container and rule template are encapsulated according to the requirement of Drools rules engine service deployment interface At XML format;Drools rules engine service deployment interface is called to carry out service arrangement.
In the preferred embodiment, groupId is the coding of operation system belonging to the rule, and artifactId is rule Coding, version is version.
Preferably, service starting is carried out by Drools regulation engine, comprising: with the corresponding rule container of jar file packet It is parameter with rule template, Drools rules engine service deployment interface is called to carry out service starting.
Preferably, after carrying out service arrangement, service starting by Drools regulation engine, with the corresponding rule of jar file packet Then container and rule template are parameter, and Drools rules engine service deployment interface is called to carry out service stopping.
More preferably, before the rule definition page defines business rule, regular combing is carried out to business rule, comprising: logical It crosses knowledge induction or reversed code generation method combs business rule, form the rule declaration document of word form.
In this more preferably embodiment, the rule declaration document of word form is combed and formed to business rule, Business rule data are stored in rule base, situation complicated suitable for service logic, more than quantity.
More preferably, after the rule definition page defines business rule, pass through the script write in exploitation environment to fixed The business rule of justice is tested.
In this more preferably embodiment, the rule of definition is tested, the rule state that test passes through is set to survey It pinged, and tested unacceptable rule state and be set to and do not pass through, improved work efficiency.
Second aspect, the embodiment of the present invention provide a kind of government affairs rule designing system based on Drools regulation engine, lead to The government affairs rule design method based on Drools regulation engine for crossing first aspect carries out regular design, comprising: rule definition is single Member configures regular definition interfaces, for carrying out regular combing and rule definition;Development block, it is single with rule definition Member carries out data interaction, for testing the business rule after definition, and it is corresponding with the business rule for generating Jar file packet;Drools rules engine service device carries out data interaction with development block, for drawing by Drools rule It holds up and carries out service arrangement, service starting, business rule publication is serviced at the restful that can be called;Rule base, for storing industry Business rule.
Government affairs rule design method and system based on Drools regulation engine of the invention has the advantage that
1, it realizes and is managed collectively business rule, establish central rule base, and externally provide branch in a manner of service Support;
2, document is combed and formed to business rule, needs rule is shared to provide technical support to be subsequent.
Detailed description of the invention
It, below will be to required in being described in embodiment in order to more clearly illustrate the technical solution in the embodiment of the present invention The attached drawing used is briefly introduced, it should be apparent that, drawings in the following description are only some embodiments of the invention, for For those skilled in the art, without creative efforts, it can also be obtained according to these attached drawings His attached drawing.
The following further describes the present invention with reference to the drawings.
Attached drawing 1 is government affairs rule design method flow diagram of the embodiment 1 based on Drools regulation engine;
Attached drawing 2 is flow diagram after embodiment 1 is improved based on the government affairs rule design method of Drools regulation engine;
Attached drawing 3 is flow chart element after embodiment 1 is further improved based on the government affairs rule design method of Drools regulation engine Figure.
Specific embodiment
The present invention will be further explained below with reference to the attached drawings and specific examples, so that those skilled in the art can be with It more fully understands the present invention and can be practiced, but illustrated embodiment is not as a limitation of the invention, the case where not conflicting Under, the technical characteristic in the embodiment of the present invention and embodiment can be combined with each other.
The embodiment of the present invention provides a kind of government affairs rule design method and system based on Drools regulation engine, for solving Certainly change development scheme traditional, with process form processing business logic, service logic separated from application code, The problem of to realize unified management.
Embodiment 1:
As shown in Fig. 1, the government affairs rule design method of the invention based on Drools regulation engine, including walk as follows It is rapid:
Step S100, the page is defined in rule and define business rule, generate and the business rule pair in exploitation environment The jar file packet answered;
Step S200, service arrangement, service starting are carried out by Drools regulation engine, business rule is issued at adjustable Restful service.
Wherein, in step S100, the method that the page defines business rule is defined in rule are as follows: define the page in rule and fill in Rule encoding, rule name, business scope, the operation system, keyword description and rule description.
Jar file packet corresponding with the business rule is generated in exploitation environment, including as follows step by step:
(1), address being taken by configuring Drools private in exploitation environment and obtaining exploitation plug-in unit, which is Eclipse develops plug-in unit;
(2), entity java class and business rule drl file are write by the linguistic norm of Drools in exploitation plug-in unit, And modify pom.xml file;
(3) operation maven install order generates jar file packet corresponding with the business rule
Above-mentioned steps S100 is managed collectively service logic by Drools rules engines processes service logic, realizes and establishes Central rule base.
In the specific implementation process, address first can be taken by configuring Drools private in exploitation environment obtain Eclipse Plug-in unit is developed, then the page is defined in rule and fills in rule encoding, rule name, business scope, affiliated operation system, keyword Description and rule description.
In step S200, business rule is issued serviced at the restful that can be called as follows:
(1) rule step: by the corresponding groupId of jar file packet, artifactId, version, rule container and rule Then template is packaged into XML format according to the requirement of Drools rules engine service deployment interface, then, Drools rule is called to draw It holds up service deployment interface and carries out service arrangement, Drools rules engine service deployment interface is loaded with KieWebUtil.managerContainer () function;
(2) rule starting: using the corresponding rule container of jar file packet and rule template as parameter, then, Drools is called Rules engine service starting interface carries out service starting, after service starting, obtains business rule publication into the address of service, clothes The form of business is restful service, and Drools rules engine service starting interface is loaded with KieWebUtil.startStopCon () function;
(3) rule stops: using the corresponding rule container of jar file packet and rule template as parameter, then, calling Drools Rules engine service deployment interface carries out service stopping.
Business rule is externally provided to support in a manner of servicing step S200.
As shown in Fig. 2, as further improvement of this embodiment, before executing step S100, to business rule into Line discipline combing, specifically, combs business rule by knowledge induction or reversed code generation method, and word shape is formed The rule declaration document of formula.
In practical applications, the method for combing is not limited to using knowledge induction or reversed code generation method, it is possible to use Other methods are combed.The step is particularly suitable for the situation that service logic quantity is big, relationship is many and diverse.
As shown in Fig. 3, as the further improvement of the present embodiment, after executing step S100, after definition Business rule carries out regular testing, and the rule state that test passes through is set to test and is passed through, unacceptable rule state is tested and sets Not pass through, step S200 then is executed to the business rule that test passes through.
Existing common method is selected to be tested when test, as passed through the script write to definition in exploitation environment Business rule is tested.
Embodiment 2:
Government affairs rule designing system based on Drools regulation engine of the invention, including regular definition unit, exploitation list Member, Drools rules engine service device and rule base, the system can by disclosed in embodiment 1 based on Drools regulation engine Government affairs rule design method carries out regular design.
Wherein, regular definition interfaces are configured, for carrying out regular combing and rule definition.
Regular definition interfaces configure the regular definition page, by rule define the page fill in rule encoding, rule name, Business scope, the operation system, keyword description and rule description, the business rule after definition are stored into rule base. Meanwhile the rule definition interfaces are also configured with rule combing subelement, rule combing subelement be used for through knowledge induction or Reversed code generation method combs business rule, forms the rule declaration document of word form, and by rule declaration document It is stored into rule base.
Development block carries out data interaction with regular definition unit, for testing the business rule after definition, And for generating jar file packet corresponding with the business rule.
Configured with exploitation plug-in unit generation module in development block, obtained for taking address by configuring Drools private Eclipse develops plug-in unit.Eclipse develops plug-in unit and writes entity java class and business rule by the linguistic norm of Drools Drl file, and modify pom.xml file;It runs maven install order and generates jar text corresponding with the business rule Part packet.
Drools rules engine service device carries out data interaction with development block, for passing through Drools regulation engine Service arrangement, service starting are carried out, business rule publication is serviced at the restful that can be called.
In Drools rules engine service device configured with encapsulation subelement, Drools rules engine service deployment interface, Drools rules engine service starts interface, and encapsulation subelement is used for jar file packet corresponding groupId, artifactId, Version, rule container and rule template are packaged into XML format according to the requirement of Drools rules engine service deployment interface, KieWebUtil.managerContainer () function, Drools rule are loaded in Drools rules engine service deployment interface It then is loaded with KieWebUtil.startStopCon () function in engine service starting interface, in Drools rules engine service Using the corresponding rule container of jar file packet and rule template as parameter in device, the starting of Drools rules engine service can be called to connect Mouth carries out service starting and service stopping.
Embodiment described above is only to absolutely prove preferred embodiment that is of the invention and being lifted, protection model of the invention It encloses without being limited thereto.Those skilled in the art's made equivalent substitute or transformation on the basis of the present invention, in the present invention Protection scope within.Protection scope of the present invention is subject to claims.

Claims (10)

1. the government affairs rule design method based on Drools regulation engine, characterized by comprising:
The page is defined in rule and defines business rule, generates jar file packet corresponding with the business rule in exploitation environment;
Service arrangement, service starting are carried out by Drools regulation engine, business rule publication is taken at the restful that can be called Business.
2. the government affairs rule design method according to claim 1 based on Drools regulation engine, it is characterised in that advising It then defines the page and defines business rule, comprising:
Rule define the page fill in rule encoding, rule name, business scope, the operation system, keyword description and Rule description.
3. the government affairs rule design method according to claim 1 based on Drools regulation engine, it is characterised in that opening Jar file packet corresponding with the business rule is generated in hair ring border, comprising:
The exploitation plug-in unit that Drools regulation engine provides is integrated in exploitation environment;
Entity java class and business rule drl file are write by the linguistic norm of Drools in exploitation plug-in unit, and modified Pom.xml file;
It runs maven install order and generates jar file packet corresponding with the business rule.
4. the government affairs rule design method according to claim 3 based on Drools regulation engine, it is characterised in that opening Address is taken by configuring Drools private in hair ring border and obtains exploitation plug-in unit, and the exploitation plug-in unit is that Eclipse develops plug-in unit.
5. the government affairs rule design method according to claim 1 based on Drools regulation engine, it is characterised in that pass through Regulation engine carries out service arrangement, comprising:
By the corresponding groupId of jar file packet, artifactId, version, rule container and rule template are according to Drools The requirement of rules engine service deployment interface is packaged into XML format;
Drools rules engine service deployment interface is called to carry out service arrangement.
6. the government affairs rule design method according to claim 5 based on Drools regulation engine, it is characterised in that pass through Drools regulation engine carries out service starting, comprising:
Using the corresponding rule container of jar file packet and rule template as parameter, Drools rules engine service deployment interface is called The service of progress starting.
7. the government affairs rule design method according to claim 1-6 based on Drools regulation engine, feature It is after carrying out service arrangement, service starting by Drools regulation engine,
Using the corresponding rule container of jar file packet and rule template as parameter, Drools rules engine service deployment interface is called Carry out service stopping.
8. the government affairs rule design method according to claim 1-6 based on Drools regulation engine, feature It is before the rule definition page defines business rule, regular combing is carried out to business rule, comprising:
Business rule is combed by knowledge induction or reversed code generation method, forms the rule declaration text of word form Shelves.
9. according to claim 1-6 6 described in any item government affairs rules based on Drools regulation engine are set Meter method, it is characterised in that the script pair after the rule definition page defines business rule, in exploitation environment by writing The business rule of definition is tested.
10. the government affairs rule designing system based on Drools regulation engine, it is characterised in that pass through any one of such as claim 1-9 The government affairs rule design method based on Drools regulation engine carries out regular design, comprising:
Regular definition unit configures regular definition interfaces, for carrying out regular combing and rule definition;
Development block carries out data interaction with regular definition unit and is used in combination for testing the business rule after definition In generation jar file packet corresponding with the business rule;
Drools rules engine service device carries out data interaction with development block, for carrying out by Drools regulation engine Service arrangement, service starting service business rule publication at the restful that can be called;
Rule base, for storage service rule.
CN201910054574.XA 2019-01-21 2019-01-21 Drools rule engine-based government rule design method and system Active CN109783071B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910054574.XA CN109783071B (en) 2019-01-21 2019-01-21 Drools rule engine-based government rule design method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910054574.XA CN109783071B (en) 2019-01-21 2019-01-21 Drools rule engine-based government rule design method and system

Publications (2)

Publication Number Publication Date
CN109783071A true CN109783071A (en) 2019-05-21
CN109783071B CN109783071B (en) 2022-03-29

Family

ID=66501806

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910054574.XA Active CN109783071B (en) 2019-01-21 2019-01-21 Drools rule engine-based government rule design method and system

Country Status (1)

Country Link
CN (1) CN109783071B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110349663A (en) * 2019-06-10 2019-10-18 武汉大学 A kind of coronary cardiopathy rehabilitation scheme automatic generation method and system based on Drools
CN110647546A (en) * 2019-09-18 2020-01-03 北京明略软件系统有限公司 Third-party rule engine generation method and device
CN110990586A (en) * 2019-12-02 2020-04-10 浪潮软件股份有限公司 Method and device for acquiring map data
CN111078263A (en) * 2019-12-13 2020-04-28 深圳市随手科技有限公司 Hot deployment method, system, server and storage medium based on Drools rule engine
CN111427789A (en) * 2020-03-26 2020-07-17 平安医疗健康管理股份有限公司 Method, apparatus, computer device and storage medium for automatically verifying rules
CN112882687A (en) * 2020-12-10 2021-06-01 宝付网络科技(上海)有限公司 Method for realizing efficient universal rule engine
US11989661B1 (en) * 2023-07-24 2024-05-21 Morgan Stanley Services Group Inc. Dynamic rules for rules engines

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140122396A1 (en) * 2012-10-29 2014-05-01 Qualcomm Incorporated Rules engine as a platform for mobile applications
CN106254423A (en) * 2016-07-20 2016-12-21 普元信息技术股份有限公司 The method realizing Restful service release quickly based on micro services framework
CN107133039A (en) * 2017-04-28 2017-09-05 九次方大数据信息集团有限公司 The construction method and device of regulation engine
CN107632842A (en) * 2017-09-26 2018-01-26 携程旅游信息技术(上海)有限公司 Rule configuration and dissemination method, system, equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140122396A1 (en) * 2012-10-29 2014-05-01 Qualcomm Incorporated Rules engine as a platform for mobile applications
CN106254423A (en) * 2016-07-20 2016-12-21 普元信息技术股份有限公司 The method realizing Restful service release quickly based on micro services framework
CN107133039A (en) * 2017-04-28 2017-09-05 九次方大数据信息集团有限公司 The construction method and device of regulation engine
CN107632842A (en) * 2017-09-26 2018-01-26 携程旅游信息技术(上海)有限公司 Rule configuration and dissemination method, system, equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
HUXIANGEN: ""spring+maven整合Drools规则引擎详解"", 《CSDN》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110349663A (en) * 2019-06-10 2019-10-18 武汉大学 A kind of coronary cardiopathy rehabilitation scheme automatic generation method and system based on Drools
CN110647546A (en) * 2019-09-18 2020-01-03 北京明略软件系统有限公司 Third-party rule engine generation method and device
CN110990586A (en) * 2019-12-02 2020-04-10 浪潮软件股份有限公司 Method and device for acquiring map data
CN111078263A (en) * 2019-12-13 2020-04-28 深圳市随手科技有限公司 Hot deployment method, system, server and storage medium based on Drools rule engine
CN111427789A (en) * 2020-03-26 2020-07-17 平安医疗健康管理股份有限公司 Method, apparatus, computer device and storage medium for automatically verifying rules
CN112882687A (en) * 2020-12-10 2021-06-01 宝付网络科技(上海)有限公司 Method for realizing efficient universal rule engine
US11989661B1 (en) * 2023-07-24 2024-05-21 Morgan Stanley Services Group Inc. Dynamic rules for rules engines

Also Published As

Publication number Publication date
CN109783071B (en) 2022-03-29

Similar Documents

Publication Publication Date Title
CN109783071A (en) Government affairs rule design method and system based on Drools regulation engine
CN110825362B (en) Low-code application software development system and method
CN109597661B (en) Service function configuration method and device
US10235265B2 (en) Sequentially constructive model of computation
US7975233B2 (en) Automatic conversion of a textual language into a graphical program representation
US8478967B2 (en) Automatically creating parallel iterative program code in a data flow program
US8510709B2 (en) Graphical indicator which specifies parallelization of iterative program code in a graphical data flow program
US8448155B2 (en) Automatically creating parallel iterative program code in a graphical data flow program
CN102298607B (en) The schema contract of data integration
US9733914B2 (en) Loop parallelization analyzer for data flow programs
US20080022264A1 (en) Automatic Conversion of Text-Based Code Having Function Overloading and Dynamic Types into a Graphical Program for Compiled Execution
AU2016216574A1 (en) Policy enforcement in cloud-platform infrastructure layouts
CN108345531A (en) A kind of test method, apparatus and system
CN106598556A (en) User interface generation method and device
Rademacher et al. Towards a UML profile for domain-driven design of microservice architectures
CN102999320A (en) Automatic test case generation method and system
CA2994420C (en) Data processing graph compilation
CN108282518A (en) A kind of customer terminal webpage generation method and device
CN114035805A (en) Code conversion method, apparatus, medium, and device for pre-compiler
CN102402455A (en) Method and device for calling dynamic link library (DLL)
CN107894886B (en) A kind of method, apparatus and terminal device running code
US9946668B1 (en) Automatic prioritization of interrupts in a modeling environment
KR20130068601A (en) Apparatus and method for dynamic customization and execution of query based software logic for multitenant
Märtin et al. Patterns and models for automated user interface construction–in search of the missing links
EP2488948A2 (en) Maintaining data integrity across execution environments

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
TA01 Transfer of patent application right

Effective date of registration: 20220309

Address after: 271000 Langchao science and Technology Park, 527 Dongyue street, Tai'an City, Shandong Province

Applicant after: INSPUR SOFTWARE Co.,Ltd.

Address before: 250100 Ji'nan hi tech Zone No. 2877, Shandong Province

Applicant before: INSPUR GROUP Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant