SlideShare a Scribd company logo
1 of 50
Drools 6 Deep Dive
(Core Engine)
Mario Fusco
mfusco@redhat.com
Senior Software Engineer
Edson Tirelli
etirelli@redhat.com
Drools Project Lead
Principal Software Engineer
Drools 6 Deep Dive
● Core Engine Internals
 Phreak Algorithm (and ReteOO comparison)
 Set based propagation
● Deployment model
 Kjar modules
 Incremental compilation and KieScanner
 Type declarations changes from Drools 5
● Most useful less known features
 Property reactivity
 Backward chaining
 Multi-function accumulates
 Conditional named consequences
Core Engine Internals
ReteOO was cool
● Node Sharing
● Alpha Indexing
● Tree-based graphs
● Modify-in-place
● Property reactive
● Sub-networks for nested CEs
● Backward chaining support
● Lazy Truth Maintenance
● Heap based agenda
● Dynamic Rules support
But Phreak is better
● New algorithm:
 Inspired by Rete, LEAPS, Collection Oriented Match, L/R
Unlinking
● Preserves all ReteOO optimizations (that still make sense)
● Adds a whole new level of innovations:
 Full rule and segment unlinking
 Lazy evaluation, rule scoping
 Set-based propagation
● Results:
 On average, 20% faster than ReteOO*
 On specific use cases, up to 400% faster
 Reduced memory footprint
 More forgiving algorithm to badly written rules
* see the Drools blog for details
Phreak – memory structure
Phreak – in-memory network
Phreak – in-memory network
Set-based propagation
Why set-based propagation
● For large amounts of data, the number of tuples that
match individual conditions is likely to be large
● In such situations, the number of collections will be much
smaller than the number of tuples
● Collections of tuples that match individual conditions are
the unit of matching, rather than individual tuples
● Tame the combinatorial explosion, since it generates
combinations of collections instead of combinations of
tuples
From tuple-based
to set-based propagation
Deployment Model
(and build API)
Droolsand jBPM 5 - Concepts
Guvnor Application
Resources
Compiled
Resources
Packages Packages
KBases
KSessions
Client
Dependencies
Dependencies
JCR Repository
Droolsand jBPM 5 - Shortcomings
Resources
Compiled
Resources
Packages
Client
Dependencies
Dependencies
1. Java Serialization
3. Complexity
Leak
2. Dependency management
Guvnor Application
Packages
KBases
KSessions
JCR Repository
KIE 6 - Concepts
Project
Kie Workbench Application
Maven Repository
Project
KContainer
Module (kjar) Module (kjar)
Module (kjar)
Git Repository
KieWorkbench
● Source stored in GIT repositories
● Modules (kjars) stored in maven repositories
Repositories Projects Packages
KBases KSessions
contain contain
define
define
include
Kie Workbench
Module(kjar)
● Fully mavenized
● Versioned
● Standard JAR file
● Completely self-contained
● Contains:
 Source files
 Compiled classes and assets (rules, processes, etc)
 KBases and KSessions definitions (kmodule.xml)
 Module configuration and dependencies (pom.xml)
● Ready for deployment in a KContainer
Module(kjar)
● Utilizes sensible defaults
● Convention based (java, maven)
● Automatic discover:
 META-INF/kmodule.xml
