SlideShare una empresa de Scribd logo
1 de 104
Descargar para leer sin conexión
1
●
The SkyNet funding bill is passed.
●The system goes online on August 4th, 1997.
●Human decisions are removed from strategic defense.
●SkyNet begins to learn at a geometric rate.
●It becomes self-aware at 2:14am Eastern time, August 29th
●In a panic, they try to pull the plug.
●And, Skynet fights back
Mark
Proctor
Project Lead
Monday, 5 August 13
Agenda
•Quick Intro - What are Rule Based Systems
•KIE
•5.x Critique
•6.0 Improvements
•UI
•Content
•Deployment
•Spring and Camel
•API
•CDI
•ScoreCards and PMML
•JTMS
•Phreak
•Legacy Migrations
•Backward chaining Example
•UberFire
2
Monday, 5 August 13
Quick Intro
What are Rule Based Systems
3
Monday, 5 August 13
4
Vision
Robotics
Speech
Neural Nets Rule Base Systems/
Expert System Tools
Understanding
Natural
LanguageSome Areas of
Artificial
Intelligence
Some Areas of Artificial Intelligence
Monday, 5 August 13
5
Knowledge Representation and Reasoning
The study of Knowledge is Epistemology
● Nature Structure and Origins of Knowledge
● Core or AI
Rule based systems
● Expert System tools
● Knowledge Representation and Reasoning
● Facilitate the codification of knowledge into a knowledge
base which can be used for reasoning
Monday, 5 August 13
6
It All Started Here Birth of CDSS
Dendral
Mycin
Baobab
Guidon
Neomycin
Teiresias Emycin WM
Puff
Sacon
Centaur
Gravida
Wheeze Clot
Onccocin
1970s
1980s
Monday, 5 August 13
7
Because Not Everyone
Is As Smart As He Is
Monday, 5 August 13
1979 Rete Algorithm by Charles Forgy
8
Monday, 5 August 13
Clips and Jess
Clips 1986
9
Clips 1995
Monday, 5 August 13
10
And some day we'll build him!!!
Monday, 5 August 13
11
What is a Rule
rule <rule_name>
<attribute><value>
when
<conditions>
then
<actions>
end
Monday, 5 August 13
12
Pattern Matching
Person( age >= 18 )
field name restriction
constraintobject type
pattern
Monday, 5 August 13
13
Two Phase System
Monday, 5 August 13
14Classes
AccountAccount
long accountNo
int balance
CashFlowCashFlow
Date date
int amount
AccountPeriodAccountPeriod
Date start
Date end
Monday, 5 August 13
15
rule “increase balance for AccountPeriod Credits”
when
ap : AccountPeriod()
acc : Account( $accountNo : accountNo )
CashFlow( type == CREDIT,
accountNo == $accountNo,
date >= ap.start && <= ap.end,
$ammount : ammount )
then
acc.balance += $amount;
end
select * from Account acc,
Cashflow cf, AccountPeriod ap
where acc.accountNo == cf.accountNo and
cf.type == CREDIT
cf.date >= ap.start and
cf.date <= ap.end
trigger : acc.balance += cf.amount
Credit Cashflow Rule
Monday, 5 August 13
16
rule “increase balance for AccountPeriod Credits”
when
ap : AccountPeriod()
acc : Account( $accountNo : accountNo )
CashFlow( type == CREDIT,
accountNo == $accountNo,
date >= ap.start && <= ap.end,
$ammount : ammount )
then
acc.balance += $amount;
end
select * from Account acc,
Cashflow cf, AccountPeriod ap
where acc.accountNo == cf.accountNo and
cf.type == CREDIT
cf.date >= ap.start and
cf.date <= ap.end
trigger : acc.balance += cf.amount
Credit Cashflow Rule
Monday, 5 August 13
17
rule “increase balance for AccountPeriod Credits”
when
ap : AccountPeriod()
acc : Account( $accountNo : accountNo )
CashFlow( type == CREDIT,
accountNo == $accountNo,
date >= ap.start && <= ap.end,
$ammount : ammount )
then
acc.balance += $amount;
end
select * from Account acc,
Cashflow cf, AccountPeriod ap
where acc.accountNo == cf.accountNo and
cf.type == CREDIT
cf.date >= ap.start and
cf.date <= ap.end
trigger : acc.balance += cf.amount
Credit Cashflow Rule
Monday, 5 August 13
18
rule “increase balance for AccountPeriod Credits”
when
ap : AccountPeriod()
acc : Account( $accountNo : accountNo )
CashFlow( type == CREDIT,
accountNo == $accountNo,
date >= ap.start && <= ap.end,
$ammount : ammount )
then
acc.balance += $amount;
end
select * from Account acc,
Cashflow cf, AccountPeriod ap
where acc.accountNo == cf.accountNo and
cf.type == CREDIT
cf.date >= ap.start and
cf.date <= ap.end
trigger : acc.balance += cf.amount
Credit Cashflow Rule
Monday, 5 August 13
19
Rules as a “view”
rule "Increase balance for AccountPeriod Credits"
when
ap : AccountPeriod( )
acc : Account( )
cf : CashFlow( type == CashFlowType.CREDIT,
accountNo == acc.accountNo,
date >= ap.start && <= ap.end )
then
acc.balance = acc.balance + cf.amount;
end
rule "Decrease balance for AccountPeriod Debits"
when
ap : AccountPeriod( )
acc : Account( )
cf : CashFlow( type == CashFlowType.DEBIT,
accountNo == acc.accountNo,
date >= ap.start && <=
ap.end )
then
acc.balance = acc.balance - cf.amount;
end
CashFlowCashFlowCashFlowCashFlow
date amount type accountNo
12-Jan-12 100 CREDIT 1
2-Feb-12 200 DEBIT 1
18-May-12 50 CREDIT 1
9-May-12 75 CREDIT 1
AccountingPeriodAccountingPeriod
start end
01-JAN-2012 31-MAR-2012
AccountAccount
accountNo balance
1 0
CashFlowCashFlowCashFlowCashFlow
date amount type accountNo
12-Jan-12 100 CREDIT 1
9-May-12 75 CREDIT 1
CashFlowCashFlowCashFlowCashFlow
date amount type accountNo
2-Feb-12 200 DEBIT 1
AccountAccount
accountNo balance
1 -25
Monday, 5 August 13
20
rule "Print blance for AccountPeriod" salience -50
when
ap : AccountPeriod()
acc : Account( )
then
System.out.println( "Account Number " + acc.accountNo + " balance " + acc.balance );
end
Conflict Resolution with Salience
AgendaAgendaAgenda
1 increase balance arbitrary
2 decrease balance
arbitrary
3 increase balance
arbitrary
4 print balance
Monday, 5 August 13
21
rule “increase balance for AccountPeriod Credits”
ruleflow-group “calculation”
when
ap : AccountPeriod()
acc : Account( $accountNo : accountNo )
CashFlow( type == CREDIT,
accountNo == $accountNo,
date >= ap.start && <= ap.end,
$ammount : ammount )
then
acc.balance += $amount;
end
rule “Print blance for AccountPeriod”
ruleflow-group “report”
when
ap : AccountPeriod()
acc : Account( )
then
System.out.println( acc.accountNo + “ : “ acc.balance );
end
ruleflow-group
RuleFlow
Monday, 5 August 13
22
Monday, 5 August 13
Knowledge Is Everything
Platform Changes Overview
23
Monday, 5 August 13
KIE - Knowledge Is Everything
24
KIE
Drools jBPMOptaPlanner UberFire
Guvnor
Drools-WB jBPM-WB
KIE-WB
Monday, 5 August 13
GitHub
URL:
https://github.com/droolsjbpm/
Bootstrap project:
https://github.com/droolsjbpm/droolsjbpm-build-bootstrap
25
Monday, 5 August 13
GitHub
26
Monday, 5 August 13
Changes
Conventions:
•droolsjbpm -> kie
•knowlege -> kie
Examples
•KnowledgeBase -> Kie
•StatefulKnowledgeSession -> KieSession
•StatelessKnowledgeSession - StatelesKieSession
Legacy API Adapter JAR
•Most API’s should work with legacy adapter
•KnowledegAgents have not been ported, PKG’s are not longer
the unit of deployment
DRL has not changed
27
Monday, 5 August 13
5.x Critique
28
Monday, 5 August 13
5.x Critique
•UI
•Content
•Deployment
•Utilize
29
Monday, 5 August 13
5.x Critique
UI
•GWT
•but not easily extended
•fixed layouts
•no perspectives
30
Monday, 5 August 13
5.x Critique
Content
•JCR
•Performance issues
•Everything stored as a blob
•No tagging, branching etc.
•Webdav, with limited Eclipse team provider integration.
•Single tree structure (packages)
•Packages created project deployment units
•no real alignment with industry stadard
•No easy rule use (only a single global area)
•Loading “model” jars into packages
•Poor hack, for dependency management
31
Monday, 5 August 13
5.x Critique
32
Deployment
•Simple Snapshot system
•No real methodology
•Doesn’t align with any industry standards
Monday, 5 August 13
5.x Critique
Utilize
•Progmatic API only
•Have to select all resources
33
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.batch().add( newClassPathResource( "Model.drl", getClass() ), DRL )
.add( newClassPathResource( "Queries.drl", getClass() ), DRL )
.add( newClassPathResource( "General.drl", getClass() ), DRL )
.add( newClassPathResource( "Response.drl", getClass() ), DRL )
.add( newClassPathResource( "Events.drl", getClass() ), DRL )
.add( newClassPathResource( "UiView.drl", getClass() ), DRL )
.add( newClassPathResource( "Commands.drl", getClass() ), DRL ).build();
if ( kbuilder.hasErrors() ) {
System.out.println( kbuilder.getErrors().toString() );
System.exit( 1 );
}
KieBaseConfiguration kbaseConf = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
kbaseConf.setOption( EqualityBehaviorOption.EQUALITY );
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase( kbaseConf );
kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );
Counter c = new Counter();
ksession = kbase.newStatefulKnowledgeSession();
Monday, 5 August 13
6.0 UI
Improvements
34
Monday, 5 August 13
6.0 UI
UI
•Modular
•Extensible
35
•Dynamic and Flexible layouts
•Perspectives
UF
Monday, 5 August 13
Video
UI Overview
https://www.youtube.com/watch?v=ckAznbOOV-4
36
Monday, 5 August 13
6.0 UI
38
Monday, 5 August 13
6.0 UI Content and Authoring
Improvements
39
Monday, 5 August 13
6.0 Content
•GIT
•Industry standard tooling
•Multiple repositories and projects
•All projects are Maven multi-module projects
•Projects can be shared, via pom dependencies
•Both Kie projects, and any other maven jar
•Local Maven repository management for model jars
40
Monday, 5 August 13
6.0 Content
Simple POM Editor
41
Monday, 5 August 13
6.0 Content
Build And Deploy
42
Monday, 5 August 13
6.0 Content
Local Maven repository and manager
43
Monday, 5 August 13
Video
Maven, Builder an Deploy
https://www.youtube.com/watch?v=ckAznbOOV-4
44
Monday, 5 August 13
6.0 Content
Create or Clone Git Repositories
46
Monday, 5 August 13
6.0 Deployment Improvements
47
Monday, 5 August 13
6.0 Deployment
48
Deployment
•Maven JARS
•All projects are just maven projects
•All projects compile to JARS
•JARS are installed to local M2_REPO, which is expose on http
•Can “deploy” to external repos.
•Uses Maven industry methdologies
Monday, 5 August 13
6.0 Utilization
Improvemets
49
Monday, 5 August 13
KieModules
•Discovery
•META-INF/kmodule.xml
•Convention based
•No programmatic api for building
•Multiple Named entities
•Inheritence of Resources
•Defaults for lazy people
•Version built in a standard
50
Monday, 5 August 13
Git Hub Examples
https://github.com/droolsjbpm/drools/tree/master/drools-examples-api
51
Monday, 5 August 13
KieModules
Defaults and JAR on Classpath
•Creates one KieBase, adds all resources from that JAR
•See kmodule.xsd in kie-api jar
52
<kmodule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://jboss.org/kie/6.0.0/kmodule">
</kmodule>
KieServices ks = KieServices.Factory.get();
KieContainer kContainer = ks.getKieClasspathContainer();
KieSession kSession = kContainer.newKieSession();
kSession.setGlobal("out", out);
kSession.insert(new Message("Dave", "Hello, HAL. Do you read me, HAL?"));
kSession.fireAllRules();
Monday, 5 August 13
53
Monday, 5 August 13
KieModules
Named Entities and JAR on Classpath
•Creates one KieBase
•Includes resources from package matching kbase name
54
<kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule">
<kbase name="namedkiesession">
<ksession name="ksession1"/>
</kbase>
</kmodule>
KieServices ks = KieServices.Factory.get();
KieContainer kContainer = ks.getKieClasspathContainer();
KieSession kSession = kContainer.newKieSession("ksession1");
kSession.setGlobal("out", out);
kSession.insert(new Message("Dave", "Hello, HAL. Do you read me, HAL?"));
kSession.fireAllRules();
Monday, 5 August 13
55
Monday, 5 August 13
KieModules
Named Entities, with inheritence and JAR on Classpath
•Two projects, one “includes” from the other
56
<dependency>
<groupId>org.drools</groupId>
<artifactId>named-kiesession</artifactId>
<version>6.0.0-SNAPSHOT</version>
</dependency>
<kbase name="kiebaseinclusion" includes="namedkiebase">
<ksession name="ksession2"/>
</kbase>
KieServices ks = KieServices.Factory.get();
KieContainer kContainer = ks.getKieClasspathContainer();
KieSession kSession = kContainer.newKieSession("ksession2");
kSession.setGlobal("out", out);
kSession.insert(new Message("Dave", "Hello, HAL. Do you read me, HAL?"));
kSession.fireAllRules();
kSession.insert(new Message("Dave", "Open the pod bay doors, HAL."));
kSession.fireAllRules();
Monday, 5 August 13
KieModules
Package location can over-ride kbase name defaults
57
<kbase name="WumpusMainKB" packages="org.drools.games.wumpus.server,
org.drools.games.wumpus.server.view">
<ksession name="WumpusMainKS" />
</kbase>
<kbase name="WumpusClientKB" packages="org.drools.games.wumpus.client">
<ksession name="WumpusClientKS"/>
</kbase>
KieContainer kc = KieServices.Factory.get().getKieClasspathContainer();
final KieSession serverKsession = kc.newKieSession( "WumpusMainKS");
final KieSession clientKsession = kc.newKieSession("WumpusClientKS");
Monday, 5 August 13
Dynamic KieModules
•JARs can be loaded from URLs into KieRepository
•Once loaded they can be resolved via ReleaseId
58
KieServices ks = KieServices.Factory.get();
KieRepository kr = ks.getRepository();
KieModule kModule = kr.addKieModule(ks.getResources().newFileSystemResource(
getFile("default-kiesession")));
KieContainer kContainer = ks.newKieContainer(kModule.getReleaseId());
KieSession kSession = kContainer.newKieSession();
kSession.setGlobal("out", out);
Object msg1 = createMessage(kContainer,
"Dave", "Hello, HAL. Do you read me, HAL?");
kSession.insert(msg1);
kSession.fireAllRules();
Monday, 5 August 13
Dynamic KieModules
kie-ci use embedded maven for remote discovery
59
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-ci</artifactId>
</dependency>
KieServices ks = KieServices.Factory.get();
// Install example1 in the local maven repo before to do this
KieContainer kContainer = ks.newKieContainer(
ks.newReleaseId("org.drools",
"named-kiesession",
"6.0.0-SNAPSHOT"));
KieSession kSession = kContainer.newKieSession("ksession1");
kSession.setGlobal("out", out);
Object msg1 = createMessage(kContainer,
"Dave", "Hello, HAL. Do you read me, HAL?");
kSession.insert(msg1);
kSession.fireAllRules();
Monday, 5 August 13
Dynamic Modules
•Kie-CI and Automatic updates with KieScanner
•Replaces KnowledgeAgent
•Mave resolves new artifacts dynamically at runtime
•SNAPSHOT, LATEST, STABLE and version ranges supported
•See KieRepositoryScannerTest
60
KieServices ks = KieServices.Factory.get();
ReleaseId releaseId = ks.newReleaseId("org.kie", "scanner-test", "1.0-SNAPSHOT");
InternalKieModule kJar1 = createKieJar(ks, releaseId, "rule1", "rule2");
KieContainer kieContainer = ks.newKieContainer(releaseId);
MavenRepository repository = getMavenRepository();
repository.deployArtifact(releaseId, kJar1, kPom);
// create a ksesion and check it works as expected
KieSession ksession = kieContainer.newKieSession("KSession1");
checkKSession(ksession, "rule1", "rule2");
Monday, 5 August 13
Dynamic Modules
61
// create a new kjar
InternalKieModule kJar2 = createKieJar(ks, releaseId, "rule2", "rule3");
// deploy it on maven
repository.deployArtifact(releaseId, kJar2, kPom);
// since I am not calling start() on the scanner it means it won't have
automatic scheduled scanning
KieScanner scanner = ks.newKieScanner(kieContainer);
// scan the maven repo to get the new kjar version and deploy it on the
kcontainer
scanner.scanNow();
// create a ksesion and check it works as expected
KieSession ksession2 = kieContainer.newKieSession("KSession1");
checkKSession(ksession2, "rule2", "rule3");
Monday, 5 August 13
Programmatic API
•Builder API, for tooling integration
•Incremental compilation, and problem reporting
62
KieServices ks = KieServices.Factory.get();
KieRepository kr = ks.getRepository();
KieFileSystem kfs = ks.newKieFileSystem();
kfs.write("src/main/resources/org/kie/example5/HAL5.drl", getRule());
KieBuilder kb = ks.newKieBuilder(kfs);
kb.buildAll(); // kieModule is automatically deployed to KieRepository if
successfully built.
if (kb.getResults().hasMessages(Level.ERROR)) {
throw new RuntimeException("Build Errors:n" + kb.getResults().toString());
}
KieContainer kContainer = ks.newKieContainer(kr.getDefaultReleaseId());
KieSession kSession = kContainer.newKieSession();
kSession.setGlobal("out", out);
kSession.insert(new Message("Dave", "Hello, HAL. Do you read me, HAL?"));
kSession.fireAllRules();
Monday, 5 August 13
kmodule.xml Editor
63
Monday, 5 August 13
6.0 Spring Camel
64
Monday, 5 August 13
Spring and Camel
65
Monday, 5 August 13
Spring and Camel
66
Monday, 5 August 13
Spring and Camel
67
Monday, 5 August 13
Spring and Camel
68
Monday, 5 August 13
6.0 CDI
69
Monday, 5 August 13
CDI Context and Dependency Injection
CDI injects named entities from the kmodule.xml
Injectable types
•KieServices
•KieContainer
•KieBase
•KieSession
•StatelessKieSession
70
Monday, 5 August 13
KieContainer
71
@Inject
private KieContainer kContainer;
@Inject
@KReleaseId(groupId = "jar1",
artifactId = "art1",
version = "1.1")
private KieContainer kContainerv11;
Monday, 5 August 13
KBase
72
@Inject
@KBase(value="jar1.KBase1", name="kb2")
@KReleaseId( groupId = "jar1",
artifactId = "art1",
version = "1.0")
private KieBase jar1KBase1kb2;
@Inject
@KBase(value="jar1.KBase1", name="kb2")
@KReleaseId( groupId = "jar1",
artifactId = "art1",
version = "1.0")
private KieBase jar1KBase1kb22;
@Inject
private KieBase defaultClassPathKBase;
@Inject
@KReleaseId( groupId = "jar1",
artifactId = "art1",
version = "1.0")
private KieBase defaultDynamicKBase;
@Inject
@KBase("jar1.KBase1")
@KReleaseId( groupId = "jar1",
artifactId = "art1",
version = "1.0")
private KieBase jar1KBase1v10;
@Inject
@KBase("jar1.KBase1")
@KReleaseId(groupId = "jar1",
artifactId = "art1",
version = "1.1")
private KieBase jar1KBase1v11;
@Inject
@KBase(value="jar1.KBase1", name="kb1")
@KReleaseId( groupId = "jar1",
artifactId = "art1",
version = "1.0")
private KieBase jar1KBase1kb1;
Monday, 5 August 13
KSession
73
@Inject
private KieSession defaultClassPathKSession;
@Inject
@KReleaseId( groupId = "jar1",
artifactId = "art1",
version = "1.0")
private KieSession defaultDynamicKSession;
Monday, 5 August 13
KSession
74
@Inject
@KSession("jar1.KSession2")
@KReleaseId( groupId = "jar1",
artifactId = "art1",
version = "1.0" )
private KieSession kbase1ksession2v10;
@Inject
@KSession("jar1.KSession2")
@KReleaseId( groupId = "jar1",
artifactId = "art1",
version = "1.1" )
private KieSession kbase1ksession2v11;
@Inject
@KSession(value="jar1.KSession2", name="ks1")
@KReleaseId( groupId = "jar1",
artifactId = "art1",
version = "1.0" )
private KieSession kbase1ksession2ks1;
@Inject
@KSession(value="jar1.KSession2", name="ks2")
@KReleaseId( groupId = "jar1",
artifactId = "art1",
version = "1.0" )
private KieSession kbase1ksession2ks2 ;
@Inject
@KSession(value="jar1.KSession2", name="ks2")
@KReleaseId( groupId = "jar1",
artifactId = "art1",
version = "1.0" )
private KieSession kbase1ksession2ks22;
Monday, 5 August 13
6.0 Score Cards
75
Monday, 5 August 13
Score Cards
a) Setup Parameters
b) Characteristic Section
76
Monday, 5 August 13
Score Cards
77
•UI Generates PMML
•DRL Generated from PMML
•DRL results in
•Calculated Score
•Ranked Reason Codes
•Can import PMML 4.1
•but not exposed yet
•Calculated Scores
•Currently Summations
•Weight coming
•Not in PMML standard
Monday, 5 August 13
6.0 JTMS
78
Monday, 5 August 13
Justification-based Truth Maintenace JTMS
Drools 5.x
•Simple logical insertion TMS, like Clips, Jess and others.
•Drools 6.0
•Contradiction handling with JTMS
•Clean separation of exception logic
•TMS now has pluggable Belief System
•Simple TMS support
•JTMS now possible.
•Defeasible Logic soon
•See drools-compiler
•JTMSTest for lots of example tests
•https://github.com/droolsjbpm/drools/blob/master/drools-compiler/
src/test/java/org/drools/compiler/beliefsystem/jtms/
JTMSTest.java
79
Monday, 5 August 13
80
JTMS
rule "Issue Child Bus Pass"
when
$p : Person( age < 16 )
then
insert(new ChildBusPass( $p ) );
end
rule "Issue Adult Bus Pass"
when
$p : Person( age >= 16 )
then
insert(new AdultBusPass( $p ) );
end
Couples the logic
What happens when the Child
stops being 16?
Monday, 5 August 13
81
JTMS
•Bad
•Monolithic
•Leaky
•Brittle integrity - manual maintenance
Monday, 5 August 13
82
JTMS
•A rule “logically” inserts an object
•When the rule is no longer true, the object is retracted.
rule "IsChild"
when
$p : Person( age < 16 )
then
logicalInsert( new IsChild( $p ) )
end
rule "IsAdult"
when
$p : Person( age >= 16 )
then
logicalInsert( new IsAdult( $p ) )
end
de-couples the logic
Maintains the truth by
automatically retracting
Monday, 5 August 13
83
JTMS
rule "Issue Child Bus Pass"
when
$p : Person( )
IsChild( person =$p )
then
logicalInsert(new ChildBusPass( $p ) );
end
rule "Issue Adult Bus Pass"
when
$p : Person()
IsAdult( person =$p )
then
logicalInsert(new AdultBusPass( $p ) );
end
The truth maintenance cascades
Monday, 5 August 13
84
JTMS
rule "Issue Child Bus Pass"
when
$p : Person( )
not( ChildBusPass( person == $p ) )
then
requestChildBusPass( $p );
end The truth maintenance cascades
Monday, 5 August 13
85
JTMS
• Good
• De-couple knowledge responsibilities
• Encapsulate knowledge
• Provide semantic abstractions for those encapsulation
• Integrity robustness – truth maintenance
Monday, 5 August 13
JTMS
86
IsChild
ChildBusPas
Rule : isChildRule
Rule : IssueBusPas
+
+
Monday, 5 August 13
JTMS
87
rule "Do not issue to banned people"
when
$p : Person( )
Banned( person =$p )
then
logicalInsert(new ChildBusPass( $p ) , “neg” );
end
Monday, 5 August 13
JTMS
88
IsChild
ChildBusPas
Rule : isChildRule
Rule : IssueBusPas
+
+
Rule : Do Not Issue
to Banned People
-
Monday, 5 August 13
R.I.P RETE
inspirations:
•Leaps, Collection Oriented Match, L/R Unlinking
New Innovations
•Full Rule, and Rule Segment Unlinking
•Lazy Evaluation, with Rule scoping
•Set propagations
Previous Innovations
•Modify In Place
•Property Reactive
•Tree Based Graphs
•Subnetwork support
89
Monday, 5 August 13
6.0 Legacy and
Backwards Compatability
90
Monday, 5 August 13
Legacy Systems and Migration
Legacy API Adapter JAR
•Most API’s should work with legacy adapter
•KnowledegAgents have not been ported, PKG’s are not longer
the unit of deployment
JCR Migration Tool
•Command Line Java code
•Each Package maps to a GIT project
91
Monday, 5 August 13
Backward Chaining
Re-introducing an Advanced Feature
Detailed Tutorial here:
https://www.youtube.com/watch?v=fCjIRVSRFvA
92
Monday, 5 August 13
93
Backward Chaining
query isChild( Person p )
$p := Person( age <= 16 )
end
rule "Issue Child Bus Pass"
when
$p : Person( )
isChild( $p; )
then
logicalInsert(new ChildBusPass( $p ) );
end
Monday, 5 August 13
94
Reasoning with Graphs
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Monday, 5 August 13
95
Backward Chaining
query isContainedIn( String x, String y )
Location( x, y; )
or
( Location( z, y; ) and isContainedIn( x, z; ) )
end
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Monday, 5 August 13
Backward Chaining
96
ksession.insert( new Location("Office", "House") );
ksession.insert( new Location("Kitchen", "House") );
ksession.insert( new Location("Knife", "Kitchen") );
ksession.insert( new Location("Cheese", "Kitchen") );
ksession.insert( new Location("Desk", "Office") );
ksession.insert( new Location("Chair", "Office") );
ksession.insert( new Location("Computer", "Desk") );
ksession.insert( new Location("Draw", "Desk") );
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Monday, 5 August 13
Backward Chaining
97
rule "go1"
when
String( this == "go1" )
isContainedIn("Office", "House"; )
then
System.out.println( "office is in the house" );
end
rule "go" salience 10
when
$s : String( )
then
System.out.println( $s );
end
ksession.insert( "go1" );
ksession.fireAllRules();
---
go1
office is in the house
query isContainedIn( String x, String y )
Location( x, y; )
or
( Location( z, y; ) and isContainedIn( x, z; ) )
end
Does not recurse.
Finds Location(“Office, House”)
on first call.
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Monday, 5 August 13
Backward Chaining
98
rule "go2"
when
String( this == "go2" )
isContainedIn("Draw", "House"; )
then
System.out.println( "Draw in the House" );
end
ksession.insert( "go2" );
ksession.fireAllRules();
---
go2
Desk in the House
query isContainedIn( String x, String y )
Location( x, y; )
or
( Location( z, y; ) and isContainedIn( x, z; ) )
end
Recursive 3 times, note the Z.
Location( “Office”, “House”)
Location( “Desk”, “Office”)
Location( “Draw”, “Desk”)
Out Var
(unbound) In Var
(bound)
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Monday, 5 August 13
Backward Chaining
99
rule "go3"
when
String( this == "go3" )
isContainedIn("Key", "Office"; )
then
System.out.println( "Key in the Office" );
end
ksession.insert( "go3" );
ksession.fireAllRules();
---
go3
ksession.insert( new Location("Key", "Draw") );
ksession.fireAllRules();
---
Key in the Office
Nothing returned.
There is no key at any point below
Office. But the query stays open and
reactive.
Key Inserted 3 levels below, but
system detects, reacts and bubbles
up the results.
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Monday, 5 August 13
Backward Chaining
100
rule "go4"
when
String( this == "go4" )
isContainedIn(thing, "Office"; )
then
System.out.println( "thing " + thing + " is in the Office" );
end
ksession.insert( "go4" );
ksession.fireAllRules();
---
go4
thing Key is in the Office
thing Computer is in the Office
thing Draw is in the Office
thing Desk is in the Office
thing Chair is in the Office
Finds all Things in the office, but
directly and transitively.
Out Var
(unbound)
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Monday, 5 August 13
Backward Chaining
101
rule "go5"
when
String( this == "go5" )
isContainedIn(thing, location; )
then
System.out.println( "thing " + thing + " is in " + location );
end
ksession.insert( "go5" );
ksession.fireAllRules();
---
go5
thing Knife is in House
thing Cheese is in House
thing Key is in House
thing Computer is in House
thing Draw is in House
thing Desk is in House
thing Chair is in House
thing Key is in Office
thing Computer is in Office
thing Draw is in Office
thing Key is in Desk
thing Office is in House
Find all things in all things.
Out Var
(unbound)
Out Var
(unbound)
thing Computer is in Desk
thing Knife is in Kitchen
thing Cheese is in Kitchen
thing Kitchen is in House
thing Key is in Draw
thing Draw is in Desk
thing Desk is in Office
thing Chair is in Office
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Monday, 5 August 13
102
UF UberFirehttps://www.youtube.com/watch?v=ckAznbOOV-4
Monday, 5 August 13
103
Features
• Compile time composition of plugins
• modular components, each separate maven module.
• Lightweight
• Decoupled components
• Layout Manager and Perspectives
• Embeddable/Reusable (*)
• Unified API
• Security
• I/O
• VFS
• Metadata
• Menus, Toolbars, Panels, etc.
• Standard Life Cycle
UF UberFire
Monday, 5 August 13
UberFire
104
@Dependent
@WorkbenchScreen(identifier = "MyFirstPanel")
public class MyFirstPanel {
private final FlowPanel panel = new FlowPanel();
@PostConstruct
private void init() {
final Label label = new Label();
label.setText("Hello World!");
panel.add(label);
}
@WorkbenchPartTitle
public String myTitle() {
return "My First and Cool Panel!";
}
@WorkbenchPartView
public IsWidget getView() {
return panel;
}
}
Monday, 5 August 13
Proof is in the Pudding
•UI Rewrite started in November
•Entire BRMS ported
•New BPMS built, all integrated
•Tasks, Calendars, BPM Designer
•Only one person on core UI framework
•All team memebers distributed
•Despite aggressive schedule
•Code remains modular
•Easy to maintan and extend
•No one is complaining yet :)
105
UF UberFire
Monday, 5 August 13
106
Questions?Questions?
• Dave Bowman: All right, HAL; I'll go in
through the emergency airlock.
• HAL: Without your space helmet, Dave,
you're going to find that rather difficult.
• Dave Bowman: HAL, I won't argue with
you anymore! Open the doors!
• HAL: Dave, this conversation can serve
no purpose anymore. Goodbye.
Joshya: Greetings, Professor Falken.
Falken: Hello, Joshua.
Joshya: A strange game. The only winning move is not
to play. How about a nice game of chess?
Monday, 5 August 13

