Configuring drools and maven and recording greetings from a global application using them

I want to study drools and maven if anyone can help me with links to setting drools and maven and writing a basic hello world example using them.

Thanks in advance

+7
source share
2 answers

You should read the manual first and then try google. Questions were also asked, for example: How to set the stream and Drools rules using my web application

But anyway. Here's how to integrate it if you use Maven and Spring:

first you need to enable the Drools dependencies:

<dependency> <groupId>org.drools</groupId> <artifactId>drools-core</artifactId> <version>${drools.version}</version> </dependency> <dependency> <groupId>org.drools</groupId> <artifactId>drools-compiler</artifactId> <version>${drools.version}</version> </dependency> <dependency> <groupId>org.drools</groupId> <artifactId>drools-spring</artifactId> <version>${drools.version}</version> </dependency> 

Define the application context:

 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:drools="http://drools.org/schema/drools-spring" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd http://drools.org/schema/drools-spring http://drools.org/schema/drools-spring.xsd"> <drools:kbase id="kbase1"> <drools:resources> <drools:resource source="classpath:Sample.drl" /> </drools:resources> </drools:kbase> <drools:ksession id="ksession1" type="stateful" kbase="kbase1" /> </beans> 

Then you can enter ksession1 as a bean.

+11
source

Try google: first result for the Drools Maven Tutorial : http://www.installationwiki.org/Set_Up_for_JBoss_Drools .

Note that Maven is a build tool (actually more), while Drools is a platform / library. Therefore, the use of Drools is usually independent of Maven. This way you can get individual tutorials.

0
source

All Articles