● No need to programatically build (although supported)
● Supports inheritance and composition (includes)
● Allows for multiple named entities
Meaningful defaults
KieServices ks = KieServices.Factory.get();
KieContainer kContainer = ks.getKieClasspathContainer();
KieSession kSession = kContainer.newKieSession();
kSession.fireAllRules();
KieServices ks = KieServices.Factory.get();
KieContainer kContainer = ks.getKieClasspathContainer();
KieSession kSession = kContainer.newKieSession();
kSession.fireAllRules();
<kmodule
xmlns="http://jboss.org/kie/6.0.0/kmodule">
</kmodule>
<kmodule
xmlns="http://jboss.org/kie/6.0.0/kmodule">
</kmodule>
Definingmultiplenamed
Kiebasesand KieSessions
<kmodule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://jboss.org/kie/6.0.0/kmodule">
<kbase name="ServerKB" packages="org.myproject.example.server,
org.myproject.example.server.model"
eventProcessingMode="stream" equalsBehavior="identity">
<ksession name="ServerKS" default="true" />
</kbase>
<kbase name="ClientKB" packages="org.myproject.example.client">
<ksession name="StatefulClientKS" type="stateful"/>
<ksession name="StatelessClientKS" type="stateless"/>
</kbase>
</kmodule>
<kmodule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://jboss.org/kie/6.0.0/kmodule">
<kbase name="ServerKB" packages="org.myproject.example.server,
org.myproject.example.server.model"
eventProcessingMode="stream" equalsBehavior="identity">
<ksession name="ServerKS" default="true" />
</kbase>
<kbase name="ClientKB" packages="org.myproject.example.client">
<ksession name="StatefulClientKS" type="stateful"/>
<ksession name="StatelessClientKS" type="stateless"/>
</kbase>
</kmodule>
KieContainer kc = KieServices.Factory.get().getKieClasspathContainer();
KieSession serverKsession = kc.newKieSession( "ServerKS" );
KieSession clientKsession = kc.newKieSession( "StatelessClientKS" );
KieContainer kc = KieServices.Factory.get().getKieClasspathContainer();
KieSession serverKsession = kc.newKieSession( "ServerKS" );
KieSession clientKsession = kc.newKieSession( "StatelessClientKS" );
Loadinga KieModulefrom Maven
<dependency>
<groupId>org.mycompany</groupId>
<artifactId>myproject</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.mycompany</groupId>
<artifactId>myproject</artifactId>
<version>1.0.0</version>
</dependency>
KieServices ks = KieServices.Factory.get();
KieContainer kContainer =
ks.newKieContainer(ks.newReleaseId("org.mycompany",
"myproject",
"1.0.0"));
KieSession kSession = kContainer.newKieSession("ksession1");
KieServices ks = KieServices.Factory.get();
KieContainer kContainer =
ks.newKieContainer(ks.newReleaseId("org.mycompany",
"myproject",
"1.0.0"));
KieSession kSession = kContainer.newKieSession("ksession1");
Don't forget to add kie-ci
(maven integration module)
to your dependencies!
Incremental compilation &
KieScanner
Incremental Compilation
KieServices ks = KieServices.Factory.get();
ReleaseId rel1 = ks.newReleaseId( "org.mycompany", "myproject", "1.0.0" );
// creates a KieContainer for the project identified by rel1
KieContainer kc = ks.newKieContainer( rel1 );
// instance the default KieSession from the KieContainer ...
KieSession ksession = kc.newKieSession();
// … and do some work on that KieSession
// programmatically upgrade the KieContainer to a newer version
ReleaseId rel2 = ks.newReleaseId( "org.mycompany", "myproject", "1.1.0" );
kc.updateToVersion( rel2 );
// the rule base used by the KieSession is dynamically updated
// so you can keep using the same KieSession instance with newer rules
KieServices ks = KieServices.Factory.get();
ReleaseId rel1 = ks.newReleaseId( "org.mycompany", "myproject", "1.0.0" );
// creates a KieContainer for the project identified by rel1
KieContainer kc = ks.newKieContainer( rel1 );
// instance the default KieSession from the KieContainer ...
KieSession ksession = kc.newKieSession();
// … and do some work on that KieSession
// programmatically upgrade the KieContainer to a newer version
ReleaseId rel2 = ks.newReleaseId( "org.mycompany", "myproject", "1.1.0" );
kc.updateToVersion( rel2 );
// the rule base used by the KieSession is dynamically updated
// so you can keep using the same KieSession instance with newer rules
KieScanner
● Allows continuous monitoring of your Maven repository to
check whether a new release of a Kie project is available
● When it finds a newer version of the project used by the
KieContainer on which it has been registered, automatically
downloads it and triggers an incremental build
● Can be configured to run with a fixed time interval, but it is
also possible to run it on demand
KieServices kieServices = KieServices.Factory.get();
ReleaseId releaseId = kieServices.newReleaseId( "org.mycompany",
"myproject",
"LATEST" );
KieContainer kContainer = kieServices.newKieContainer( releaseId );
KieScanner kScanner = kieServices.newKieScanner( kContainer );
// Start the KieScanner polling the Maven repository every 10 seconds
kScanner.start( 10000L );
KieServices kieServices = KieServices.Factory.get();
ReleaseId releaseId = kieServices.newReleaseId( "org.mycompany",
"myproject",
"LATEST" );
KieContainer kContainer = kieServices.newKieContainer( releaseId );
KieScanner kScanner = kieServices.newKieScanner( kContainer );
// Start the KieScanner polling the Maven repository every 10 seconds
kScanner.start( 10000L );
Use maven
version range
Type declarations changes
In Drools5 typedeclarationswerecompiled at
runtime
package org.mypackage
declare Person
name : String
age : int
end
rule "Find adults" when
Person( age > 18,
$name : name )
then
System.out.println( $name );
end
package org.mypackage
declare Person
name : String
age : int
end
rule "Find adults" when
Person( age > 18,
$name : name )
then
System.out.println( $name );
end
// a knowledge base with a declared type:
KieBase kbase = ...
// get the declared FactType
FactType personType =
kbase.getFactType( "org.mypackage",
"Person" );
// handle the type as necessary:
// create instances:
Object bob = personType.newInstance();
// set attributes values
personType.set( bob, "name", "Bob" );
personType.set( bob, "age", 42 );
// insert fact into a session
KieSession ksession = ...
ksession.insert( bob );
ksession.fireAllRules();
// a knowledge base with a declared type:
KieBase kbase = ...
// get the declared FactType
FactType personType =
kbase.getFactType( "org.mypackage",
"Person" );
// handle the type as necessary:
// create instances:
Object bob = personType.newInstance();
// set attributes values
personType.set( bob, "name", "Bob" );
personType.set( bob, "age", 42 );
// insert fact into a session
KieSession ksession = ...
ksession.insert( bob );
ksession.fireAllRules();
Type declarations can
be used in Java code
only via reflection
In Drools6 typedeclarationsareadded tothe
kjar at compiletime
package org.mypackage
declare Person
name : String
age : int
end
rule "Find adults" when
Person( age > 18,
$name : name )
then
System.out.println( $name );
end
package org.mypackage
declare Person
name : String
age : int
end
rule "Find adults" when
Person( age > 18,
$name : name )
then
System.out.println( $name );
end
import org.mypackage.Person;
// create new instance of a plain Java class
Person bob = new Person();
// set attributes values
bob.setName( “Bob” );
bob.setAge( 2 );
// insert fact into a session
KieSession ksession = ...
ksession.insert( bob );
ksession.fireAllRules();
import org.mypackage.Person;
// create new instance of a plain Java class
Person bob = new Person();
// set attributes values
bob.setName( “Bob” );
bob.setAge( 2 );
// insert fact into a session
KieSession ksession = ...
ksession.insert( bob );
ksession.fireAllRules();
<dependency>
<groupId>org.mycompany</groupId>
<artifactId>myproject</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.mycompany</groupId>
<artifactId>myproject</artifactId>
<version>1.0.0</version>
</dependency>
Type declarations is compiled
and added to the kjar so you
can use it as a plain Java class
Property Reactivity
Solvingloop problems
rule “Salary award for min 2 years service”
when
e : Employee( lengthOfService > 2 )
then
modify( e ) { setSalary( e.getSalary() * 1.05 ) };
end
Solvingloop problems
rule “Salary award for min 2 years service” no-loop
when
e : Employee( lengthOfService > 2 )
then
modify( e ) { setSalary( e.getSalary() * 1.05 ) };
end
Solvingloop problems
rule “Salary award for min 2 years service” no-loop
when
e : Employee( lengthOfService > 2 )
then
modify( e ) { setSalary( e.getSalary() * 1.05 ) };
end
rule “Salary award for min 8 years service” no-loop
when
e : Employee( lengthOfService > 8 )
then
modify( e ) { setSalary( e.getSalary() * 1.05 ) };
end
Solvingloop problems
rule “Salary award for min 2 years service” when
e : Employee( lengthOfService > 2 )
not SalaryMin2Years( employee == e )
then
modify( e ) { setSalary( e.getSalary() * 1.05 ) };
insert ( new SalaryMin2Years(e) );
end
rule “Salary award for min 8 years service” when
e : Employee( lengthOfService > 8 )
not SalaryMin8Years( employee == e )
then
modify( e ) { setSalary( e.getSalary() * 1.05 ) };
insert ( new SalaryMin8Years(e) );
end
Solvingloop problems
rule “Year End” when
d : ChangeDate( )
e : Employee( )
then
modify( e ) { lengthOfService(
d.getYear() - e.getStartYear() ) };
end
Property Reactive
● Annotate the class:
 Java:
 DRL:
@PropertyReactive
public class Employee {
int salary;
int lengthOfService;
// … getters/setters
}
@PropertyReactive
public class Employee {
int salary;
int lengthOfService;
// … getters/setters
}
declare Employee
@PropertyReactive
salary : int
lengthOfService : int
}
declare Employee
@PropertyReactive
salary : int
lengthOfService : int
}
Property Reactive– problem solved
rule “Salary award for min 2 years service”
when
e : Employee( lengthOfService > 2 )
then
modify( e ) { setSalary( e.getSalary() * 1.05 ) };
end
rule “Salary award for min 8 years service”
when
e : Employee( lengthOfService > 8 )
then
modify( e ) { setSalary( e.getSalary() * 1.05 ) };
end
Property Reactive– @Watch
rule “Record Salary Changes”
when
e : Employee( ) @Watch( salary )
then
insert( new SalaryChange( e, e.getSalary() );
end
Property Reactive– @Watch
rule “Salary award for min 2 years service”
when
e : Employee( salary < 1000, lengthOfService > 2 ) @Watch( !salary )
then
modify( e ) { setSalary( e.getSalary() * 1.05 ) };
end
Property Reactive - @Watch
@Watch( salary, lengthOfService, age )
@Watch( * )
@Watch( !* )
@Watch( *, !salary )
@Watch( !*, salary )
Backward Chaining
Forward and Backward Chaining
● Forward Chaining starts with facts/data and trigger actions
or output conclusions
● Backward Chaining starts with goals and search how to
satisfy them (e.g. Prolog)
● Drools is a Hybrid Chaining Systems meaning that it allows
to mix these 2 strategies
● Backward-Chaining is often referred to as derivation queries
and then Drools implements with the query construct
● A query is a simple way to search the working memory for
facts that match the stated conditions
● A query is just a rule with no consequence. It collects all the
results and returns them to the caller
A Backward Chaining example
query isContainedIn( String x, String y )
Location( x, y; )
or
( Location( z, y; ) and isContainedIn( x, z; ) )
end
query isContainedIn( String x, String y )
Location( x, y; )
or
( Location( z, y; ) and isContainedIn( x, z; ) )
end
rule “Print all things contained in the Office” when
isContainedIn(thing, "Office"; )
then
System.out.println( "thing " + thing + " is in the Office" );
end
rule “Print all things contained in the Office” when
isContainedIn(thing, "Office"; )
then
System.out.println( "thing " + thing + " is in the Office" );
end
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
Out Var
(unbuond)
In Var
(buond)
Multi-function Accumulates
Drools 6 – Multi-function accumulates
rule “accumulate in Drools 5”
when
$s : Number() from accumulate( $p : Product(),
sum( $p.price ) )
$a : Number() from accumulate( $p : Product(),
average( $p.price ) )
then ...
rule “accumulate in Drools 6”
when
acc( $p : Product(),
$s : sum( $p.price ),
$a : average( $p.price ) )
then ...
(Conditional) Named
Consequences
Why more than one consequence?
rule "Give 10% discount to customers older than 60"
when
$customer : Customer( age > 60 )
then
modify($customer) { setDiscount( 0.1 ) };
end
rule "Give free parking to customers older than 60"
when
$customer : Customer( age > 60 )
$car : Car ( owner == $customer )
then
modify($car) { setFreeParking( true ) };
end
rule "Give 10% discount to customers older than 60"
when
$customer : Customer( age > 60 )
then
modify($customer) { setDiscount( 0.1 ) };
end
rule "Give free parking to customers older than 60"
when
$customer : Customer( age > 60 )
$car : Car ( owner == $customer )
then
modify($car) { setFreeParking( true ) };
end
Sometimes the constraint of having one single
consequence for each rule can be somewhat limiting and
leads to verbose and difficult to be maintained repetitions
Named Consequences
rule "Give 10% discount and free parking to customers older than 60"
when
$customer : Customer( age > 60 )
do[giveDiscount]
$car : Car ( owner == $customer )
then
modify($car) { setFreeParking( true ) };
then[giveDiscount]
modify($customer) { setDiscount( 0.1 ) };
end
rule "Give 10% discount and free parking to customers older than 60"
when
$customer : Customer( age > 60 )
do[giveDiscount]
$car : Car ( owner == $customer )
then
modify($car) { setFreeParking( true ) };
then[giveDiscount]
modify($customer) { setDiscount( 0.1 ) };
end
When the pattern matching
evaluation reaches this point
activate the named consequence
and continue evaluation
Give 10% discount to a customer
older than 60 regardless
if he owns a car or not
Conditional Named Consequences
rule "Give free parking and 10% discount to over 60
Golden customer and 5% to Silver ones"
when
$customer : Customer( age > 60 )
if ( type == "Golden" ) do[giveDiscount10]
else if ( type == "Silver" ) break[giveDiscount5]
$car : Car ( owner == $customer )
then
modify($car) { setFreeParking( true ) };
then[giveDiscount10]
modify($customer) { setDiscount( 0.1 ) };
then[giveDiscount5]
modify($customer) { setDiscount( 0.05 ) };
endd
rule "Give free parking and 10% discount to over 60
Golden customer and 5% to Silver ones"
when
$customer : Customer( age > 60 )
if ( type == "Golden" ) do[giveDiscount10]
else if ( type == "Silver" ) break[giveDiscount5]
$car : Car ( owner == $customer )
then
modify($car) { setFreeParking( true ) };
then[giveDiscount10]
modify($customer) { setDiscount( 0.1 ) };
then[giveDiscount5]
modify($customer) { setDiscount( 0.05 ) };
endd
If the condition evaluates to
true activate the named
consequence and continue
Else If this other condition is
met activate the named
consequence and but block
any further evaluation
Thanks … Questions?
Edson Tirelli
etirelli@redhat.com
Mario Fusco
mfusco@redhat.com
Q A

More Related Content

What's hot

Rules Programming tutorial
Rules Programming tutorialRules Programming tutorial
Rules Programming tutorialSrinath Perera
 
JBoss Drools - Pure Java Rule Engine
JBoss Drools - Pure Java Rule EngineJBoss Drools - Pure Java Rule Engine
JBoss Drools - Pure Java Rule EngineAnil Allewar
 
Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)Mark Proctor
 
MongoDB - Aggregation Pipeline
MongoDB - Aggregation PipelineMongoDB - Aggregation Pipeline
MongoDB - Aggregation PipelineJason Terpko
 
odoo 11.0 development (CRUD)
odoo 11.0 development (CRUD)odoo 11.0 development (CRUD)
odoo 11.0 development (CRUD)Mohamed Magdy
 
Developing Complex Business Rules with Drools Integration
Developing Complex Business Rules with Drools IntegrationDeveloping Complex Business Rules with Drools Integration
Developing Complex Business Rules with Drools IntegrationBonitasoft
 
Drools and jBPM 6 Overview
Drools and jBPM 6 OverviewDrools and jBPM 6 Overview
Drools and jBPM 6 OverviewMark Proctor
 
PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts Bharat Kalia
 
JSON in Oracle 18c and 19c
JSON in Oracle 18c and 19cJSON in Oracle 18c and 19c
JSON in Oracle 18c and 19cstewashton
 
[JWPA-1]의존성 주입(Dependency injection)
[JWPA-1]의존성 주입(Dependency injection)[JWPA-1]의존성 주입(Dependency injection)
[JWPA-1]의존성 주입(Dependency injection)Young-Ho Cho
 
Angular Best Practices - Perfomatix
Angular Best Practices - PerfomatixAngular Best Practices - Perfomatix
Angular Best Practices - PerfomatixPerfomatix Solutions
 
Understanding react hooks
Understanding react hooksUnderstanding react hooks
Understanding react hooksMaulik Shah
 
Rules Engine - java(Drools) & ruby(ruleby)
Rules Engine - java(Drools) & ruby(ruleby)Rules Engine - java(Drools) & ruby(ruleby)
Rules Engine - java(Drools) & ruby(ruleby)martincabrera
 
Angular 8
Angular 8 Angular 8
Angular 8 Sunil OS
 
Advanced javascript
Advanced javascriptAdvanced javascript
Advanced javascriptDoeun KOCH
 

What's hot (20)

Rules Programming tutorial
Rules Programming tutorialRules Programming tutorial
Rules Programming tutorial
 
JBoss Drools - Pure Java Rule Engine
JBoss Drools - Pure Java Rule EngineJBoss Drools - Pure Java Rule Engine
JBoss Drools - Pure Java Rule Engine
 
Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)
 
Expressjs
ExpressjsExpressjs
Expressjs
 
MongoDB - Aggregation Pipeline
MongoDB - Aggregation PipelineMongoDB - Aggregation Pipeline
MongoDB - Aggregation Pipeline
 
odoo 11.0 development (CRUD)
odoo 11.0 development (CRUD)odoo 11.0 development (CRUD)
odoo 11.0 development (CRUD)
 
Developing Complex Business Rules with Drools Integration
Developing Complex Business Rules with Drools IntegrationDeveloping Complex Business Rules with Drools Integration
Developing Complex Business Rules with Drools Integration
 
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
 
Drools and jBPM 6 Overview
Drools and jBPM 6 OverviewDrools and jBPM 6 Overview
Drools and jBPM 6 Overview
 
PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts
 
JSON in Oracle 18c and 19c
JSON in Oracle 18c and 19cJSON in Oracle 18c and 19c
JSON in Oracle 18c and 19c
 
[JWPA-1]의존성 주입(Dependency injection)
[JWPA-1]의존성 주입(Dependency injection)[JWPA-1]의존성 주입(Dependency injection)
[JWPA-1]의존성 주입(Dependency injection)
 
Angular Best Practices - Perfomatix
Angular Best Practices - PerfomatixAngular Best Practices - Perfomatix
Angular Best Practices - Perfomatix
 
Json
JsonJson
Json
 
Angular Directives
Angular DirectivesAngular Directives
Angular Directives
 
Understanding react hooks
Understanding react hooksUnderstanding react hooks
Understanding react hooks
 
Rules Engine - java(Drools) & ruby(ruleby)
Rules Engine - java(Drools) & ruby(ruleby)Rules Engine - java(Drools) & ruby(ruleby)
Rules Engine - java(Drools) & ruby(ruleby)
 
React context
React context  React context
React context
 
Angular 8
Angular 8 Angular 8
Angular 8
 
Advanced javascript
Advanced javascriptAdvanced javascript
Advanced javascript
 

Similar to Drools 6 deep dive

Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
Kube Overview and Kube Conformance Certification OpenSource101 RaleighKube Overview and Kube Conformance Certification OpenSource101 Raleigh
Kube Overview and Kube Conformance Certification OpenSource101 RaleighBrad Topol
 
Kubernetes Basics - ICP Workshop Batch II
Kubernetes Basics - ICP Workshop Batch IIKubernetes Basics - ICP Workshop Batch II
Kubernetes Basics - ICP Workshop Batch IIPT Datacomm Diangraha
 
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
04_Azure Kubernetes Service: Basic Practices for Developers_GAB201904_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019Kumton Suttiraksiri
 
Operator Lifecycle Management
Operator Lifecycle ManagementOperator Lifecycle Management
Operator Lifecycle ManagementDoKC
 
Operator Lifecycle Management
Operator Lifecycle ManagementOperator Lifecycle Management
Operator Lifecycle ManagementDoKC
 
KubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipeline
KubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipelineKubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipeline
KubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipelineKubeAcademy
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO DevsWO Community
 
A Series of Fortunate Events: Building an Operator in Java
A Series of Fortunate Events: Building an Operator in JavaA Series of Fortunate Events: Building an Operator in Java
A Series of Fortunate Events: Building an Operator in JavaVMware Tanzu
 
Your Developers Can Be Heroes on Kubernetes
Your Developers Can Be Heroes on KubernetesYour Developers Can Be Heroes on Kubernetes
Your Developers Can Be Heroes on KubernetesAmbassador Labs
 
Top 10 Kubernetes Native Java Quarkus Features
Top 10 Kubernetes Native Java Quarkus FeaturesTop 10 Kubernetes Native Java Quarkus Features
Top 10 Kubernetes Native Java Quarkus Featuresjclingan
 
Kubernetes for Java developers
Kubernetes for Java developersKubernetes for Java developers
Kubernetes for Java developersRobert Barr
 
JDD2015: Kubernetes - Beyond the basics - Paul Bakker
JDD2015: Kubernetes - Beyond the basics - Paul BakkerJDD2015: Kubernetes - Beyond the basics - Paul Bakker
JDD2015: Kubernetes - Beyond the basics - Paul BakkerPROIDEA
 
Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307Inhye Park
 
Pro2516 10 things about oracle and k8s.pptx-final
Pro2516   10 things about oracle and k8s.pptx-finalPro2516   10 things about oracle and k8s.pptx-final
Pro2516 10 things about oracle and k8s.pptx-finalMichel Schildmeijer
 
Project Gardener - EclipseCon Europe - 2018-10-23
Project Gardener - EclipseCon Europe - 2018-10-23Project Gardener - EclipseCon Europe - 2018-10-23
Project Gardener - EclipseCon Europe - 2018-10-23msohn
 
Kubernetes-Presentation-Syed-Murtaza-Hassan
Kubernetes-Presentation-Syed-Murtaza-HassanKubernetes-Presentation-Syed-Murtaza-Hassan
Kubernetes-Presentation-Syed-Murtaza-HassanSyed Murtaza Hassan
 
oci-container-engine-oke-100.pdf
oci-container-engine-oke-100.pdfoci-container-engine-oke-100.pdf
oci-container-engine-oke-100.pdfNandiniSinghal16
 
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMwareVMUG IT
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Ryan Jarvinen
 
