Skip to content

Commit

Permalink
fix kie refactory
Browse files Browse the repository at this point in the history
  • Loading branch information
mariofusco committed Nov 13, 2012
1 parent 341b0e2 commit a15cac1
Show file tree
Hide file tree
Showing 123 changed files with 604 additions and 604 deletions.
10 changes: 5 additions & 5 deletions drools-cdi-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.kie</groupId>
<groupId>org.drools</groupId>
<artifactId>drools-multiproject</artifactId>
<version>6.0.0-SNAPSHOT</version>
</parent>
Expand All @@ -16,22 +16,22 @@
<dependencies>
<!-- Internal dependencies -->
<dependency>
<groupId>org.kie</groupId>
<groupId>org.drools</groupId>
<artifactId>drools-core</artifactId>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<groupId>org.drools</groupId>
<artifactId>drools-core</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.kie</groupId>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
<type>test-jar</type>
<scope>test</scope>
Expand Down
32 changes: 16 additions & 16 deletions drools-cdi-example/src/main/resources/META-INF/kproject.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<org.kie.kproject.KProjectImpl>
<org.drools.kproject.KProjectImpl>
<groupArtifactVersion>
<groupId>org.test</groupId>
<artifactId>fol4</artifactId>
Expand All @@ -9,7 +9,7 @@
<kBases>
<entry>
<string>fol4.test1.KBase1</string>
<org.kie.kproject.KBaseImpl>
<org.drools.kproject.KBaseImpl>
<namespace>fol4.test1</namespace>
<name>KBase1</name>
<includes/>
Expand All @@ -29,7 +29,7 @@
<kSessions>
<entry>
<string>fol4.test1.KSession2</string>
<org.kie.kproject.KSessionImpl>
<org.drools.kproject.KSessionImpl>
<namespace>fol4.test1</namespace>
<name>KSession2</name>
<type>stateful</type>
Expand All @@ -42,11 +42,11 @@
</a>
</annotations>
<kBase reference="../../../.."/>
</org.kie.kproject.KSessionImpl>
</org.drools.kproject.KSessionImpl>
</entry>
<entry>
<string>fol4.test1.KSession1</string>
<org.kie.kproject.KSessionImpl>
<org.drools.kproject.KSessionImpl>
<namespace>fol4.test1</namespace>
<name>KSession1</name>
<type>stateless</type>
Expand All @@ -59,15 +59,15 @@
</a>
</annotations>
<kBase reference="../../../.."/>
</org.kie.kproject.KSessionImpl>
</org.drools.kproject.KSessionImpl>
</entry>
</kSessions>
<kProject reference="../../../.."/>
</org.kie.kproject.KBaseImpl>
</org.drools.kproject.KBaseImpl>
</entry>
<entry>
<string>fol4.test3.KBase3</string>
<org.kie.kproject.KBaseImpl>
<org.drools.kproject.KBaseImpl>
<namespace>fol4.test3</namespace>
<name>KBase3</name>
<includes>
Expand All @@ -87,7 +87,7 @@
<kSessions>
<entry>
<string>fol4.test3.KSession4</string>
<org.kie.kproject.KSessionImpl>
<org.drools.kproject.KSessionImpl>
<namespace>fol4.test3</namespace>
<name>KSession4</name>
<type>stateless</type>
Expand All @@ -100,15 +100,15 @@
</a>
</annotations>
<kBase reference="../../../.."/>
</org.kie.kproject.KSessionImpl>
</org.drools.kproject.KSessionImpl>
</entry>
</kSessions>
<kProject reference="../../../.."/>
</org.kie.kproject.KBaseImpl>
</org.drools.kproject.KBaseImpl>
</entry>
<entry>
<string>fol4.test2.KBase2</string>
<org.kie.kproject.KBaseImpl>
<org.drools.kproject.KBaseImpl>
<namespace>fol4.test2</namespace>
<name>KBase2</name>
<includes/>
Expand All @@ -128,7 +128,7 @@
<kSessions>
<entry>
<string>fol4.test2.KSession3</string>
<org.kie.kproject.KSessionImpl>
<org.drools.kproject.KSessionImpl>
<namespace>fol4.test2</namespace>
<name>KSession3</name>
<type>stateful</type>
Expand All @@ -141,11 +141,11 @@
</a>
</annotations>
<kBase reference="../../../.."/>
</org.kie.kproject.KSessionImpl>
</org.drools.kproject.KSessionImpl>
</entry>
</kSessions>
<kProject reference="../../../.."/>
</org.kie.kproject.KBaseImpl>
</org.drools.kproject.KBaseImpl>
</entry>
</kBases>
</org.kie.kproject.KProjectImpl>
</org.drools.kproject.KProjectImpl>
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
drools.dialect.clips = org.kie.rule.builder.dialect.clips.ClipsDialectConfiguration
drools.dialect.clips = org.drools.rule.builder.dialect.clips.ClipsDialectConfiguration
drools.dialect.mvel.strict = false
8 changes: 4 additions & 4 deletions drools-clips/src/main/resources/org/drools/clips/Clips.g
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ grammar Clips;
@parser::header {
package org.kie.clips;

import org.kie.clips.*;
import org.drools.clips.*;

import java.util.List;
import java.util.ArrayList;
Expand All @@ -12,8 +12,8 @@ grammar Clips;
import java.util.Set;
import java.util.HashSet;
import java.util.StringTokenizer;
import org.kie.lang.descr.*;
import org.kie.lang.Location;
import org.drools.lang.descr.*;
import org.drools.lang.Location;
}