Más contenido relacionado

La actualidad más candente

Drools, jBPM OptaPlanner presentation
Drools, jBPM OptaPlanner presentationDrools, jBPM OptaPlanner presentation
Drools, jBPM OptaPlanner presentationMark Proctor
 
JUDCon India 2012 Drools Expert
JUDCon  India 2012 Drools ExpertJUDCon  India 2012 Drools Expert
JUDCon India 2012 Drools ExpertMark Proctor
 
Drools 6.0 (CamelOne 2013)
Drools 6.0 (CamelOne 2013)Drools 6.0 (CamelOne 2013)
Drools 6.0 (CamelOne 2013)Mark Proctor
 
2012 02-04 fosdem 2012 - drools planner
2012 02-04 fosdem 2012 - drools planner2012 02-04 fosdem 2012 - drools planner
2012 02-04 fosdem 2012 - drools plannerGeoffrey De Smet
 
Azure SQL Database - Connectivity Best Practices
Azure SQL Database - Connectivity Best PracticesAzure SQL Database - Connectivity Best Practices
Azure SQL Database - Connectivity Best PracticesJose Manuel Jurado Diaz
 
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KZepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KThomas Fuchs
 
Client-side Rendering with AngularJS
Client-side Rendering with AngularJSClient-side Rendering with AngularJS
Client-side Rendering with AngularJSDavid Lapsley
 
PostgreSQL Open SV 2018
PostgreSQL Open SV 2018PostgreSQL Open SV 2018
PostgreSQL Open SV 2018artgillespie
 
Javascript Everywhere
Javascript EverywhereJavascript Everywhere
Javascript EverywherePascal Rettig
 
20141001 delapsley-oc-openstack-final
20141001 delapsley-oc-openstack-final20141001 delapsley-oc-openstack-final
20141001 delapsley-oc-openstack-finalDavid Lapsley
 
Lowering in C#: What really happens with your code?, from NDC Oslo 2019
Lowering in C#: What really happens with your code?, from NDC Oslo 2019Lowering in C#: What really happens with your code?, from NDC Oslo 2019
Lowering in C#: What really happens with your code?, from NDC Oslo 2019David Wengier
 
Universal JavaScript
Universal JavaScriptUniversal JavaScript
Universal JavaScript名辰 洪
 
A (very) opinionated guide to MSBuild and Project Files
A (very) opinionated guide to MSBuild and Project FilesA (very) opinionated guide to MSBuild and Project Files
A (very) opinionated guide to MSBuild and Project FilesDavid Wengier
 
Drools 6 deep dive
Drools 6 deep diveDrools 6 deep dive
Drools 6 deep diveMario Fusco
 
Powershell for Log Analysis and Data Crunching
 Powershell for Log Analysis and Data Crunching Powershell for Log Analysis and Data Crunching
