1. Download the following two files on the website http://www.drools.org/download/download.html
Drools-distribution-6.2.0.final.zip
Droolsjbpm-tools-distribution-6.2.0.final.zip
2. Install Eclipse plugin
Unzip the Droolsjbpm-tools-distribution-6.2.0.final.zip and set its directory
The jar file under \binaries\org.drools.updatesite\plugins is copied to the plugins directory of the Eclipse installation directory, open Eclipse,window->preferences,
①: First of all, please open the link http://download.jboss.org/drools/release/5.5.0.Final/Two files in a red box in the Download box650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/74/6C/wKiom1YctYGCyPZbAAKx5PZo2_I348.jpg "title=" Untitled. png "alt=" wkiom1yctygcypzbaakx5pzo2_i348.jpg "style=" float:left; "/>②: Unzip it separately as shown650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/74/6C/wKiom1YctrvTR1OkAADpA2wD6Fw740.jpg "t
1, the basic matching rules
1.1 Variables
Drools uses the matching method to compare the fact,
such as Java code account:account (Balance > 100)
The meaning of this rule is to find all account instances with the type account in fact and the balance property value greater than 100.
You can specify a variable to describe a type or a property that maps a class.
For example, Java code $account: Account ($type: type)
Use $variable to define a variable, whe
1. Download the following two zip packages from the official website. Http://www.drools.org/download/download.html
Drools-distribution-6.2.0.final.zip
Droolsjbpm-tools-distribution-6.2.0.final.zip
2. Install Eclipse Plugin
1. Unzip the Droolsjbpm-tools-distribution-6.2.0.final.zip
2. Create the folder Drools under the Dropins package in the installation directory of Eclipse, Droolsjbpm-tools-distribu
Little brother here to talk about his drools in combat in the end how to use the view:
First, if the rules are written by developers, such as programming DRL files, in this case, you can play the rules into a jar package, deployed to Workbench, or kie-server;
Second, if the rules are configurable, so that the business staff to configure, do not require the participation of developers, you can save the rules in the form of a string to the database;
Business rules are like this (no real meaning, just do demo demo)If the total number of days of absence is equal to 3 days, general manager approval is required, otherwise the general manager approval is not requiredIf the time of absence is less than 3 days, the total number of days leave is equal to the number of days of leave +2Otherwise, the total number of days leave is equal to the number of times to leave +5The calculation logic of the total number of leave is given to
In general, when using drools in Eclipse, when the following error occurs, many online solutions are added to a org.eclipse.jdt.core_3.5.2.v_981_ R35x.jar package, in fact, is not, the following error is mainly the lack of Java dialect parsing class org.drools.rule.builder.dialect.java.JavaDialectConfiguration, using a drools plug-in packaged jar OK, p OM is:
Error exception information encountered:Exceptio
Installation environment has, the following start to do the first example.
Create a new Drools project that will generate a Hello World example when you create it. I looked at this example and didn't look much. Find a more complicated example from the Internet. The concrete contents of the example go to see for themselves. The following is mainly about the problems encountered in doing this example.
Directory structure of the
When using Drools, the rules file contains the classes in the import jar package as follows:
Import Java.util.Map;Import Com.alibaba.fastjson.JSONObject;
Will error Java.lang.RuntimeException:wrong class format
Workaround: ORG.ECLIPSE.JDT jar package may not exist or have a low version
Can be added in the Maven Pom
Successfully resolvedAbout Jdt.core version reference: Http://mvnrepository.com/artifact/org.eclipse.jdt/org.eclipse.jdt.core
The first step:Download Drools Control jar PackageDownload Address: http://www.drools.org/download/download.htmlDownload the two zip in the image below
Step Two:Unzip the downloaded zip to the current directory.
Step Three:Droolsjbpm-tools-distribution-7.0.0.final\binaries\org.drools.updatesite\ Plugins copy all the jar packages in this directory into the plugins directory of your Eclipse installation directory
Fourth Step:Then go to eclipse and op
Drools a lot of information on the Internet, here for their contact understanding and practical application of the following summary,
Engineering introduced.Engineering Pom.xml, at least join
From the official website of the package, for example: Drools-distribution-6.5.0.final, from the binaries directory, the general need to manually introduce Third-party packages:
Ant-1.8.3.jar
Core-3.1.1.jar
Ecj-4.4.2.
Drools Official website: http://www.jboss.org/droolsDrools and JBPM consist out of several projects: (Drools package provides several parts of the functionality)Drools Guvnor (Business Rules manager) ( rule set manager)Drools Expert ( Rule engine )JBPM 5 (Process/workflow) (
types.We agreed that the 2 inputs of the betanodes are called left and right. The left input of a betanode is usually a list of objects. In Drools, this is an array. The right input is a single object. Two notnode can complete the ' exists ' check. Drools extends the rete algorithm by applying an index to the betanodes. Shows the use of a joinnode:Notice that the left input in the diagram uses a leftinputa
queue. Therefore, a "dynamic" rule execution chain is formed, which forms the inference mechanism of the rule. The "chained" response to this rule is entirely driven by data in the workspace.
The efficiency of rule condition matching determines the performance of the engine, the engine needs to quickly test the data objects in the workspace, discover the rules that match the rules from the loaded rule s
rules. The "chained" response to this rule is entirely driven by data in the workspace.The efficiency of the rule condition matching determines the performance of the engine, the engine needs to quickly test the data objects in the workspace, find the eligible rules from the loaded rule set, and generate the rule execution instance. Charles L. Forgy of the University of Carnegie Mellon, USA, in 1982, inven
executing the rule and other actions.
the inference (rule) engine of RBEs corresponds to human thinking. The rule engine has two ways of reasoning: Forward-chaining) and induction (backward-chaining ). The explain method starts from an initial fact and constantly applies rules to draw conclusions (or execute specified actions ). The induction rule is to start from assumptions and constantly look for f
functionality, they have different priorities. "" takes precedence over "| |", "" and "| |" Also takes precedence over ",". However, it is recommended that the "," delimiter be preferred, as it is more conducive to reading comprehension and engine optimization operations. At the same time, the comma delimiter cannot be mixed with other operators, such as:// Compile Error // Use this method instead of Person ((Age > weight >) | | height > 2)View Code
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.