@parser::members {
Expand Down Expand Up @@ -207,7 +207,7 @@ grammar Clips;
}
@lexer::header {
package org.kie.clips;
package org.drools.clips;
}
/*
Expand Down
38 changes: 19 additions & 19 deletions drools-clips/src/main/resources/org/drools/clips/functions.conf
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
#working with vars
org.kie.clp.functions.BindFunction
org.kie.clp.functions.ModifyFunction
org.kie.clp.functions.CreateListFunction
org.drools.clp.functions.BindFunction
org.drools.clp.functions.ModifyFunction
org.drools.clp.functions.CreateListFunction

#flow control
org.kie.clp.functions.IfFunction
org.kie.clp.functions.BreakFunction
org.kie.clp.functions.SwitchFunction
org.kie.clp.functions.SwitchCaseFunction
org.kie.clp.functions.SwitchDefaultFunction
org.kie.clp.functions.WhileFunction
org.kie.clp.functions.ForeachFunction
org.kie.clp.functions.PrognFunction
org.drools.clp.functions.IfFunction
org.drools.clp.functions.BreakFunction
org.drools.clp.functions.SwitchFunction
org.drools.clp.functions.SwitchCaseFunction
org.drools.clp.functions.SwitchDefaultFunction
org.drools.clp.functions.WhileFunction
org.drools.clp.functions.ForeachFunction
org.drools.clp.functions.PrognFunction

#math comparators
org.kie.clp.functions.LessThanFunction
org.kie.clp.functions.GreaterThanOrEqualFunction
org.kie.clp.functions.EqFunction
org.drools.clp.functions.LessThanFunction
org.drools.clp.functions.GreaterThanOrEqualFunction
org.drools.clp.functions.EqFunction

#math operators
org.kie.clp.functions.PlusFunction
org.kie.clp.functions.MinusFunction
org.kie.clp.functions.DivideFunction
org.kie.clp.functions.MultiplyFunction
org.drools.clp.functions.PlusFunction
org.drools.clp.functions.MinusFunction
org.drools.clp.functions.DivideFunction
org.drools.clp.functions.MultiplyFunction

#io
org.kie.clp.functions.PrintoutFunction
org.drools.clp.functions.PrintoutFunction
20 changes: 10 additions & 10 deletions drools-clips/src/test/java/org/drools/clips/ClipsShellTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public void testSwitch() throws IOException {
new String( baos.toByteArray() ) );
}

// @FIXME - org.mvel.CompileException: unable to resolve property: unable to resolve method: org.kie.clips.Shell.max(java.lang.Integer, java.lang.Integer) [arglength=2]
// @FIXME - org.mvel.CompileException: unable to resolve property: unable to resolve method: org.drools.clips.Shell.max(java.lang.Integer, java.lang.Integer) [arglength=2]
@Test
@Ignore
public void testDeffunction() {
Expand Down Expand Up @@ -168,39 +168,39 @@ public void testDirectImportAndNew() {

@Test
public void testDynamicImportAndNew() {
String t = "(import org.kie.*) (bind ?p (new Person mark cheddar) ) (printout t ?p)";
String t = "(import org.drools.*) (bind ?p (new Person mark cheddar) ) (printout t ?p)";
this.shell.eval( t );
assertEquals( "[Person name='mark']",
new String( this.baos.toByteArray() ) );
}

@Test
public void testSet() {
String t = "(import org.kie.*) (bind ?p (new Person mark cheddar) ) (set ?p name bob) (printout t ?p)";
String t = "(import org.drools.*) (bind ?p (new Person mark cheddar) ) (set ?p name bob) (printout t ?p)";
this.shell.eval( t );
assertEquals( "[Person name='bob']",
new String( this.baos.toByteArray() ) );
}

@Test
public void testGet() {
String t = "(import org.kie.*) (bind ?p (new Person mark cheddar) )(printout t (get ?p name))";
String t = "(import org.drools.*) (bind ?p (new Person mark cheddar) )(printout t (get ?p name))";
this.shell.eval( t );
assertEquals( "mark",
new String( this.baos.toByteArray() ) );
}

@Test
public void testExplicitCall() {
String t = "(import org.kie.*) (bind ?p (new Person mark cheddar) ) (call ?p setFields bob stilton 35) (printout t (call ?p toLongString))";
String t = "(import org.drools.*) (bind ?p (new Person mark cheddar) ) (call ?p setFields bob stilton 35) (printout t (call ?p toLongString))";
this.shell.eval( t );
assertEquals( "[Person name='bob' likes='stilton' age='35']",
new String( this.baos.toByteArray() ) );
}

@Test
public void testImplicitCall() {
String t = "(import org.kie.*) (bind ?p (new Person mark cheddar) ) (?p setFields bob stilton 35) (printout t (call ?p toLongString))";
String t = "(import org.drools.*) (bind ?p (new Person mark cheddar) ) (?p setFields bob stilton 35) (printout t (call ?p toLongString))";
this.shell.eval( t );
assertEquals( "[Person name='bob' likes='stilton' age='35']",
new String( this.baos.toByteArray() ) );
Expand Down Expand Up @@ -327,7 +327,7 @@ public void testEmptyLHSRule() {
@Test
@Ignore
public void testSimpleLHSRule() {
this.shell.eval( "(import org.kie.*)" );
this.shell.eval( "(import org.drools.*)" );
this.shell.eval( "(defrule testRule (Person (name ?name&mark) ) => (printout t hello) (printout t \" \" ?name))" );
this.shell.eval( "(assert (Person (name mark) ) )" );
this.shell.eval( "(run)" );
Expand All @@ -341,7 +341,7 @@ public void testRuleCallDeftemplate() {
String function = "(deffunction max (?a ?b) (if (> ?a ?b) then (return ?a) else (return ?b) ) )";
this.shell.eval( function );

this.shell.eval( "(import org.kie.*)" );
this.shell.eval( "(import org.drools.*)" );
this.shell.eval( "(defrule testRule (Person (age ?age) ) => (printout t hello) (printout t \" \" (max 3 ?age) ) )" );
this.shell.eval( "(assert (Person (name mark) (age 32) ) )" );
this.shell.eval( "(run)" );
Expand All @@ -352,7 +352,7 @@ public void testRuleCallDeftemplate() {
@Test
@Ignore
public void testTwoSimpleRulesWithModify() {
this.shell.eval( "(import org.kie.*)" );
this.shell.eval( "(import org.drools.*)" );
this.shell.eval( "(defrule testRule1 ?p <- (Person (name ?name&mark) ) => (printout t hello) (printout t \" \" ?name) (modify ?p (name bob) ) )" );
this.shell.eval( "(defrule testRule2 (Person (name ?name&bob) ) => (printout t hello) (printout t \" \" ?name))" );
this.shell.eval( "(assert (Person (name mark) ) )" );
Expand All @@ -364,7 +364,7 @@ public void testTwoSimpleRulesWithModify() {
@Test
@Ignore
public void testBlockEval() {
String text = "(import org.kie.*)";
String text = "(import org.drools.*)";
text += "(defrule testRule1 ?p <- (Person (name ?name&mark) ) => (printout t hello) (printout t \" \" ?name) (modify ?p (name bob) ) )";
text += "(defrule testRule2 (Person (name ?name&bob) ) => (printout t hello) (printout t \" \" ?name))";
text += "(assert (Person (name mark) ) )";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ log

package Some_business_rules;
//generated from Decision Table
import org.kie.decisiontable.Cheese;
import org.kie.decisiontable.Person;
import org.drools.decisiontable.Cheese;
import org.drools.decisiontable.Person;
global java.util.List list;

template "cheesefans"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* objects have been retrieved from a database using some form of Object-Relational Mapper (such
* as Hibernate or Toplink).
*
* An alternative is to use the ResultSetGenerator from the org.kie.templates.jdbc package, where you can use
* An alternative is to use the ResultSetGenerator from the org.drools.templates.jdbc package, where you can use
* vanilla JDBC to generate rules from (you just select the table names as the field named from the template) - this means no ORM
* is required.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public void createGame() {

MapVariableResolverFactory f = new MapVariableResolverFactory( map );

String baseStr = "import org.kie.games.adventures.*; import org.kie.games.adventures.commands.*;\n";
String baseStr = "import org.drools.games.adventures.*; import org.drools.games.adventures.commands.*;\n";
FactHandle fh = ksession.insert( MVEL.eval( baseStr + "new EnterEvent( characters['hero'], rooms['first floor hallway'] )",
f ) );
ksession.fireAllRules();
Expand All @@ -160,7 +160,7 @@ public void createGame() {
public void receiveMessage(UserSession session,
List cmd) {
ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader();
String baseStr = "import org.kie.games.adventures.*; import org.kie.games.adventures.commands.*;\n";
String baseStr = "import org.drools.games.adventures.*; import org.drools.games.adventures.commands.*;\n";
try {
Thread.currentThread().setContextClassLoader( classLoader );
Map vars = new HashMap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.kie.benchmark.manners
package org.drools.benchmark.manners

rule assignFirstSeat
when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
//created on: 25/03/2006
package benchmarks.waltz

import org.kie.benchmark.waltz.Stage
import org.kie.benchmark.waltz.Line
import org.kie.benchmark.waltz.Edge
import org.kie.benchmark.waltz.Junction
import org.kie.benchmark.waltz.WaltzUtil
import org.drools.benchmark.waltz.Stage
import org.drools.benchmark.waltz.Line
import org.drools.benchmark.waltz.Edge
import org.drools.benchmark.waltz.Junction
import org.drools.benchmark.waltz.WaltzUtil

global Long time

Expand Down
Loading

0 comments on commit a15cac1

Please sign in to comment.