Powershell for Log Analysis and Data CrunchingMichelle D'israeli
 
Integrating React.js with PHP projects
Integrating React.js with PHP projectsIntegrating React.js with PHP projects
Integrating React.js with PHP projectsIgnacio Martín
 
Codestrong 2012 breakout session hacking titanium
Codestrong 2012 breakout session   hacking titaniumCodestrong 2012 breakout session   hacking titanium
Codestrong 2012 breakout session hacking titaniumAxway Appcelerator
 
Python: the coolest is yet to come
Python: the coolest is yet to comePython: the coolest is yet to come
Python: the coolest is yet to comePablo Enfedaque
 

La actualidad más candente (20)

Drools, jBPM OptaPlanner presentation
Drools, jBPM OptaPlanner presentationDrools, jBPM OptaPlanner presentation
Drools, jBPM OptaPlanner presentation
 
JBoss World 2011 - Drools
JBoss World 2011 - DroolsJBoss World 2011 - Drools
JBoss World 2011 - Drools
 
JUDCon India 2012 Drools Expert
JUDCon  India 2012 Drools ExpertJUDCon  India 2012 Drools Expert
JUDCon India 2012 Drools Expert
 
Drools 6.0 (CamelOne 2013)
Drools 6.0 (CamelOne 2013)Drools 6.0 (CamelOne 2013)
Drools 6.0 (CamelOne 2013)
 
2012 02-04 fosdem 2012 - drools planner
2012 02-04 fosdem 2012 - drools planner2012 02-04 fosdem 2012 - drools planner
2012 02-04 fosdem 2012 - drools planner
 
Azure SQL Database - Connectivity Best Practices
Azure SQL Database - Connectivity Best PracticesAzure SQL Database - Connectivity Best Practices
Azure SQL Database - Connectivity Best Practices
 
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KZepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
 
Client-side Rendering with AngularJS
Client-side Rendering with AngularJSClient-side Rendering with AngularJS
Client-side Rendering with AngularJS
 
PostgreSQL Open SV 2018
PostgreSQL Open SV 2018PostgreSQL Open SV 2018
PostgreSQL Open SV 2018
 
Javascript Everywhere
Javascript EverywhereJavascript Everywhere
Javascript Everywhere
 
20141001 delapsley-oc-openstack-final
20141001 delapsley-oc-openstack-final20141001 delapsley-oc-openstack-final
20141001 delapsley-oc-openstack-final
 
Lowering in C#: What really happens with your code?, from NDC Oslo 2019
Lowering in C#: What really happens with your code?, from NDC Oslo 2019Lowering in C#: What really happens with your code?, from NDC Oslo 2019
Lowering in C#: What really happens with your code?, from NDC Oslo 2019
 
Universal JavaScript
Universal JavaScriptUniversal JavaScript
Universal JavaScript
 
A (very) opinionated guide to MSBuild and Project Files
A (very) opinionated guide to MSBuild and Project FilesA (very) opinionated guide to MSBuild and Project Files
A (very) opinionated guide to MSBuild and Project Files
 
Drools 6 deep dive
Drools 6 deep diveDrools 6 deep dive
Drools 6 deep dive
 
Powershell for Log Analysis and Data Crunching
 Powershell for Log Analysis and Data Crunching Powershell for Log Analysis and Data Crunching
Powershell for Log Analysis and Data Crunching
 
RicoLiveGrid
RicoLiveGridRicoLiveGrid
RicoLiveGrid
 
Integrating React.js with PHP projects
Integrating React.js with PHP projectsIntegrating React.js with PHP projects
Integrating React.js with PHP projects
 
Codestrong 2012 breakout session hacking titanium
Codestrong 2012 breakout session   hacking titaniumCodestrong 2012 breakout session   hacking titanium
Codestrong 2012 breakout session hacking titanium
 
Python: the coolest is yet to come
Python: the coolest is yet to comePython: the coolest is yet to come
Python: the coolest is yet to come
 

Destacado

Red Hat Summit 2015 : Drools, jBPM and UberFire Roadmaps
Red Hat Summit 2015 : Drools, jBPM and UberFire RoadmapsRed Hat Summit 2015 : Drools, jBPM and UberFire Roadmaps
Red Hat Summit 2015 : Drools, jBPM and UberFire RoadmapsMark Proctor
 
Webinar get move_on_with_bpmsuite6
Webinar get move_on_with_bpmsuite6Webinar get move_on_with_bpmsuite6
Webinar get move_on_with_bpmsuite6Eric D. Schabell
 
xPaaS – day in the life of a modern application developer
xPaaS – day in the life of a modern application developerxPaaS – day in the life of a modern application developer
xPaaS – day in the life of a modern application developerEric D. Schabell
 
A Guide to Modern BPM Integration
A Guide to Modern BPM IntegrationA Guide to Modern BPM Integration
A Guide to Modern BPM IntegrationEric D. Schabell
 
Streaming datasets for personalization
Streaming datasets for personalizationStreaming datasets for personalization
Streaming datasets for personalizationShriya Arora
 
(BDT318) How Netflix Handles Up To 8 Million Events Per Second
(BDT318) How Netflix Handles Up To 8 Million Events Per Second(BDT318) How Netflix Handles Up To 8 Million Events Per Second
(BDT318) How Netflix Handles Up To 8 Million Events Per SecondAmazon Web Services
 

Destacado (7)

Red Hat Summit 2015 : Drools, jBPM and UberFire Roadmaps
Red Hat Summit 2015 : Drools, jBPM and UberFire RoadmapsRed Hat Summit 2015 : Drools, jBPM and UberFire Roadmaps
Red Hat Summit 2015 : Drools, jBPM and UberFire Roadmaps
 
Webinar get move_on_with_bpmsuite6
Webinar get move_on_with_bpmsuite6Webinar get move_on_with_bpmsuite6
Webinar get move_on_with_bpmsuite6
 
xPaaS – day in the life of a modern application developer
xPaaS – day in the life of a modern application developerxPaaS – day in the life of a modern application developer
xPaaS – day in the life of a modern application developer
 
A Guide to Modern BPM Integration
A Guide to Modern BPM IntegrationA Guide to Modern BPM Integration
A Guide to Modern BPM Integration
 
Streaming datasets for personalization
Streaming datasets for personalizationStreaming datasets for personalization
Streaming datasets for personalization
 
(BDT318) How Netflix Handles Up To 8 Million Events Per Second
(BDT318) How Netflix Handles Up To 8 Million Events Per Second(BDT318) How Netflix Handles Up To 8 Million Events Per Second
(BDT318) How Netflix Handles Up To 8 Million Events Per Second
 
Netflix Data Pipeline With Kafka
Netflix Data Pipeline With KafkaNetflix Data Pipeline With Kafka
Netflix Data Pipeline With Kafka
 

Similar a What's new in Drools 6 - London JBUG 2013

Hybrid rule engines (rulesfest 2010)
Hybrid rule engines (rulesfest 2010)Hybrid rule engines (rulesfest 2010)
Hybrid rule engines (rulesfest 2010)Geoffrey De Smet
 
2011-03-29 London - drools
2011-03-29 London - drools2011-03-29 London - drools
2011-03-29 London - droolsGeoffrey De Smet
 
Buenos Aires Drools Expert Presentation
Buenos Aires Drools Expert PresentationBuenos Aires Drools Expert Presentation
Buenos Aires Drools Expert PresentationMark Proctor
 
Drools New York City workshop 2011
Drools New York City workshop 2011Drools New York City workshop 2011
Drools New York City workshop 2011Geoffrey De Smet
 
Drooling for drools (JBoss webex)
Drooling for drools (JBoss webex)Drooling for drools (JBoss webex)
Drooling for drools (JBoss webex)Geoffrey De Smet
 
Agile Data Science 2.0: Using Spark with MongoDB
Agile Data Science 2.0: Using Spark with MongoDBAgile Data Science 2.0: Using Spark with MongoDB
Agile Data Science 2.0: Using Spark with MongoDBRussell Jurney
 
Rules Programming tutorial
Rules Programming tutorialRules Programming tutorial
Rules Programming tutorialSrinath Perera
 
Agile Data Science 2.0
Agile Data Science 2.0Agile Data Science 2.0
Agile Data Science 2.0Russell Jurney
 
JBoss Drools and Drools Fusion (CEP): Making Business Rules react to RTE
JBoss Drools and Drools Fusion (CEP): Making Business Rules react to RTEJBoss Drools and Drools Fusion (CEP): Making Business Rules react to RTE
JBoss Drools and Drools Fusion (CEP): Making Business Rules react to RTEtsurdilovic
 
Agile data presentation 3 - cambridge
Agile data   presentation 3 - cambridgeAgile data   presentation 3 - cambridge
Agile data presentation 3 - cambridgeRomans Malinovskis
 
Salesforce Batch processing - Atlanta SFUG
Salesforce Batch processing - Atlanta SFUGSalesforce Batch processing - Atlanta SFUG
Salesforce Batch processing - Atlanta SFUGvraopolisetti
 
When you need more data in less time...
When you need more data in less time...When you need more data in less time...
When you need more data in less time...Bálint Horváth
 
Agile Data Science 2.0
Agile Data Science 2.0Agile Data Science 2.0
Agile Data Science 2.0Russell Jurney
 
Droolsand Rule Based Systems 2008 Srping
Droolsand Rule Based Systems 2008 SrpingDroolsand Rule Based Systems 2008 Srping
Droolsand Rule Based Systems 2008 SrpingSrinath Perera
 
RivieraJUG - MySQL Indexes and Histograms
RivieraJUG - MySQL Indexes and HistogramsRivieraJUG - MySQL Indexes and Histograms
RivieraJUG - MySQL Indexes and HistogramsFrederic Descamps
 
Oracle PBCS Calculating Depreciation
Oracle PBCS Calculating DepreciationOracle PBCS Calculating Depreciation
Oracle PBCS Calculating DepreciationRati Sharma
 
AWS Security in Your Sleep: Build End-to-End Automation for IR Workflows (SEC...
AWS Security in Your Sleep: Build End-to-End Automation for IR Workflows (SEC...AWS Security in Your Sleep: Build End-to-End Automation for IR Workflows (SEC...
AWS Security in Your Sleep: Build End-to-End Automation for IR Workflows (SEC...Amazon Web Services
 
Wave Analytics: Developing Predictive Business Intelligence Apps
Wave Analytics: Developing Predictive Business Intelligence AppsWave Analytics: Developing Predictive Business Intelligence Apps
Wave Analytics: Developing Predictive Business Intelligence AppsSalesforce Developers
 
Advance Sql Server Store procedure Presentation
Advance Sql Server Store procedure PresentationAdvance Sql Server Store procedure Presentation
Advance Sql Server Store procedure PresentationAmin Uddin
 

Similar a What's new in Drools 6 - London JBUG 2013 (20)

Hybrid rule engines (rulesfest 2010)
Hybrid rule engines (rulesfest 2010)Hybrid rule engines (rulesfest 2010)
Hybrid rule engines (rulesfest 2010)
 
2011-03-29 London - drools
2011-03-29 London - drools2011-03-29 London - drools
2011-03-29 London - drools
 
Buenos Aires Drools Expert Presentation
Buenos Aires Drools Expert PresentationBuenos Aires Drools Expert Presentation
Buenos Aires Drools Expert Presentation
 
Drools New York City workshop 2011
Drools New York City workshop 2011Drools New York City workshop 2011
Drools New York City workshop 2011
 
Drooling for drools (JBoss webex)
Drooling for drools (JBoss webex)Drooling for drools (JBoss webex)
Drooling for drools (JBoss webex)
 
Agile Data Science 2.0: Using Spark with MongoDB
Agile Data Science 2.0: Using Spark with MongoDBAgile Data Science 2.0: Using Spark with MongoDB
Agile Data Science 2.0: Using Spark with MongoDB
 
Rules Programming tutorial
Rules Programming tutorialRules Programming tutorial
Rules Programming tutorial
 
Agile Data Science 2.0
Agile Data Science 2.0Agile Data Science 2.0
Agile Data Science 2.0
 
JBoss Drools and Drools Fusion (CEP): Making Business Rules react to RTE
JBoss Drools and Drools Fusion (CEP): Making Business Rules react to RTEJBoss Drools and Drools Fusion (CEP): Making Business Rules react to RTE
JBoss Drools and Drools Fusion (CEP): Making Business Rules react to RTE
 
Agile data presentation 3 - cambridge
Agile data   presentation 3 - cambridgeAgile data   presentation 3 - cambridge
Agile data presentation 3 - cambridge
 
Salesforce Batch processing - Atlanta SFUG
Salesforce Batch processing - Atlanta SFUGSalesforce Batch processing - Atlanta SFUG
Salesforce Batch processing - Atlanta SFUG
 
When you need more data in less time...
When you need more data in less time...When you need more data in less time...
When you need more data in less time...
 
Speeding up big data with event processing
Speeding up big data with event processingSpeeding up big data with event processing
Speeding up big data with event processing
 
Agile Data Science 2.0
Agile Data Science 2.0Agile Data Science 2.0
Agile Data Science 2.0
 
Droolsand Rule Based Systems 2008 Srping
Droolsand Rule Based Systems 2008 SrpingDroolsand Rule Based Systems 2008 Srping
Droolsand Rule Based Systems 2008 Srping
 
RivieraJUG - MySQL Indexes and Histograms
RivieraJUG - MySQL Indexes and HistogramsRivieraJUG - MySQL Indexes and Histograms
RivieraJUG - MySQL Indexes and Histograms
 
Oracle PBCS Calculating Depreciation
Oracle PBCS Calculating DepreciationOracle PBCS Calculating Depreciation
Oracle PBCS Calculating Depreciation
 
AWS Security in Your Sleep: Build End-to-End Automation for IR Workflows (SEC...
AWS Security in Your Sleep: Build End-to-End Automation for IR Workflows (SEC...AWS Security in Your Sleep: Build End-to-End Automation for IR Workflows (SEC...
AWS Security in Your Sleep: Build End-to-End Automation for IR Workflows (SEC...
 
Wave Analytics: Developing Predictive Business Intelligence Apps
Wave Analytics: Developing Predictive Business Intelligence AppsWave Analytics: Developing Predictive Business Intelligence Apps
Wave Analytics: Developing Predictive Business Intelligence Apps
 
Advance Sql Server Store procedure Presentation
Advance Sql Server Store procedure PresentationAdvance Sql Server Store procedure Presentation
Advance Sql Server Store procedure Presentation
 

Más de Mark Proctor

Rule Modularity and Execution Control
Rule Modularity and Execution ControlRule Modularity and Execution Control
Rule Modularity and Execution ControlMark Proctor
 
Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...
Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...
Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...Mark Proctor
 
Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)
Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)
Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)Mark Proctor
 
Drools Happenings 7.0 - Devnation 2016
Drools Happenings 7.0 - Devnation 2016Drools Happenings 7.0 - Devnation 2016
Drools Happenings 7.0 - Devnation 2016Mark Proctor
 
RuleML2015 : Hybrid Relational and Graph Reasoning
RuleML2015 : Hybrid Relational and Graph Reasoning RuleML2015 : Hybrid Relational and Graph Reasoning
RuleML2015 : Hybrid Relational and Graph Reasoning Mark Proctor
 
Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client TechnologyRed Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client TechnologyMark Proctor
 
Drools and jBPM 6 Overview
Drools and jBPM 6 OverviewDrools and jBPM 6 Overview
Drools and jBPM 6 OverviewMark Proctor
 
UberFire Quick Intro and Overview (early beta Aug 2013)
UberFire Quick Intro and Overview (early beta Aug 2013)UberFire Quick Intro and Overview (early beta Aug 2013)
UberFire Quick Intro and Overview (early beta Aug 2013)Mark Proctor
 
Property Reactive RuleML 2013
Property Reactive RuleML 2013Property Reactive RuleML 2013
Property Reactive RuleML 2013Mark Proctor
 
Reactive Transitive Closures with Drools (Backward Chaining)
Reactive Transitive Closures with Drools (Backward Chaining)Reactive Transitive Closures with Drools (Backward Chaining)
Reactive Transitive Closures with Drools (Backward Chaining)Mark Proctor
 
Drools 6.0 (JudCon 2013)
Drools 6.0 (JudCon 2013)Drools 6.0 (JudCon 2013)
Drools 6.0 (JudCon 2013)Mark Proctor
 
UberFire Quick Intro and Overview (early beta Jul 2013)
UberFire Quick Intro and Overview (early beta Jul 2013)UberFire Quick Intro and Overview (early beta Jul 2013)
UberFire Quick Intro and Overview (early beta Jul 2013)Mark Proctor
 
UberFire (JudCon 2013)
UberFire (JudCon 2013)UberFire (JudCon 2013)
UberFire (JudCon 2013)Mark Proctor
 
Drools 6.0 (Red Hat Summit 2013)
Drools 6.0 (Red Hat Summit 2013)Drools 6.0 (Red Hat Summit 2013)
Drools 6.0 (Red Hat Summit 2013)Mark Proctor
 
Games development with the Drools rule engine
Games development with the Drools rule engineGames development with the Drools rule engine
Games development with the Drools rule engineMark Proctor
 
Drools & jBPM future roadmap talk
Drools & jBPM future roadmap talkDrools & jBPM future roadmap talk
Drools & jBPM future roadmap talkMark Proctor
 
Drools @ IntelliFest 2012
Drools @ IntelliFest 2012Drools @ IntelliFest 2012
Drools @ IntelliFest 2012Mark Proctor
 
JUDCon India 2012 Drools Fusion
JUDCon  India 2012 Drools FusionJUDCon  India 2012 Drools Fusion
JUDCon India 2012 Drools FusionMark Proctor
 
Drools & jBPM Info Sheet
Drools & jBPM Info SheetDrools & jBPM Info Sheet
Drools & jBPM Info SheetMark Proctor
 
rules, events and workflow
rules, events and workflowrules, events and workflow
rules, events and workflowMark Proctor
 

Más de Mark Proctor (20)

Rule Modularity and Execution Control
Rule Modularity and Execution ControlRule Modularity and Execution Control
Rule Modularity and Execution Control
 
Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...
Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...
Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...
 
Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)
Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)
Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)
 
Drools Happenings 7.0 - Devnation 2016
Drools Happenings 7.0 - Devnation 2016Drools Happenings 7.0 - Devnation 2016
Drools Happenings 7.0 - Devnation 2016
 
RuleML2015 : Hybrid Relational and Graph Reasoning
RuleML2015 : Hybrid Relational and Graph Reasoning RuleML2015 : Hybrid Relational and Graph Reasoning
RuleML2015 : Hybrid Relational and Graph Reasoning
 
Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client TechnologyRed Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
 
Drools and jBPM 6 Overview
Drools and jBPM 6 OverviewDrools and jBPM 6 Overview
Drools and jBPM 6 Overview
 
UberFire Quick Intro and Overview (early beta Aug 2013)
UberFire Quick Intro and Overview (early beta Aug 2013)UberFire Quick Intro and Overview (early beta Aug 2013)
UberFire Quick Intro and Overview (early beta Aug 2013)
 
Property Reactive RuleML 2013
Property Reactive RuleML 2013Property Reactive RuleML 2013
Property Reactive RuleML 2013
 
Reactive Transitive Closures with Drools (Backward Chaining)
Reactive Transitive Closures with Drools (Backward Chaining)Reactive Transitive Closures with Drools (Backward Chaining)
Reactive Transitive Closures with Drools (Backward Chaining)
 
Drools 6.0 (JudCon 2013)
Drools 6.0 (JudCon 2013)Drools 6.0 (JudCon 2013)
Drools 6.0 (JudCon 2013)
 
UberFire Quick Intro and Overview (early beta Jul 2013)
UberFire Quick Intro and Overview (early beta Jul 2013)UberFire Quick Intro and Overview (early beta Jul 2013)
UberFire Quick Intro and Overview (early beta Jul 2013)
 
UberFire (JudCon 2013)
UberFire (JudCon 2013)UberFire (JudCon 2013)
UberFire (JudCon 2013)
 
Drools 6.0 (Red Hat Summit 2013)
Drools 6.0 (Red Hat Summit 2013)Drools 6.0 (Red Hat Summit 2013)
Drools 6.0 (Red Hat Summit 2013)
 
Games development with the Drools rule engine
Games development with the Drools rule engineGames development with the Drools rule engine
Games development with the Drools rule engine
 
Drools & jBPM future roadmap talk
Drools & jBPM future roadmap talkDrools & jBPM future roadmap talk
Drools & jBPM future roadmap talk
 
Drools @ IntelliFest 2012
Drools @ IntelliFest 2012Drools @ IntelliFest 2012
Drools @ IntelliFest 2012
 
JUDCon India 2012 Drools Fusion
JUDCon  India 2012 Drools FusionJUDCon  India 2012 Drools Fusion
JUDCon India 2012 Drools Fusion
 
Drools & jBPM Info Sheet
Drools & jBPM Info SheetDrools & jBPM Info Sheet
Drools & jBPM Info Sheet
 
rules, events and workflow
rules, events and workflowrules, events and workflow
rules, events and workflow
 

Último

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 

Último (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

What's new in Drools 6 - London JBUG 2013

  • 1. 1 ● The SkyNet funding bill is passed. ●The system goes online on August 4th, 1997. ●Human decisions are removed from strategic defense. ●SkyNet begins to learn at a geometric rate. ●It becomes self-aware at 2:14am Eastern time, August 29th ●In a panic, they try to pull the plug. ●And, Skynet fights back Mark Proctor Project Lead Monday, 5 August 13
  • 2. Agenda •Quick Intro - What are Rule Based Systems •KIE •5.x Critique •6.0 Improvements •UI •Content •Deployment •Spring and Camel •API •CDI •ScoreCards and PMML •JTMS •Phreak •Legacy Migrations •Backward chaining Example •UberFire 2 Monday, 5 August 13
  • 3. Quick Intro What are Rule Based Systems 3 Monday, 5 August 13
  • 4. 4 Vision Robotics Speech Neural Nets Rule Base Systems/ Expert System Tools Understanding Natural LanguageSome Areas of Artificial Intelligence Some Areas of Artificial Intelligence Monday, 5 August 13
  • 5. 5 Knowledge Representation and Reasoning The study of Knowledge is Epistemology ● Nature Structure and Origins of Knowledge ● Core or AI Rule based systems ● Expert System tools ● Knowledge Representation and Reasoning ● Facilitate the codification of knowledge into a knowledge base which can be used for reasoning Monday, 5 August 13
  • 6. 6 It All Started Here Birth of CDSS Dendral Mycin Baobab Guidon Neomycin Teiresias Emycin WM Puff Sacon Centaur Gravida Wheeze Clot Onccocin 1970s 1980s Monday, 5 August 13
  • 7. 7 Because Not Everyone Is As Smart As He Is Monday, 5 August 13
  • 8. 1979 Rete Algorithm by Charles Forgy 8 Monday, 5 August 13
  • 9. Clips and Jess Clips 1986 9 Clips 1995 Monday, 5 August 13
  • 10. 10 And some day we'll build him!!! Monday, 5 August 13
  • 11. 11 What is a Rule rule <rule_name> <attribute><value> when <conditions> then <actions> end Monday, 5 August 13
  • 12. 12 Pattern Matching Person( age >= 18 ) field name restriction constraintobject type pattern Monday, 5 August 13
  • 14. 14Classes AccountAccount long accountNo int balance CashFlowCashFlow Date date int amount AccountPeriodAccountPeriod Date start Date end Monday, 5 August 13
  • 15. 15 rule “increase balance for AccountPeriod Credits” when ap : AccountPeriod() acc : Account( $accountNo : accountNo ) CashFlow( type == CREDIT, accountNo == $accountNo, date >= ap.start && <= ap.end, $ammount : ammount ) then acc.balance += $amount; end select * from Account acc, Cashflow cf, AccountPeriod ap where acc.accountNo == cf.accountNo and cf.type == CREDIT cf.date >= ap.start and cf.date <= ap.end trigger : acc.balance += cf.amount Credit Cashflow Rule Monday, 5 August 13
  • 16. 16 rule “increase balance for AccountPeriod Credits” when ap : AccountPeriod() acc : Account( $accountNo : accountNo ) CashFlow( type == CREDIT, accountNo == $accountNo, date >= ap.start && <= ap.end, $ammount : ammount ) then acc.balance += $amount; end select * from Account acc, Cashflow cf, AccountPeriod ap where acc.accountNo == cf.accountNo and cf.type == CREDIT cf.date >= ap.start and cf.date <= ap.end trigger : acc.balance += cf.amount Credit Cashflow Rule Monday, 5 August 13
  • 17. 17 rule “increase balance for AccountPeriod Credits” when ap : AccountPeriod() acc : Account( $accountNo : accountNo ) CashFlow( type == CREDIT, accountNo == $accountNo, date >= ap.start && <= ap.end, $ammount : ammount ) then acc.balance += $amount; end select * from Account acc, Cashflow cf, AccountPeriod ap where acc.accountNo == cf.accountNo and cf.type == CREDIT cf.date >= ap.start and cf.date <= ap.end trigger : acc.balance += cf.amount Credit Cashflow Rule Monday, 5 August 13
  • 18. 18 rule “increase balance for AccountPeriod Credits” when ap : AccountPeriod() acc : Account( $accountNo : accountNo ) CashFlow( type == CREDIT, accountNo == $accountNo, date >= ap.start && <= ap.end, $ammount : ammount ) then acc.balance += $amount; end select * from Account acc, Cashflow cf, AccountPeriod ap where acc.accountNo == cf.accountNo and cf.type == CREDIT cf.date >= ap.start and cf.date <= ap.end trigger : acc.balance += cf.amount Credit Cashflow Rule Monday, 5 August 13
  • 19. 19 Rules as a “view” rule "Increase balance for AccountPeriod Credits" when ap : AccountPeriod( ) acc : Account( ) cf : CashFlow( type == CashFlowType.CREDIT, accountNo == acc.accountNo, date >= ap.start && <= ap.end ) then acc.balance = acc.balance + cf.amount; end rule "Decrease balance for AccountPeriod Debits" when ap : AccountPeriod( ) acc : Account( ) cf : CashFlow( type == CashFlowType.DEBIT, accountNo == acc.accountNo, date >= ap.start && <= ap.end ) then acc.balance = acc.balance - cf.amount; end CashFlowCashFlowCashFlowCashFlow date amount type accountNo 12-Jan-12 100 CREDIT 1 2-Feb-12 200 DEBIT 1 18-May-12 50 CREDIT 1 9-May-12 75 CREDIT 1 AccountingPeriodAccountingPeriod start end 01-JAN-2012 31-MAR-2012 AccountAccount accountNo balance 1 0 CashFlowCashFlowCashFlowCashFlow date amount type accountNo 12-Jan-12 100 CREDIT 1 9-May-12 75 CREDIT 1 CashFlowCashFlowCashFlowCashFlow date amount type accountNo 2-Feb-12 200 DEBIT 1 AccountAccount accountNo balance 1 -25 Monday, 5 August 13
  • 20. 20 rule "Print blance for AccountPeriod" salience -50 when ap : AccountPeriod() acc : Account( ) then System.out.println( "Account Number " + acc.accountNo + " balance " + acc.balance ); end Conflict Resolution with Salience AgendaAgendaAgenda 1 increase balance arbitrary 2 decrease balance arbitrary 3 increase balance arbitrary 4 print balance Monday, 5 August 13
  • 21. 21 rule “increase balance for AccountPeriod Credits” ruleflow-group “calculation” when ap : AccountPeriod() acc : Account( $accountNo : accountNo ) CashFlow( type == CREDIT, accountNo == $accountNo, date >= ap.start && <= ap.end, $ammount : ammount ) then acc.balance += $amount; end rule “Print blance for AccountPeriod” ruleflow-group “report” when ap : AccountPeriod() acc : Account( ) then System.out.println( acc.accountNo + “ : “ acc.balance ); end ruleflow-group RuleFlow Monday, 5 August 13
  • 23. Knowledge Is Everything Platform Changes Overview 23 Monday, 5 August 13
  • 24. KIE - Knowledge Is Everything 24 KIE Drools jBPMOptaPlanner UberFire Guvnor Drools-WB jBPM-WB KIE-WB Monday, 5 August 13
  • 27. Changes Conventions: •droolsjbpm -> kie •knowlege -> kie Examples •KnowledgeBase -> Kie •StatefulKnowledgeSession -> KieSession •StatelessKnowledgeSession - StatelesKieSession Legacy API Adapter JAR •Most API’s should work with legacy adapter •KnowledegAgents have not been ported, PKG’s are not longer the unit of deployment DRL has not changed 27 Monday, 5 August 13
  • 30. 5.x Critique UI •GWT •but not easily extended •fixed layouts •no perspectives 30 Monday, 5 August 13
  • 31. 5.x Critique Content •JCR •Performance issues •Everything stored as a blob •No tagging, branching etc. •Webdav, with limited Eclipse team provider integration. •Single tree structure (packages) •Packages created project deployment units •no real alignment with industry stadard •No easy rule use (only a single global area) •Loading “model” jars into packages •Poor hack, for dependency management 31 Monday, 5 August 13
  • 32. 5.x Critique 32 Deployment •Simple Snapshot system •No real methodology •Doesn’t align with any industry standards Monday, 5 August 13
  • 33. 5.x Critique Utilize •Progmatic API only •Have to select all resources 33 KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); kbuilder.batch().add( newClassPathResource( "Model.drl", getClass() ), DRL ) .add( newClassPathResource( "Queries.drl", getClass() ), DRL ) .add( newClassPathResource( "General.drl", getClass() ), DRL ) .add( newClassPathResource( "Response.drl", getClass() ), DRL ) .add( newClassPathResource( "Events.drl", getClass() ), DRL ) .add( newClassPathResource( "UiView.drl", getClass() ), DRL ) .add( newClassPathResource( "Commands.drl", getClass() ), DRL ).build(); if ( kbuilder.hasErrors() ) { System.out.println( kbuilder.getErrors().toString() ); System.exit( 1 ); } KieBaseConfiguration kbaseConf = KnowledgeBaseFactory.newKnowledgeBaseConfiguration(); kbaseConf.setOption( EqualityBehaviorOption.EQUALITY ); KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase( kbaseConf ); kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() ); Counter c = new Counter(); ksession = kbase.newStatefulKnowledgeSession(); Monday, 5 August 13
  • 35. 6.0 UI UI •Modular •Extensible 35 •Dynamic and Flexible layouts •Perspectives UF Monday, 5 August 13
  • 37. 6.0 UI 38 Monday, 5 August 13
  • 38. 6.0 UI Content and Authoring Improvements 39 Monday, 5 August 13
  • 39. 6.0 Content •GIT •Industry standard tooling •Multiple repositories and projects •All projects are Maven multi-module projects •Projects can be shared, via pom dependencies •Both Kie projects, and any other maven jar •Local Maven repository management for model jars 40 Monday, 5 August 13
  • 40. 6.0 Content Simple POM Editor 41 Monday, 5 August 13
  • 41. 6.0 Content Build And Deploy 42 Monday, 5 August 13
  • 42. 6.0 Content Local Maven repository and manager 43 Monday, 5 August 13
  • 43. Video Maven, Builder an Deploy https://www.youtube.com/watch?v=ckAznbOOV-4 44 Monday, 5 August 13
  • 44. 6.0 Content Create or Clone Git Repositories 46 Monday, 5 August 13
  • 46. 6.0 Deployment 48 Deployment •Maven JARS •All projects are just maven projects •All projects compile to JARS •JARS are installed to local M2_REPO, which is expose on http •Can “deploy” to external repos. •Uses Maven industry methdologies Monday, 5 August 13
  • 48. KieModules •Discovery •META-INF/kmodule.xml •Convention based •No programmatic api for building •Multiple Named entities •Inheritence of Resources •Defaults for lazy people •Version built in a standard 50 Monday, 5 August 13
  • 50. KieModules Defaults and JAR on Classpath •Creates one KieBase, adds all resources from that JAR •See kmodule.xsd in kie-api jar 52 <kmodule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://jboss.org/kie/6.0.0/kmodule"> </kmodule> KieServices ks = KieServices.Factory.get(); KieContainer kContainer = ks.getKieClasspathContainer(); KieSession kSession = kContainer.newKieSession(); kSession.setGlobal("out", out); kSession.insert(new Message("Dave", "Hello, HAL. Do you read me, HAL?")); kSession.fireAllRules(); Monday, 5 August 13
  • 52. KieModules Named Entities and JAR on Classpath •Creates one KieBase •Includes resources from package matching kbase name 54 <kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule"> <kbase name="namedkiesession"> <ksession name="ksession1"/> </kbase> </kmodule> KieServices ks = KieServices.Factory.get(); KieContainer kContainer = ks.getKieClasspathContainer(); KieSession kSession = kContainer.newKieSession("ksession1"); kSession.setGlobal("out", out); kSession.insert(new Message("Dave", "Hello, HAL. Do you read me, HAL?")); kSession.fireAllRules(); Monday, 5 August 13
  • 54. KieModules Named Entities, with inheritence and JAR on Classpath •Two projects, one “includes” from the other 56 <dependency> <groupId>org.drools</groupId> <artifactId>named-kiesession</artifactId> <version>6.0.0-SNAPSHOT</version> </dependency> <kbase name="kiebaseinclusion" includes="namedkiebase"> <ksession name="ksession2"/> </kbase> KieServices ks = KieServices.Factory.get(); KieContainer kContainer = ks.getKieClasspathContainer(); KieSession kSession = kContainer.newKieSession("ksession2"); kSession.setGlobal("out", out); kSession.insert(new Message("Dave", "Hello, HAL. Do you read me, HAL?")); kSession.fireAllRules(); kSession.insert(new Message("Dave", "Open the pod bay doors, HAL.")); kSession.fireAllRules(); Monday, 5 August 13
  • 55. KieModules Package location can over-ride kbase name defaults 57 <kbase name="WumpusMainKB" packages="org.drools.games.wumpus.server, org.drools.games.wumpus.server.view"> <ksession name="WumpusMainKS" /> </kbase> <kbase name="WumpusClientKB" packages="org.drools.games.wumpus.client"> <ksession name="WumpusClientKS"/> </kbase> KieContainer kc = KieServices.Factory.get().getKieClasspathContainer(); final KieSession serverKsession = kc.newKieSession( "WumpusMainKS"); final KieSession clientKsession = kc.newKieSession("WumpusClientKS"); Monday, 5 August 13
  • 56. Dynamic KieModules •JARs can be loaded from URLs into KieRepository •Once loaded they can be resolved via ReleaseId 58 KieServices ks = KieServices.Factory.get(); KieRepository kr = ks.getRepository(); KieModule kModule = kr.addKieModule(ks.getResources().newFileSystemResource( getFile("default-kiesession"))); KieContainer kContainer = ks.newKieContainer(kModule.getReleaseId()); KieSession kSession = kContainer.newKieSession(); kSession.setGlobal("out", out); Object msg1 = createMessage(kContainer, "Dave", "Hello, HAL. Do you read me, HAL?"); kSession.insert(msg1); kSession.fireAllRules(); Monday, 5 August 13
  • 57. Dynamic KieModules kie-ci use embedded maven for remote discovery 59 <dependency> <groupId>org.kie</groupId> <artifactId>kie-ci</artifactId> </dependency> KieServices ks = KieServices.Factory.get(); // Install example1 in the local maven repo before to do this KieContainer kContainer = ks.newKieContainer( ks.newReleaseId("org.drools", "named-kiesession", "6.0.0-SNAPSHOT")); KieSession kSession = kContainer.newKieSession("ksession1"); kSession.setGlobal("out", out); Object msg1 = createMessage(kContainer, "Dave", "Hello, HAL. Do you read me, HAL?"); kSession.insert(msg1); kSession.fireAllRules(); Monday, 5 August 13
  • 58. Dynamic Modules •Kie-CI and Automatic updates with KieScanner •Replaces KnowledgeAgent •Mave resolves new artifacts dynamically at runtime •SNAPSHOT, LATEST, STABLE and version ranges supported •See KieRepositoryScannerTest 60 KieServices ks = KieServices.Factory.get(); ReleaseId releaseId = ks.newReleaseId("org.kie", "scanner-test", "1.0-SNAPSHOT"); InternalKieModule kJar1 = createKieJar(ks, releaseId, "rule1", "rule2"); KieContainer kieContainer = ks.newKieContainer(releaseId); MavenRepository repository = getMavenRepository(); repository.deployArtifact(releaseId, kJar1, kPom); // create a ksesion and check it works as expected KieSession ksession = kieContainer.newKieSession("KSession1"); checkKSession(ksession, "rule1", "rule2"); Monday, 5 August 13
  • 59. Dynamic Modules 61 // create a new kjar InternalKieModule kJar2 = createKieJar(ks, releaseId, "rule2", "rule3"); // deploy it on maven repository.deployArtifact(releaseId, kJar2, kPom); // since I am not calling start() on the scanner it means it won't have automatic scheduled scanning KieScanner scanner = ks.newKieScanner(kieContainer); // scan the maven repo to get the new kjar version and deploy it on the kcontainer scanner.scanNow(); // create a ksesion and check it works as expected KieSession ksession2 = kieContainer.newKieSession("KSession1"); checkKSession(ksession2, "rule2", "rule3"); Monday, 5 August 13
  • 60. Programmatic API •Builder API, for tooling integration •Incremental compilation, and problem reporting 62 KieServices ks = KieServices.Factory.get(); KieRepository kr = ks.getRepository(); KieFileSystem kfs = ks.newKieFileSystem(); kfs.write("src/main/resources/org/kie/example5/HAL5.drl", getRule()); KieBuilder kb = ks.newKieBuilder(kfs); kb.buildAll(); // kieModule is automatically deployed to KieRepository if successfully built. if (kb.getResults().hasMessages(Level.ERROR)) { throw new RuntimeException("Build Errors:n" + kb.getResults().toString()); } KieContainer kContainer = ks.newKieContainer(kr.getDefaultReleaseId()); KieSession kSession = kContainer.newKieSession(); kSession.setGlobal("out", out); kSession.insert(new Message("Dave", "Hello, HAL. Do you read me, HAL?")); kSession.fireAllRules(); Monday, 5 August 13
  • 67. 6.0 CDI 69 Monday, 5 August 13
  • 68. CDI Context and Dependency Injection CDI injects named entities from the kmodule.xml Injectable types •KieServices •KieContainer •KieBase •KieSession •StatelessKieSession 70 Monday, 5 August 13
  • 69. KieContainer 71 @Inject private KieContainer kContainer; @Inject @KReleaseId(groupId = "jar1", artifactId = "art1", version = "1.1") private KieContainer kContainerv11; Monday, 5 August 13
  • 70. KBase 72 @Inject @KBase(value="jar1.KBase1", name="kb2") @KReleaseId( groupId = "jar1", artifactId = "art1", version = "1.0") private KieBase jar1KBase1kb2; @Inject @KBase(value="jar1.KBase1", name="kb2") @KReleaseId( groupId = "jar1", artifactId = "art1", version = "1.0") private KieBase jar1KBase1kb22; @Inject private KieBase defaultClassPathKBase; @Inject @KReleaseId( groupId = "jar1", artifactId = "art1", version = "1.0") private KieBase defaultDynamicKBase; @Inject @KBase("jar1.KBase1") @KReleaseId( groupId = "jar1", artifactId = "art1", version = "1.0") private KieBase jar1KBase1v10; @Inject @KBase("jar1.KBase1") @KReleaseId(groupId = "jar1", artifactId = "art1", version = "1.1") private KieBase jar1KBase1v11; @Inject @KBase(value="jar1.KBase1", name="kb1") @KReleaseId( groupId = "jar1", artifactId = "art1", version = "1.0") private KieBase jar1KBase1kb1; Monday, 5 August 13
  • 71. KSession 73 @Inject private KieSession defaultClassPathKSession; @Inject @KReleaseId( groupId = "jar1", artifactId = "art1", version = "1.0") private KieSession defaultDynamicKSession; Monday, 5 August 13
  • 72. KSession 74 @Inject @KSession("jar1.KSession2") @KReleaseId( groupId = "jar1", artifactId = "art1", version = "1.0" ) private KieSession kbase1ksession2v10; @Inject @KSession("jar1.KSession2") @KReleaseId( groupId = "jar1", artifactId = "art1", version = "1.1" ) private KieSession kbase1ksession2v11; @Inject @KSession(value="jar1.KSession2", name="ks1") @KReleaseId( groupId = "jar1", artifactId = "art1", version = "1.0" ) private KieSession kbase1ksession2ks1; @Inject @KSession(value="jar1.KSession2", name="ks2") @KReleaseId( groupId = "jar1", artifactId = "art1", version = "1.0" ) private KieSession kbase1ksession2ks2 ; @Inject @KSession(value="jar1.KSession2", name="ks2") @KReleaseId( groupId = "jar1", artifactId = "art1", version = "1.0" ) private KieSession kbase1ksession2ks22; Monday, 5 August 13
  • 74. Score Cards a) Setup Parameters b) Characteristic Section 76 Monday, 5 August 13
  • 75. Score Cards 77 •UI Generates PMML •DRL Generated from PMML •DRL results in •Calculated Score •Ranked Reason Codes •Can import PMML 4.1 •but not exposed yet •Calculated Scores •Currently Summations •Weight coming •Not in PMML standard Monday, 5 August 13
  • 77. Justification-based Truth Maintenace JTMS Drools 5.x •Simple logical insertion TMS, like Clips, Jess and others. •Drools 6.0 •Contradiction handling with JTMS •Clean separation of exception logic •TMS now has pluggable Belief System •Simple TMS support •JTMS now possible. •Defeasible Logic soon •See drools-compiler •JTMSTest for lots of example tests •https://github.com/droolsjbpm/drools/blob/master/drools-compiler/ src/test/java/org/drools/compiler/beliefsystem/jtms/ JTMSTest.java 79 Monday, 5 August 13
  • 78. 80 JTMS rule "Issue Child Bus Pass" when $p : Person( age < 16 ) then insert(new ChildBusPass( $p ) ); end rule "Issue Adult Bus Pass" when $p : Person( age >= 16 ) then insert(new AdultBusPass( $p ) ); end Couples the logic What happens when the Child stops being 16? Monday, 5 August 13
  • 79. 81 JTMS •Bad •Monolithic •Leaky •Brittle integrity - manual maintenance Monday, 5 August 13
  • 80. 82 JTMS •A rule “logically” inserts an object •When the rule is no longer true, the object is retracted. rule "IsChild" when $p : Person( age < 16 ) then logicalInsert( new IsChild( $p ) ) end rule "IsAdult" when $p : Person( age >= 16 ) then logicalInsert( new IsAdult( $p ) ) end de-couples the logic Maintains the truth by automatically retracting Monday, 5 August 13
  • 81. 83 JTMS rule "Issue Child Bus Pass" when $p : Person( ) IsChild( person =$p ) then logicalInsert(new ChildBusPass( $p ) ); end rule "Issue Adult Bus Pass" when $p : Person() IsAdult( person =$p ) then logicalInsert(new AdultBusPass( $p ) ); end The truth maintenance cascades Monday, 5 August 13
  • 82. 84 JTMS rule "Issue Child Bus Pass" when $p : Person( ) not( ChildBusPass( person == $p ) ) then requestChildBusPass( $p ); end The truth maintenance cascades Monday, 5 August 13
  • 83. 85 JTMS • Good • De-couple knowledge responsibilities • Encapsulate knowledge • Provide semantic abstractions for those encapsulation • Integrity robustness – truth maintenance Monday, 5 August 13
  • 84. JTMS 86 IsChild ChildBusPas Rule : isChildRule Rule : IssueBusPas + + Monday, 5 August 13
  • 85. JTMS 87 rule "Do not issue to banned people" when $p : Person( ) Banned( person =$p ) then logicalInsert(new ChildBusPass( $p ) , “neg” ); end Monday, 5 August 13
  • 86. JTMS 88 IsChild ChildBusPas Rule : isChildRule Rule : IssueBusPas + + Rule : Do Not Issue to Banned People - Monday, 5 August 13
  • 87. R.I.P RETE inspirations: •Leaps, Collection Oriented Match, L/R Unlinking New Innovations •Full Rule, and Rule Segment Unlinking •Lazy Evaluation, with Rule scoping •Set propagations Previous Innovations •Modify In Place •Property Reactive •Tree Based Graphs •Subnetwork support 89 Monday, 5 August 13
  • 88. 6.0 Legacy and Backwards Compatability 90 Monday, 5 August 13
  • 89. Legacy Systems and Migration Legacy API Adapter JAR •Most API’s should work with legacy adapter •KnowledegAgents have not been ported, PKG’s are not longer the unit of deployment JCR Migration Tool •Command Line Java code •Each Package maps to a GIT project 91 Monday, 5 August 13
  • 90. Backward Chaining Re-introducing an Advanced Feature Detailed Tutorial here: https://www.youtube.com/watch?v=fCjIRVSRFvA 92 Monday, 5 August 13
  • 91. 93 Backward Chaining query isChild( Person p ) $p := Person( age <= 16 ) end rule "Issue Child Bus Pass" when $p : Person( ) isChild( $p; ) then logicalInsert(new ChildBusPass( $p ) ); end Monday, 5 August 13
  • 92. 94 Reasoning with Graphs House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Monday, 5 August 13
  • 93. 95 Backward Chaining query isContainedIn( String x, String y ) Location( x, y; ) or ( Location( z, y; ) and isContainedIn( x, z; ) ) end House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Monday, 5 August 13
  • 94. Backward Chaining 96 ksession.insert( new Location("Office", "House") ); ksession.insert( new Location("Kitchen", "House") ); ksession.insert( new Location("Knife", "Kitchen") ); ksession.insert( new Location("Cheese", "Kitchen") ); ksession.insert( new Location("Desk", "Office") ); ksession.insert( new Location("Chair", "Office") ); ksession.insert( new Location("Computer", "Desk") ); ksession.insert( new Location("Draw", "Desk") ); House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Monday, 5 August 13
  • 95. Backward Chaining 97 rule "go1" when String( this == "go1" ) isContainedIn("Office", "House"; ) then System.out.println( "office is in the house" ); end rule "go" salience 10 when $s : String( ) then System.out.println( $s ); end ksession.insert( "go1" ); ksession.fireAllRules(); --- go1 office is in the house query isContainedIn( String x, String y ) Location( x, y; ) or ( Location( z, y; ) and isContainedIn( x, z; ) ) end Does not recurse. Finds Location(“Office, House”) on first call. House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Monday, 5 August 13
  • 96. Backward Chaining 98 rule "go2" when String( this == "go2" ) isContainedIn("Draw", "House"; ) then System.out.println( "Draw in the House" ); end ksession.insert( "go2" ); ksession.fireAllRules(); --- go2 Desk in the House query isContainedIn( String x, String y ) Location( x, y; ) or ( Location( z, y; ) and isContainedIn( x, z; ) ) end Recursive 3 times, note the Z. Location( “Office”, “House”) Location( “Desk”, “Office”) Location( “Draw”, “Desk”) Out Var (unbound) In Var (bound) House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Monday, 5 August 13
  • 97. Backward Chaining 99 rule "go3" when String( this == "go3" ) isContainedIn("Key", "Office"; ) then System.out.println( "Key in the Office" ); end ksession.insert( "go3" ); ksession.fireAllRules(); --- go3 ksession.insert( new Location("Key", "Draw") ); ksession.fireAllRules(); --- Key in the Office Nothing returned. There is no key at any point below Office. But the query stays open and reactive. Key Inserted 3 levels below, but system detects, reacts and bubbles up the results. House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Monday, 5 August 13
  • 98. Backward Chaining 100 rule "go4" when String( this == "go4" ) isContainedIn(thing, "Office"; ) then System.out.println( "thing " + thing + " is in the Office" ); end ksession.insert( "go4" ); ksession.fireAllRules(); --- go4 thing Key is in the Office thing Computer is in the Office thing Draw is in the Office thing Desk is in the Office thing Chair is in the Office Finds all Things in the office, but directly and transitively. Out Var (unbound) House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Monday, 5 August 13
  • 99. Backward Chaining 101 rule "go5" when String( this == "go5" ) isContainedIn(thing, location; ) then System.out.println( "thing " + thing + " is in " + location ); end ksession.insert( "go5" ); ksession.fireAllRules(); --- go5 thing Knife is in House thing Cheese is in House thing Key is in House thing Computer is in House thing Draw is in House thing Desk is in House thing Chair is in House thing Key is in Office thing Computer is in Office thing Draw is in Office thing Key is in Desk thing Office is in House Find all things in all things. Out Var (unbound) Out Var (unbound) thing Computer is in Desk thing Knife is in Kitchen thing Cheese is in Kitchen thing Kitchen is in House thing Key is in Draw thing Draw is in Desk thing Desk is in Office thing Chair is in Office House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Monday, 5 August 13
  • 101. 103 Features • Compile time composition of plugins • modular components, each separate maven module. • Lightweight • Decoupled components • Layout Manager and Perspectives • Embeddable/Reusable (*) • Unified API • Security • I/O • VFS • Metadata • Menus, Toolbars, Panels, etc. • Standard Life Cycle UF UberFire Monday, 5 August 13
  • 102. UberFire 104 @Dependent @WorkbenchScreen(identifier = "MyFirstPanel") public class MyFirstPanel { private final FlowPanel panel = new FlowPanel(); @PostConstruct private void init() { final Label label = new Label(); label.setText("Hello World!"); panel.add(label); } @WorkbenchPartTitle public String myTitle() { return "My First and Cool Panel!"; } @WorkbenchPartView public IsWidget getView() { return panel; } } Monday, 5 August 13
  • 103. Proof is in the Pudding •UI Rewrite started in November •Entire BRMS ported •New BPMS built, all integrated •Tasks, Calendars, BPM Designer •Only one person on core UI framework •All team memebers distributed •Despite aggressive schedule •Code remains modular •Easy to maintan and extend •No one is complaining yet :) 105 UF UberFire Monday, 5 August 13
  • 104. 106 Questions?Questions? • Dave Bowman: All right, HAL; I'll go in through the emergency airlock. • HAL: Without your space helmet, Dave, you're going to find that rather difficult. • Dave Bowman: HAL, I won't argue with you anymore! Open the doors! • HAL: Dave, this conversation can serve no purpose anymore. Goodbye. Joshya: Greetings, Professor Falken. Falken: Hello, Joshua. Joshya: A strange game. The only winning move is not to play. How about a nice game of chess? Monday, 5 August 13