Exploring MySQL Operator for Kubernetes in Python
Exploring MySQL Operator for Kubernetes in PythonExploring MySQL Operator for Kubernetes in Python
Exploring MySQL Operator for Kubernetes in PythonIvan Ma
 

Similar to Drools 6 deep dive (20)

Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
Kube Overview and Kube Conformance Certification OpenSource101 RaleighKube Overview and Kube Conformance Certification OpenSource101 Raleigh
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
 
Kubernetes Basics - ICP Workshop Batch II
Kubernetes Basics - ICP Workshop Batch IIKubernetes Basics - ICP Workshop Batch II
Kubernetes Basics - ICP Workshop Batch II
 
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
04_Azure Kubernetes Service: Basic Practices for Developers_GAB201904_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
 
Operator Lifecycle Management
Operator Lifecycle ManagementOperator Lifecycle Management
Operator Lifecycle Management
 
Operator Lifecycle Management
Operator Lifecycle ManagementOperator Lifecycle Management
Operator Lifecycle Management
 
KubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipeline
KubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipelineKubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipeline
KubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipeline
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO Devs
 
A Series of Fortunate Events: Building an Operator in Java
A Series of Fortunate Events: Building an Operator in JavaA Series of Fortunate Events: Building an Operator in Java
A Series of Fortunate Events: Building an Operator in Java
 
Your Developers Can Be Heroes on Kubernetes
Your Developers Can Be Heroes on KubernetesYour Developers Can Be Heroes on Kubernetes
Your Developers Can Be Heroes on Kubernetes
 
Top 10 Kubernetes Native Java Quarkus Features
Top 10 Kubernetes Native Java Quarkus FeaturesTop 10 Kubernetes Native Java Quarkus Features
Top 10 Kubernetes Native Java Quarkus Features
 
Kubernetes for Java developers
Kubernetes for Java developersKubernetes for Java developers
Kubernetes for Java developers
 
JDD2015: Kubernetes - Beyond the basics - Paul Bakker
JDD2015: Kubernetes - Beyond the basics - Paul BakkerJDD2015: Kubernetes - Beyond the basics - Paul Bakker
JDD2015: Kubernetes - Beyond the basics - Paul Bakker
 
Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307
 
Pro2516 10 things about oracle and k8s.pptx-final
Pro2516   10 things about oracle and k8s.pptx-finalPro2516   10 things about oracle and k8s.pptx-final
Pro2516 10 things about oracle and k8s.pptx-final
 
Project Gardener - EclipseCon Europe - 2018-10-23
Project Gardener - EclipseCon Europe - 2018-10-23Project Gardener - EclipseCon Europe - 2018-10-23
Project Gardener - EclipseCon Europe - 2018-10-23
 
Kubernetes-Presentation-Syed-Murtaza-Hassan
Kubernetes-Presentation-Syed-Murtaza-HassanKubernetes-Presentation-Syed-Murtaza-Hassan
Kubernetes-Presentation-Syed-Murtaza-Hassan
 
oci-container-engine-oke-100.pdf
oci-container-engine-oke-100.pdfoci-container-engine-oke-100.pdf
oci-container-engine-oke-100.pdf
 
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
 
Exploring MySQL Operator for Kubernetes in Python
Exploring MySQL Operator for Kubernetes in PythonExploring MySQL Operator for Kubernetes in Python
Exploring MySQL Operator for Kubernetes in Python
 

More from Mario Fusco

Kogito: cloud native business automation
Kogito: cloud native business automationKogito: cloud native business automation
Kogito: cloud native business automationMario Fusco
 
Let's make a contract: the art of designing a Java API
Let's make a contract: the art of designing a Java APILet's make a contract: the art of designing a Java API
Let's make a contract: the art of designing a Java APIMario Fusco
 
How and why I turned my old Java projects into a first-class serverless compo...
How and why I turned my old Java projects into a first-class serverless compo...How and why I turned my old Java projects into a first-class serverless compo...
How and why I turned my old Java projects into a first-class serverless compo...Mario Fusco
 
From object oriented to functional domain modeling
From object oriented to functional domain modelingFrom object oriented to functional domain modeling
From object oriented to functional domain modelingMario Fusco
 
OOP and FP - Become a Better Programmer
OOP and FP - Become a Better ProgrammerOOP and FP - Become a Better Programmer
OOP and FP - Become a Better ProgrammerMario Fusco
 
Reactive Programming for a demanding world: building event-driven and respons...
Reactive Programming for a demanding world: building event-driven and respons...Reactive Programming for a demanding world: building event-driven and respons...
Reactive Programming for a demanding world: building event-driven and respons...Mario Fusco
 
Comparing different concurrency models on the JVM
Comparing different concurrency models on the JVMComparing different concurrency models on the JVM
Comparing different concurrency models on the JVMMario Fusco
 
Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...Mario Fusco
 
If You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongIf You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongMario Fusco
 
FP in Java - Project Lambda and beyond
FP in Java - Project Lambda and beyondFP in Java - Project Lambda and beyond
FP in Java - Project Lambda and beyondMario Fusco
 
Why we cannot ignore Functional Programming
Why we cannot ignore Functional ProgrammingWhy we cannot ignore Functional Programming
Why we cannot ignore Functional ProgrammingMario Fusco
 
Real world DSL - making technical and business people speaking the same language
Real world DSL - making technical and business people speaking the same languageReal world DSL - making technical and business people speaking the same language
Real world DSL - making technical and business people speaking the same languageMario Fusco
 
Java 7, 8 & 9 - Moving the language forward
Java 7, 8 & 9 - Moving the language forwardJava 7, 8 & 9 - Moving the language forward
Java 7, 8 & 9 - Moving the language forwardMario Fusco
 
Swiss army knife Spring
Swiss army knife SpringSwiss army knife Spring
Swiss army knife SpringMario Fusco
 
No more loops with lambdaj
No more loops with lambdajNo more loops with lambdaj
No more loops with lambdajMario Fusco
 

More from Mario Fusco (20)

Kogito: cloud native business automation
Kogito: cloud native business automationKogito: cloud native business automation
Kogito: cloud native business automation
 
Let's make a contract: the art of designing a Java API
Let's make a contract: the art of designing a Java APILet's make a contract: the art of designing a Java API
Let's make a contract: the art of designing a Java API
 
How and why I turned my old Java projects into a first-class serverless compo...
How and why I turned my old Java projects into a first-class serverless compo...How and why I turned my old Java projects into a first-class serverless compo...
How and why I turned my old Java projects into a first-class serverless compo...
 
OOP and FP
OOP and FPOOP and FP
OOP and FP
 
Lazy java
Lazy javaLazy java
Lazy java
 
From object oriented to functional domain modeling
From object oriented to functional domain modelingFrom object oriented to functional domain modeling
From object oriented to functional domain modeling
 
OOP and FP - Become a Better Programmer
OOP and FP - Become a Better ProgrammerOOP and FP - Become a Better Programmer
OOP and FP - Become a Better Programmer
 
Reactive Programming for a demanding world: building event-driven and respons...
Reactive Programming for a demanding world: building event-driven and respons...Reactive Programming for a demanding world: building event-driven and respons...
Reactive Programming for a demanding world: building event-driven and respons...
 
Comparing different concurrency models on the JVM
Comparing different concurrency models on the JVMComparing different concurrency models on the JVM
Comparing different concurrency models on the JVM
 
Java 8 Workshop
Java 8 WorkshopJava 8 Workshop
Java 8 Workshop
 
Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...
 
Monadic Java
Monadic JavaMonadic Java
Monadic Java
 
If You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongIf You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are Wrong
 
FP in Java - Project Lambda and beyond
FP in Java - Project Lambda and beyondFP in Java - Project Lambda and beyond
FP in Java - Project Lambda and beyond
 
Why we cannot ignore Functional Programming
Why we cannot ignore Functional ProgrammingWhy we cannot ignore Functional Programming
Why we cannot ignore Functional Programming
 
Real world DSL - making technical and business people speaking the same language
Real world DSL - making technical and business people speaking the same languageReal world DSL - making technical and business people speaking the same language
Real world DSL - making technical and business people speaking the same language
 
Java 7, 8 & 9 - Moving the language forward
Java 7, 8 & 9 - Moving the language forwardJava 7, 8 & 9 - Moving the language forward
Java 7, 8 & 9 - Moving the language forward
 
Hammurabi
HammurabiHammurabi
Hammurabi
 
Swiss army knife Spring
Swiss army knife SpringSwiss army knife Spring
Swiss army knife Spring
 
No more loops with lambdaj
No more loops with lambdajNo more loops with lambdaj
No more loops with lambdaj
 

Recently uploaded

Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineeringssuserb3a23b
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 

Recently uploaded (20)

Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineering
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 

Drools 6 deep dive

  • 1. Drools 6 Deep Dive (Core Engine) Mario Fusco mfusco@redhat.com Senior Software Engineer Edson Tirelli etirelli@redhat.com Drools Project Lead Principal Software Engineer
  • 2. Drools 6 Deep Dive ● Core Engine Internals  Phreak Algorithm (and ReteOO comparison)  Set based propagation ● Deployment model  Kjar modules  Incremental compilation and KieScanner  Type declarations changes from Drools 5 ● Most useful less known features  Property reactivity  Backward chaining  Multi-function accumulates  Conditional named consequences
  • 4. ReteOO was cool ● Node Sharing ● Alpha Indexing ● Tree-based graphs ● Modify-in-place ● Property reactive ● Sub-networks for nested CEs ● Backward chaining support ● Lazy Truth Maintenance ● Heap based agenda ● Dynamic Rules support
  • 5. But Phreak is better ● New algorithm:  Inspired by Rete, LEAPS, Collection Oriented Match, L/R Unlinking ● Preserves all ReteOO optimizations (that still make sense) ● Adds a whole new level of innovations:  Full rule and segment unlinking  Lazy evaluation, rule scoping  Set-based propagation ● Results:  On average, 20% faster than ReteOO*  On specific use cases, up to 400% faster  Reduced memory footprint  More forgiving algorithm to badly written rules * see the Drools blog for details
  • 6.
  • 7. Phreak – memory structure
  • 11. Why set-based propagation ● For large amounts of data, the number of tuples that match individual conditions is likely to be large ● In such situations, the number of collections will be much smaller than the number of tuples ● Collections of tuples that match individual conditions are the unit of matching, rather than individual tuples ● Tame the combinatorial explosion, since it generates combinations of collections instead of combinations of tuples
  • 14. Droolsand jBPM 5 - Concepts Guvnor Application Resources Compiled Resources Packages Packages KBases KSessions Client Dependencies Dependencies JCR Repository
  • 15. Droolsand jBPM 5 - Shortcomings Resources Compiled Resources Packages Client Dependencies Dependencies 1. Java Serialization 3. Complexity Leak 2. Dependency management Guvnor Application Packages KBases KSessions JCR Repository
  • 16. KIE 6 - Concepts Project Kie Workbench Application Maven Repository Project KContainer Module (kjar) Module (kjar) Module (kjar) Git Repository
  • 17. KieWorkbench ● Source stored in GIT repositories ● Modules (kjars) stored in maven repositories Repositories Projects Packages KBases KSessions contain contain define define include Kie Workbench
  • 18. Module(kjar) ● Fully mavenized ● Versioned ● Standard JAR file ● Completely self-contained ● Contains:  Source files  Compiled classes and assets (rules, processes, etc)  KBases and KSessions definitions (kmodule.xml)  Module configuration and dependencies (pom.xml) ● Ready for deployment in a KContainer
  • 19. Module(kjar) ● Utilizes sensible defaults ● Convention based (java, maven) ● Automatic discover:  META-INF/kmodule.xml ● No need to programatically build (although supported) ● Supports inheritance and composition (includes) ● Allows for multiple named entities
  • 20. Meaningful defaults KieServices ks = KieServices.Factory.get(); KieContainer kContainer = ks.getKieClasspathContainer(); KieSession kSession = kContainer.newKieSession(); kSession.fireAllRules(); KieServices ks = KieServices.Factory.get(); KieContainer kContainer = ks.getKieClasspathContainer(); KieSession kSession = kContainer.newKieSession(); kSession.fireAllRules(); <kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule"> </kmodule> <kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule"> </kmodule>
  • 21. Definingmultiplenamed Kiebasesand KieSessions <kmodule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://jboss.org/kie/6.0.0/kmodule"> <kbase name="ServerKB" packages="org.myproject.example.server, org.myproject.example.server.model" eventProcessingMode="stream" equalsBehavior="identity"> <ksession name="ServerKS" default="true" /> </kbase> <kbase name="ClientKB" packages="org.myproject.example.client"> <ksession name="StatefulClientKS" type="stateful"/> <ksession name="StatelessClientKS" type="stateless"/> </kbase> </kmodule> <kmodule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://jboss.org/kie/6.0.0/kmodule"> <kbase name="ServerKB" packages="org.myproject.example.server, org.myproject.example.server.model" eventProcessingMode="stream" equalsBehavior="identity"> <ksession name="ServerKS" default="true" /> </kbase> <kbase name="ClientKB" packages="org.myproject.example.client"> <ksession name="StatefulClientKS" type="stateful"/> <ksession name="StatelessClientKS" type="stateless"/> </kbase> </kmodule> KieContainer kc = KieServices.Factory.get().getKieClasspathContainer(); KieSession serverKsession = kc.newKieSession( "ServerKS" ); KieSession clientKsession = kc.newKieSession( "StatelessClientKS" ); KieContainer kc = KieServices.Factory.get().getKieClasspathContainer(); KieSession serverKsession = kc.newKieSession( "ServerKS" ); KieSession clientKsession = kc.newKieSession( "StatelessClientKS" );
  • 22. Loadinga KieModulefrom Maven <dependency> <groupId>org.mycompany</groupId> <artifactId>myproject</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId>org.mycompany</groupId> <artifactId>myproject</artifactId> <version>1.0.0</version> </dependency> KieServices ks = KieServices.Factory.get(); KieContainer kContainer = ks.newKieContainer(ks.newReleaseId("org.mycompany", "myproject", "1.0.0")); KieSession kSession = kContainer.newKieSession("ksession1"); KieServices ks = KieServices.Factory.get(); KieContainer kContainer = ks.newKieContainer(ks.newReleaseId("org.mycompany", "myproject", "1.0.0")); KieSession kSession = kContainer.newKieSession("ksession1"); Don't forget to add kie-ci (maven integration module) to your dependencies!
  • 24. Incremental Compilation KieServices ks = KieServices.Factory.get(); ReleaseId rel1 = ks.newReleaseId( "org.mycompany", "myproject", "1.0.0" ); // creates a KieContainer for the project identified by rel1 KieContainer kc = ks.newKieContainer( rel1 ); // instance the default KieSession from the KieContainer ... KieSession ksession = kc.newKieSession(); // … and do some work on that KieSession // programmatically upgrade the KieContainer to a newer version ReleaseId rel2 = ks.newReleaseId( "org.mycompany", "myproject", "1.1.0" ); kc.updateToVersion( rel2 ); // the rule base used by the KieSession is dynamically updated // so you can keep using the same KieSession instance with newer rules KieServices ks = KieServices.Factory.get(); ReleaseId rel1 = ks.newReleaseId( "org.mycompany", "myproject", "1.0.0" ); // creates a KieContainer for the project identified by rel1 KieContainer kc = ks.newKieContainer( rel1 ); // instance the default KieSession from the KieContainer ... KieSession ksession = kc.newKieSession(); // … and do some work on that KieSession // programmatically upgrade the KieContainer to a newer version ReleaseId rel2 = ks.newReleaseId( "org.mycompany", "myproject", "1.1.0" ); kc.updateToVersion( rel2 ); // the rule base used by the KieSession is dynamically updated // so you can keep using the same KieSession instance with newer rules
  • 25. KieScanner ● Allows continuous monitoring of your Maven repository to check whether a new release of a Kie project is available ● When it finds a newer version of the project used by the KieContainer on which it has been registered, automatically downloads it and triggers an incremental build ● Can be configured to run with a fixed time interval, but it is also possible to run it on demand KieServices kieServices = KieServices.Factory.get(); ReleaseId releaseId = kieServices.newReleaseId( "org.mycompany", "myproject", "LATEST" ); KieContainer kContainer = kieServices.newKieContainer( releaseId ); KieScanner kScanner = kieServices.newKieScanner( kContainer ); // Start the KieScanner polling the Maven repository every 10 seconds kScanner.start( 10000L ); KieServices kieServices = KieServices.Factory.get(); ReleaseId releaseId = kieServices.newReleaseId( "org.mycompany", "myproject", "LATEST" ); KieContainer kContainer = kieServices.newKieContainer( releaseId ); KieScanner kScanner = kieServices.newKieScanner( kContainer ); // Start the KieScanner polling the Maven repository every 10 seconds kScanner.start( 10000L ); Use maven version range
  • 27. In Drools5 typedeclarationswerecompiled at runtime package org.mypackage declare Person name : String age : int end rule "Find adults" when Person( age > 18, $name : name ) then System.out.println( $name ); end package org.mypackage declare Person name : String age : int end rule "Find adults" when Person( age > 18, $name : name ) then System.out.println( $name ); end // a knowledge base with a declared type: KieBase kbase = ... // get the declared FactType FactType personType = kbase.getFactType( "org.mypackage", "Person" ); // handle the type as necessary: // create instances: Object bob = personType.newInstance(); // set attributes values personType.set( bob, "name", "Bob" ); personType.set( bob, "age", 42 ); // insert fact into a session KieSession ksession = ... ksession.insert( bob ); ksession.fireAllRules(); // a knowledge base with a declared type: KieBase kbase = ... // get the declared FactType FactType personType = kbase.getFactType( "org.mypackage", "Person" ); // handle the type as necessary: // create instances: Object bob = personType.newInstance(); // set attributes values personType.set( bob, "name", "Bob" ); personType.set( bob, "age", 42 ); // insert fact into a session KieSession ksession = ... ksession.insert( bob ); ksession.fireAllRules(); Type declarations can be used in Java code only via reflection
  • 28. In Drools6 typedeclarationsareadded tothe kjar at compiletime package org.mypackage declare Person name : String age : int end rule "Find adults" when Person( age > 18, $name : name ) then System.out.println( $name ); end package org.mypackage declare Person name : String age : int end rule "Find adults" when Person( age > 18, $name : name ) then System.out.println( $name ); end import org.mypackage.Person; // create new instance of a plain Java class Person bob = new Person(); // set attributes values bob.setName( “Bob” ); bob.setAge( 2 ); // insert fact into a session KieSession ksession = ... ksession.insert( bob ); ksession.fireAllRules(); import org.mypackage.Person; // create new instance of a plain Java class Person bob = new Person(); // set attributes values bob.setName( “Bob” ); bob.setAge( 2 ); // insert fact into a session KieSession ksession = ... ksession.insert( bob ); ksession.fireAllRules(); <dependency> <groupId>org.mycompany</groupId> <artifactId>myproject</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId>org.mycompany</groupId> <artifactId>myproject</artifactId> <version>1.0.0</version> </dependency> Type declarations is compiled and added to the kjar so you can use it as a plain Java class
  • 30. Solvingloop problems rule “Salary award for min 2 years service” when e : Employee( lengthOfService > 2 ) then modify( e ) { setSalary( e.getSalary() * 1.05 ) }; end
  • 31. Solvingloop problems rule “Salary award for min 2 years service” no-loop when e : Employee( lengthOfService > 2 ) then modify( e ) { setSalary( e.getSalary() * 1.05 ) }; end
  • 32. Solvingloop problems rule “Salary award for min 2 years service” no-loop when e : Employee( lengthOfService > 2 ) then modify( e ) { setSalary( e.getSalary() * 1.05 ) }; end rule “Salary award for min 8 years service” no-loop when e : Employee( lengthOfService > 8 ) then modify( e ) { setSalary( e.getSalary() * 1.05 ) }; end
  • 33. Solvingloop problems rule “Salary award for min 2 years service” when e : Employee( lengthOfService > 2 ) not SalaryMin2Years( employee == e ) then modify( e ) { setSalary( e.getSalary() * 1.05 ) }; insert ( new SalaryMin2Years(e) ); end rule “Salary award for min 8 years service” when e : Employee( lengthOfService > 8 ) not SalaryMin8Years( employee == e ) then modify( e ) { setSalary( e.getSalary() * 1.05 ) }; insert ( new SalaryMin8Years(e) ); end
  • 34. Solvingloop problems rule “Year End” when d : ChangeDate( ) e : Employee( ) then modify( e ) { lengthOfService( d.getYear() - e.getStartYear() ) }; end
  • 35.
  • 36. Property Reactive ● Annotate the class:  Java:  DRL: @PropertyReactive public class Employee { int salary; int lengthOfService; // … getters/setters } @PropertyReactive public class Employee { int salary; int lengthOfService; // … getters/setters } declare Employee @PropertyReactive salary : int lengthOfService : int } declare Employee @PropertyReactive salary : int lengthOfService : int }
  • 37. Property Reactive– problem solved rule “Salary award for min 2 years service” when e : Employee( lengthOfService > 2 ) then modify( e ) { setSalary( e.getSalary() * 1.05 ) }; end rule “Salary award for min 8 years service” when e : Employee( lengthOfService > 8 ) then modify( e ) { setSalary( e.getSalary() * 1.05 ) }; end
  • 38. Property Reactive– @Watch rule “Record Salary Changes” when e : Employee( ) @Watch( salary ) then insert( new SalaryChange( e, e.getSalary() ); end
  • 39. Property Reactive– @Watch rule “Salary award for min 2 years service” when e : Employee( salary < 1000, lengthOfService > 2 ) @Watch( !salary ) then modify( e ) { setSalary( e.getSalary() * 1.05 ) }; end
  • 40. Property Reactive - @Watch @Watch( salary, lengthOfService, age ) @Watch( * ) @Watch( !* ) @Watch( *, !salary ) @Watch( !*, salary )
  • 42. Forward and Backward Chaining ● Forward Chaining starts with facts/data and trigger actions or output conclusions ● Backward Chaining starts with goals and search how to satisfy them (e.g. Prolog) ● Drools is a Hybrid Chaining Systems meaning that it allows to mix these 2 strategies ● Backward-Chaining is often referred to as derivation queries and then Drools implements with the query construct ● A query is a simple way to search the working memory for facts that match the stated conditions ● A query is just a rule with no consequence. It collects all the results and returns them to the caller
  • 43. A Backward Chaining example query isContainedIn( String x, String y ) Location( x, y; ) or ( Location( z, y; ) and isContainedIn( x, z; ) ) end query isContainedIn( String x, String y ) Location( x, y; ) or ( Location( z, y; ) and isContainedIn( x, z; ) ) end rule “Print all things contained in the Office” when isContainedIn(thing, "Office"; ) then System.out.println( "thing " + thing + " is in the Office" ); end rule “Print all things contained in the Office” when isContainedIn(thing, "Office"; ) then System.out.println( "thing " + thing + " is in the Office" ); end 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 Out Var (unbuond) In Var (buond)
  • 45. Drools 6 – Multi-function accumulates rule “accumulate in Drools 5” when $s : Number() from accumulate( $p : Product(), sum( $p.price ) ) $a : Number() from accumulate( $p : Product(), average( $p.price ) ) then ... rule “accumulate in Drools 6” when acc( $p : Product(), $s : sum( $p.price ), $a : average( $p.price ) ) then ...
  • 47. Why more than one consequence? rule "Give 10% discount to customers older than 60" when $customer : Customer( age > 60 ) then modify($customer) { setDiscount( 0.1 ) }; end rule "Give free parking to customers older than 60" when $customer : Customer( age > 60 ) $car : Car ( owner == $customer ) then modify($car) { setFreeParking( true ) }; end rule "Give 10% discount to customers older than 60" when $customer : Customer( age > 60 ) then modify($customer) { setDiscount( 0.1 ) }; end rule "Give free parking to customers older than 60" when $customer : Customer( age > 60 ) $car : Car ( owner == $customer ) then modify($car) { setFreeParking( true ) }; end Sometimes the constraint of having one single consequence for each rule can be somewhat limiting and leads to verbose and difficult to be maintained repetitions
  • 48. Named Consequences rule "Give 10% discount and free parking to customers older than 60" when $customer : Customer( age > 60 ) do[giveDiscount] $car : Car ( owner == $customer ) then modify($car) { setFreeParking( true ) }; then[giveDiscount] modify($customer) { setDiscount( 0.1 ) }; end rule "Give 10% discount and free parking to customers older than 60" when $customer : Customer( age > 60 ) do[giveDiscount] $car : Car ( owner == $customer ) then modify($car) { setFreeParking( true ) }; then[giveDiscount] modify($customer) { setDiscount( 0.1 ) }; end When the pattern matching evaluation reaches this point activate the named consequence and continue evaluation Give 10% discount to a customer older than 60 regardless if he owns a car or not
  • 49. Conditional Named Consequences rule "Give free parking and 10% discount to over 60 Golden customer and 5% to Silver ones" when $customer : Customer( age > 60 ) if ( type == "Golden" ) do[giveDiscount10] else if ( type == "Silver" ) break[giveDiscount5] $car : Car ( owner == $customer ) then modify($car) { setFreeParking( true ) }; then[giveDiscount10] modify($customer) { setDiscount( 0.1 ) }; then[giveDiscount5] modify($customer) { setDiscount( 0.05 ) }; endd rule "Give free parking and 10% discount to over 60 Golden customer and 5% to Silver ones" when $customer : Customer( age > 60 ) if ( type == "Golden" ) do[giveDiscount10] else if ( type == "Silver" ) break[giveDiscount5] $car : Car ( owner == $customer ) then modify($car) { setFreeParking( true ) }; then[giveDiscount10] modify($customer) { setDiscount( 0.1 ) }; then[giveDiscount5] modify($customer) { setDiscount( 0.05 ) }; endd If the condition evaluates to true activate the named consequence and continue Else If this other condition is met activate the named consequence and but block any further evaluation
  • 50. Thanks … Questions? Edson Tirelli etirelli@redhat.com Mario Fusco mfusco@redhat.com Q A