Work
This commit is contained in:
parent
ce0f351c9d
commit
c9209dc9a5
105 changed files with 2390 additions and 839 deletions
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule">
|
||||
|
||||
<kbase name="lesson2" packages="lesson2">
|
||||
<ksession name="lesson2-session"/>
|
||||
</kbase>
|
||||
|
||||
</kmodule>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
//#created on: 30 oct. 2010
|
||||
package cours
|
||||
|
||||
//list any import classes here.
|
||||
import droolscours.Account;
|
||||
import droolscours.util.OutputDisplay;
|
||||
|
||||
//#declare any global variables here
|
||||
|
||||
|
||||
global OutputDisplay showResult;
|
||||
|
||||
rule "Your First Rule revisited"
|
||||
|
||||
when
|
||||
Account( )
|
||||
then
|
||||
showResult.showText("Le compte existe donc déjà");
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package droolscours;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.kie.api.runtime.KieContainer;
|
||||
import org.kie.api.runtime.KieSession;
|
||||
import org.kie.api.runtime.StatelessKieSession;
|
||||
import util.KnowledgeSessionHelper;
|
||||
|
||||
|
||||
public class Testlesson4 {
|
||||
static KieContainer kieContainer;
|
||||
StatelessKieSession sessionStateless = null;
|
||||
KieSession sessionStatefull = null;
|
||||
|
||||
@BeforeClass
|
||||
public static void beforeClass(){
|
||||
kieContainer=KnowledgeSessionHelper.createRuleBase();
|
||||
}
|
||||
@Test
|
||||
public void testUnFaitSansFait() {
|
||||
sessionStatefull = KnowledgeSessionHelper
|
||||
.getStatefulKnowledgeSession(kieContainer,"lesson1-session");
|
||||
sessionStatefull.fireAllRules();
|
||||
System.out.println("Did you see something ?");
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue