SlideShare a Scribd company logo
1 of 24
Drools Ecosystem
Saumitra Srivastav
@_saumitra_
1
Components
1. Drools Expert
2. Drools Guvnor
3. Drools Fusion
4. KIE Workbench
5. jBPM
6. Optaplanner
2
Drools Expert
3
Drools Expert
• Provides a declarative, rule based, coding environment
• Rules(.drl files) can be combined in packages
• allows imports, globals, functions, queries, rules
rule "name"
attributes
when
LHS
then
RHS
end
4
Custom Types
• Create new Types and use them
declare Person
name : String
dateOfBirth : java.util.Date
address : Address
end
rule "Using a declared Type"
when
$p : Person( name == "Bob" )
then
Person mark = new Person();
mark.setName("Mark");
insert( mark );
end
5
Defining DSL
• Supports defining DSL
• Syntax:
• Example:
Using this DSL,
One can define a rule as:
[when]Something is {colour} = Something(colour=="{colour}")
[when]There is a person with name of "{name}"=Person(name=="{name}")
[when]Person is at least {age} years old and lives in "{location}"=
Person(age >= {age}, location=="{location}")
[then]Log "{message}"=System.out.println("{message}");
[when]And = and
There is a person with name of "Kitty"
==> Person(name="Kitty")
Person is at least 42 years old and lives in "Atlanta"
==> Person(age >= 42, location="Atlanta")
Log "boo"
==> System.out.println("boo");
There is a person with name of "Bob" and Person is at least 30 years
old and lives in "Utah"
==> Person(name="Bob") and Person(age >= 30, location="Utah") 6
Drools Guvnor
7
Drools Guvnor
• Centralized repository for Drools Knowledge Bases
• Provide GUI tools to aid in management of large number of rules.
• Guvnor helps in:
1. Access control
2. Version control
3. Provide GUI for non-programmers to edit rules
8
Drools Fusion
9
Drools Fusion
• Adds event processing capabilities into the drools platform
• Provides 2 modes:
• Cloud Mode
• Stream Mode
• Sliding window support
• Stream support
• allows defining entry points
• Memory management
• Temporal Reasoning
10
Event Processing – Cloud Mode
• Its default processing mode
• when running in CLOUD mode, no notion of flow of time
• it is not possible for the engine to determine how "old" the event is,
because there is no concept of "now".
• The engine looks at the events as an unordered cloud against which the
engine tries to match rules.
• no automatic life-cycle management for events
• application must explicitly delete events when they are no longer
necessary
11
Event Processing – Stream Mode
• In this mode, engine uses a session clock to force synchronization between
streams
• session clock is responsible for keeping the current timestamp, while helps
in:
• determining event age
• do temporal calculations
• synchronizes streams from multiple sources
• schedules future tasks
• Two types of clocks:
• Realtime
• Uses system clock
• Pseudo
• Controlled by app, useful for dev
12
Negative Patterns in Stream Mode
• In STREAM mode, negative patterns(with time constraints) may require the
engine to wait for a time period before activating a rule.
• Without time constraints
• With time constraints
rule "Sound the alarm"
when
$f : FireDetected( )
not( SprinklerActivated( ) )
then
// sound the alarm
end
rule "Sound the alarm"
when
$f : FireDetected( )
not( SprinklerActivated( this after[0s,10s] $f ) )
then
// sound the alarm
end
13
Negative Patterns in Stream Mode
• A rule that expects every 10 seconds at least one “Heartbeat” event, if not
the rule fires.
rule "Sound the alarm"
duration( 10s )
when
$f : FireDetected( )
not( SprinklerActivated( this after[0s,10s] $f ) )
then
// sound the alarm
end
14
Entry points
• Entry points can be used so that a rules matches only selective events
rule "Sound the alarm in Bangalore"
when
$f : FireDetected( ) from “Bangalore-Office”
not( SprinklerActivated())
then
// sound the alarm
end
rule "Sound the alarm in US"
when
$f : FireDetected( ) from “US-Office”
not( SprinklerActivated())
then
// sound the alarm
end
WorkingMemoryEntryPoint entryPoint1 =
session.getWorkingMemoryEntryPoint(“US-office");
entryPoint1.insert(fact);
15
Sliding Windows
• Supports 2 sliding window implementations:
• Sliding time windows
• Sliding length windows
• Time - Fire rules on events which occurred in last 2 mins
when
Event() over window:time( 2m )
then
rule "Sound the alarm in case temperature rises above threshold"
when
TemperatureThreshold( $max : max )
Number( doubleValue > $max ) from accumulate(
SensorReading( $temp : temperature ) over window:time( 10m ),
average( $temp ) )
then
// sound the alarm
end
16
Sliding Time Windows
• Fire rules on events which occurred in last 2 mins
• sound an alarm in case the average temperature over the last 10 minutes
read from a sensor is above the threshold value
when
Event() over window:time( 2m )
then
rule "Sound the alarm in case temperature rises above threshold"
when
TemperatureThreshold( $max : max )
Number( doubleValue > $max ) from accumulate(
SensorReading( $temp : temperature ) over window:time( 10m ),
average( $temp ) )
then
// sound the alarm
end
17
Sliding Length Windows
• Sliding length implementation consider events based on order of their
insertion into the session
• sound an alarm in case the average temperature for last 100 entries from
sensor is above the threshold value
when
Event(type == “securitylogs”) over window:length( 10 )
then
rule "Sound the alarm in case temperature rises above threshold"
when
TemperatureThreshold( $max : max )
Number( doubleValue > $max ) from accumulate(
SensorReading( $temp : temperature ) over window:length( 100 ),
average( $temp ) )
then
// sound the alarm
end
18
Memory Management for Events
1. Explicit expiration offset
2. Inferred expiration offset
declare Event
@expires( 30m )
end
rule "correlate orders"
when
$bo : BuyOrderEvent( $id : id )
$ae : AckEvent( id == $id, this after[0,10s] $bo )
then
// do something
end
19
Temporal Reasoning operators
• Drools implements all 13 temporal operators defined in Allen’s paper
• Example:
match if and only if the temporal distance between the time when,
eventB finished and the time when $eventA started is
between ( 3 minutes and 30 seconds ) and ( 4 minutes ).
After, before, coincides, during,
finishes, finished by,
includes,
meets, met by,
overlaps, overlapped by,
starts, started by
$eventA : EventA( this after[ 3m30s, 4m ] $eventB )
20
jBPM
21
jBPM
• a flexible Business Process Management (BPM) Suite.
• offers process management features suited for both business users and
developers
• allows you to model your business goals using flowcharts
• Domain-specific nodes can be plugged to make the processes more easily
understood by business users.
• Eclipse-based and web-based editor
• History logging (for querying / monitoring / analysis)
• Optional process repository to deploy your process (and other related
knowledge)
22
KIE Workbench Demo
23
Thanks
• http://www.jboss.org/drools.html
• http://docs.jboss.org/drools/release/6.0.1.Final/drools-
docs/html/index.html
Questions?
24

More Related Content

What's hot

Rule Engine & Drools
Rule Engine & DroolsRule Engine & Drools
Rule Engine & DroolsSandip Jadhav
 
Drools5 Community Training: Module 1.5 - Drools Expert First Example
Drools5 Community Training: Module 1.5 - Drools Expert First ExampleDrools5 Community Training: Module 1.5 - Drools Expert First Example
Drools5 Community Training: Module 1.5 - Drools Expert First ExampleMauricio (Salaboy) Salatino
 
Developing Configurable and High Performance Apps in Drools
Developing Configurable and High Performance Apps in Drools Developing Configurable and High Performance Apps in Drools
Developing Configurable and High Performance Apps in Drools Ajay Mahajan
 
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
 
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
 
Rule Engine: Drools .Net
Rule Engine: Drools .NetRule Engine: Drools .Net
Rule Engine: Drools .NetGuo Albert
 
Drools and jBPM 6 Overview
Drools and jBPM 6 OverviewDrools and jBPM 6 Overview
Drools and jBPM 6 OverviewMark Proctor
 
Drools Expert and Fusion Intro : London 2012
Drools Expert and Fusion Intro  : London 2012Drools Expert and Fusion Intro  : London 2012
Drools Expert and Fusion Intro : London 2012Mark Proctor
 
Introduction to the Disruptor
Introduction to the DisruptorIntroduction to the Disruptor
Introduction to the DisruptorTrisha Gee
 
Secrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesSecrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesBruno Borges
 
Applying CEP Drools Fusion - Drools jBPM Bootcamps 2011
Applying CEP Drools Fusion - Drools jBPM Bootcamps 2011Applying CEP Drools Fusion - Drools jBPM Bootcamps 2011
Applying CEP Drools Fusion - Drools jBPM Bootcamps 2011Geoffrey De Smet
 
The world's next top data model
The world's next top data modelThe world's next top data model
The world's next top data modelPatrick McFadin
 
Distributed Locking in Kubernetes
Distributed Locking in KubernetesDistributed Locking in Kubernetes
Distributed Locking in KubernetesRafał Leszko
 
Introduction to Apache ZooKeeper
Introduction to Apache ZooKeeperIntroduction to Apache ZooKeeper
Introduction to Apache ZooKeeperSaurav Haloi
 
Introduction to Storm
Introduction to Storm Introduction to Storm
Introduction to Storm Chandler Huang
 
Spark and S3 with Ryan Blue
Spark and S3 with Ryan BlueSpark and S3 with Ryan Blue
Spark and S3 with Ryan BlueDatabricks
 
Apache Flink: API, runtime, and project roadmap
Apache Flink: API, runtime, and project roadmapApache Flink: API, runtime, and project roadmap
Apache Flink: API, runtime, and project roadmapKostas Tzoumas
 
Presto At Treasure Data
Presto At Treasure DataPresto At Treasure Data
Presto At Treasure DataTaro L. Saito
 
Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...
Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...
Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...Amazon Web Services
 

What's hot (20)

Rule Engine & Drools
Rule Engine & DroolsRule Engine & Drools
Rule Engine & Drools
 
Drools5 Community Training: Module 1.5 - Drools Expert First Example
Drools5 Community Training: Module 1.5 - Drools Expert First ExampleDrools5 Community Training: Module 1.5 - Drools Expert First Example
Drools5 Community Training: Module 1.5 - Drools Expert First Example
 
Developing Configurable and High Performance Apps in Drools
Developing Configurable and High Performance Apps in Drools Developing Configurable and High Performance Apps in Drools
Developing Configurable and High Performance Apps in Drools
 
Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)
 
Rules Engine - java(Drools) & ruby(ruleby)
Rules Engine - java(Drools) & ruby(ruleby)Rules Engine - java(Drools) & ruby(ruleby)
Rules Engine - java(Drools) & ruby(ruleby)
 
Rule Engine: Drools .Net
Rule Engine: Drools .NetRule Engine: Drools .Net
Rule Engine: Drools .Net
 
Drools and jBPM 6 Overview
Drools and jBPM 6 OverviewDrools and jBPM 6 Overview
Drools and jBPM 6 Overview
 
Drools Expert and Fusion Intro : London 2012
Drools Expert and Fusion Intro  : London 2012Drools Expert and Fusion Intro  : London 2012
Drools Expert and Fusion Intro : London 2012
 
Introduction to the Disruptor
Introduction to the DisruptorIntroduction to the Disruptor
Introduction to the Disruptor
 
Secrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesSecrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on Kubernetes
 
Applying CEP Drools Fusion - Drools jBPM Bootcamps 2011
Applying CEP Drools Fusion - Drools jBPM Bootcamps 2011Applying CEP Drools Fusion - Drools jBPM Bootcamps 2011
Applying CEP Drools Fusion - Drools jBPM Bootcamps 2011
 
The world's next top data model
The world's next top data modelThe world's next top data model
The world's next top data model
 
Distributed Locking in Kubernetes
Distributed Locking in KubernetesDistributed Locking in Kubernetes
Distributed Locking in Kubernetes
 
Introduction to Apache ZooKeeper
Introduction to Apache ZooKeeperIntroduction to Apache ZooKeeper
Introduction to Apache ZooKeeper
 
Introduction to Storm
Introduction to Storm Introduction to Storm
Introduction to Storm
 
Spark and S3 with Ryan Blue
Spark and S3 with Ryan BlueSpark and S3 with Ryan Blue
Spark and S3 with Ryan Blue
 
Apache Flink: API, runtime, and project roadmap
Apache Flink: API, runtime, and project roadmapApache Flink: API, runtime, and project roadmap
Apache Flink: API, runtime, and project roadmap
 
Presto At Treasure Data
Presto At Treasure DataPresto At Treasure Data
Presto At Treasure Data
 
Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...
Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...
Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...
 
Apache Airflow
Apache AirflowApache Airflow
Apache Airflow
 

Similar to Drools Ecosystem

Drools Introduction
Drools IntroductionDrools Introduction
Drools IntroductionJBug Italy
 
Infrastructure & System Monitoring using Prometheus
Infrastructure & System Monitoring using PrometheusInfrastructure & System Monitoring using Prometheus
Infrastructure & System Monitoring using PrometheusMarco Pas
 
rules, events and workflow
rules, events and workflowrules, events and workflow
rules, events and workflowMark Proctor
 
Terraform Immutablish Infrastructure with Consul-Template
Terraform Immutablish Infrastructure with Consul-TemplateTerraform Immutablish Infrastructure with Consul-Template
Terraform Immutablish Infrastructure with Consul-TemplateZane Williamson
 
OSMC 2014: OpenNMS 14 | Tarus Balog
OSMC 2014: OpenNMS 14 | Tarus BalogOSMC 2014: OpenNMS 14 | Tarus Balog
OSMC 2014: OpenNMS 14 | Tarus BalogNETWAYS
 
Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2) Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2) Ahmed El-Arabawy
 
OSMC 2014 | OpenNMS 14 by Tarus Balog
OSMC 2014 | OpenNMS 14 by Tarus BalogOSMC 2014 | OpenNMS 14 by Tarus Balog
OSMC 2014 | OpenNMS 14 by Tarus BalogNETWAYS
 
Getting Started with OpenSplice and Esper
Getting Started with OpenSplice and EsperGetting Started with OpenSplice and Esper
Getting Started with OpenSplice and EsperAngelo Corsaro
 
Real-Time Streaming with Apache Spark Streaming and Apache Storm
Real-Time Streaming with Apache Spark Streaming and Apache StormReal-Time Streaming with Apache Spark Streaming and Apache Storm
Real-Time Streaming with Apache Spark Streaming and Apache StormDavorin Vukelic
 
Python advanced 3.the python std lib by example – system related modules
Python advanced 3.the python std lib by example – system related modulesPython advanced 3.the python std lib by example – system related modules
Python advanced 3.the python std lib by example – system related modulesJohn(Qiang) Zhang
 
Running a Scalable And Reliable Symfony2 Application in Cloud (Symfony Sweden...
Running a Scalable And Reliable Symfony2 Application in Cloud (Symfony Sweden...Running a Scalable And Reliable Symfony2 Application in Cloud (Symfony Sweden...
Running a Scalable And Reliable Symfony2 Application in Cloud (Symfony Sweden...Ville Mattila
 
The Future of Apache Storm
The Future of Apache StormThe Future of Apache Storm
The Future of Apache StormP. Taylor Goetz
 
Node.js System: The Landing
Node.js System: The LandingNode.js System: The Landing
Node.js System: The LandingHaci Murat Yaman
 
How to test infrastructure code: automated testing for Terraform, Kubernetes,...
How to test infrastructure code: automated testing for Terraform, Kubernetes,...How to test infrastructure code: automated testing for Terraform, Kubernetes,...
How to test infrastructure code: automated testing for Terraform, Kubernetes,...Yevgeniy Brikman
 
Storm Real Time Computation
Storm Real Time ComputationStorm Real Time Computation
Storm Real Time ComputationSonal Raj
 

Similar to Drools Ecosystem (20)

Drools Introduction
Drools IntroductionDrools Introduction
Drools Introduction
 
Complex Event Processing
Complex Event ProcessingComplex Event Processing
Complex Event Processing
 
AWS Lambda
AWS LambdaAWS Lambda
AWS Lambda
 
Infrastructure & System Monitoring using Prometheus
Infrastructure & System Monitoring using PrometheusInfrastructure & System Monitoring using Prometheus
Infrastructure & System Monitoring using Prometheus
 
JavaScript for real men
JavaScript for real menJavaScript for real men
JavaScript for real men
 
rules, events and workflow
rules, events and workflowrules, events and workflow
rules, events and workflow
 
Terraform Immutablish Infrastructure with Consul-Template
Terraform Immutablish Infrastructure with Consul-TemplateTerraform Immutablish Infrastructure with Consul-Template
Terraform Immutablish Infrastructure with Consul-Template
 
OSMC 2014: OpenNMS 14 | Tarus Balog
OSMC 2014: OpenNMS 14 | Tarus BalogOSMC 2014: OpenNMS 14 | Tarus Balog
OSMC 2014: OpenNMS 14 | Tarus Balog
 
Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2) Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2)
 
OSMC 2014 | OpenNMS 14 by Tarus Balog
OSMC 2014 | OpenNMS 14 by Tarus BalogOSMC 2014 | OpenNMS 14 by Tarus Balog
OSMC 2014 | OpenNMS 14 by Tarus Balog
 
1230 Rtf Final
1230 Rtf Final1230 Rtf Final
1230 Rtf Final
 
Getting Started with OpenSplice and Esper
Getting Started with OpenSplice and EsperGetting Started with OpenSplice and Esper
Getting Started with OpenSplice and Esper
 
Real-Time Streaming with Apache Spark Streaming and Apache Storm
Real-Time Streaming with Apache Spark Streaming and Apache StormReal-Time Streaming with Apache Spark Streaming and Apache Storm
Real-Time Streaming with Apache Spark Streaming and Apache Storm
 
Python advanced 3.the python std lib by example – system related modules
Python advanced 3.the python std lib by example – system related modulesPython advanced 3.the python std lib by example – system related modules
Python advanced 3.the python std lib by example – system related modules
 
Running a Scalable And Reliable Symfony2 Application in Cloud (Symfony Sweden...
Running a Scalable And Reliable Symfony2 Application in Cloud (Symfony Sweden...Running a Scalable And Reliable Symfony2 Application in Cloud (Symfony Sweden...
Running a Scalable And Reliable Symfony2 Application in Cloud (Symfony Sweden...
 
The Future of Apache Storm
The Future of Apache StormThe Future of Apache Storm
The Future of Apache Storm
 
Node.js System: The Landing
Node.js System: The LandingNode.js System: The Landing
Node.js System: The Landing
 
How to test infrastructure code: automated testing for Terraform, Kubernetes,...
How to test infrastructure code: automated testing for Terraform, Kubernetes,...How to test infrastructure code: automated testing for Terraform, Kubernetes,...
How to test infrastructure code: automated testing for Terraform, Kubernetes,...
 
Storm Real Time Computation
Storm Real Time ComputationStorm Real Time Computation
Storm Real Time Computation
 
Node js lecture
Node js lectureNode js lecture
Node js lecture
 

Recently uploaded

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Recently uploaded (20)

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

Drools Ecosystem

  • 2. Components 1. Drools Expert 2. Drools Guvnor 3. Drools Fusion 4. KIE Workbench 5. jBPM 6. Optaplanner 2
  • 4. Drools Expert • Provides a declarative, rule based, coding environment • Rules(.drl files) can be combined in packages • allows imports, globals, functions, queries, rules rule "name" attributes when LHS then RHS end 4
  • 5. Custom Types • Create new Types and use them declare Person name : String dateOfBirth : java.util.Date address : Address end rule "Using a declared Type" when $p : Person( name == "Bob" ) then Person mark = new Person(); mark.setName("Mark"); insert( mark ); end 5
  • 6. Defining DSL • Supports defining DSL • Syntax: • Example: Using this DSL, One can define a rule as: [when]Something is {colour} = Something(colour=="{colour}") [when]There is a person with name of "{name}"=Person(name=="{name}") [when]Person is at least {age} years old and lives in "{location}"= Person(age >= {age}, location=="{location}") [then]Log "{message}"=System.out.println("{message}"); [when]And = and There is a person with name of "Kitty" ==> Person(name="Kitty") Person is at least 42 years old and lives in "Atlanta" ==> Person(age >= 42, location="Atlanta") Log "boo" ==> System.out.println("boo"); There is a person with name of "Bob" and Person is at least 30 years old and lives in "Utah" ==> Person(name="Bob") and Person(age >= 30, location="Utah") 6
  • 8. Drools Guvnor • Centralized repository for Drools Knowledge Bases • Provide GUI tools to aid in management of large number of rules. • Guvnor helps in: 1. Access control 2. Version control 3. Provide GUI for non-programmers to edit rules 8
  • 10. Drools Fusion • Adds event processing capabilities into the drools platform • Provides 2 modes: • Cloud Mode • Stream Mode • Sliding window support • Stream support • allows defining entry points • Memory management • Temporal Reasoning 10
  • 11. Event Processing – Cloud Mode • Its default processing mode • when running in CLOUD mode, no notion of flow of time • it is not possible for the engine to determine how "old" the event is, because there is no concept of "now". • The engine looks at the events as an unordered cloud against which the engine tries to match rules. • no automatic life-cycle management for events • application must explicitly delete events when they are no longer necessary 11
  • 12. Event Processing – Stream Mode • In this mode, engine uses a session clock to force synchronization between streams • session clock is responsible for keeping the current timestamp, while helps in: • determining event age • do temporal calculations • synchronizes streams from multiple sources • schedules future tasks • Two types of clocks: • Realtime • Uses system clock • Pseudo • Controlled by app, useful for dev 12
  • 13. Negative Patterns in Stream Mode • In STREAM mode, negative patterns(with time constraints) may require the engine to wait for a time period before activating a rule. • Without time constraints • With time constraints rule "Sound the alarm" when $f : FireDetected( ) not( SprinklerActivated( ) ) then // sound the alarm end rule "Sound the alarm" when $f : FireDetected( ) not( SprinklerActivated( this after[0s,10s] $f ) ) then // sound the alarm end 13
  • 14. Negative Patterns in Stream Mode • A rule that expects every 10 seconds at least one “Heartbeat” event, if not the rule fires. rule "Sound the alarm" duration( 10s ) when $f : FireDetected( ) not( SprinklerActivated( this after[0s,10s] $f ) ) then // sound the alarm end 14
  • 15. Entry points • Entry points can be used so that a rules matches only selective events rule "Sound the alarm in Bangalore" when $f : FireDetected( ) from “Bangalore-Office” not( SprinklerActivated()) then // sound the alarm end rule "Sound the alarm in US" when $f : FireDetected( ) from “US-Office” not( SprinklerActivated()) then // sound the alarm end WorkingMemoryEntryPoint entryPoint1 = session.getWorkingMemoryEntryPoint(“US-office"); entryPoint1.insert(fact); 15
  • 16. Sliding Windows • Supports 2 sliding window implementations: • Sliding time windows • Sliding length windows • Time - Fire rules on events which occurred in last 2 mins when Event() over window:time( 2m ) then rule "Sound the alarm in case temperature rises above threshold" when TemperatureThreshold( $max : max ) Number( doubleValue > $max ) from accumulate( SensorReading( $temp : temperature ) over window:time( 10m ), average( $temp ) ) then // sound the alarm end 16
  • 17. Sliding Time Windows • Fire rules on events which occurred in last 2 mins • sound an alarm in case the average temperature over the last 10 minutes read from a sensor is above the threshold value when Event() over window:time( 2m ) then rule "Sound the alarm in case temperature rises above threshold" when TemperatureThreshold( $max : max ) Number( doubleValue > $max ) from accumulate( SensorReading( $temp : temperature ) over window:time( 10m ), average( $temp ) ) then // sound the alarm end 17
  • 18. Sliding Length Windows • Sliding length implementation consider events based on order of their insertion into the session • sound an alarm in case the average temperature for last 100 entries from sensor is above the threshold value when Event(type == “securitylogs”) over window:length( 10 ) then rule "Sound the alarm in case temperature rises above threshold" when TemperatureThreshold( $max : max ) Number( doubleValue > $max ) from accumulate( SensorReading( $temp : temperature ) over window:length( 100 ), average( $temp ) ) then // sound the alarm end 18
  • 19. Memory Management for Events 1. Explicit expiration offset 2. Inferred expiration offset declare Event @expires( 30m ) end rule "correlate orders" when $bo : BuyOrderEvent( $id : id ) $ae : AckEvent( id == $id, this after[0,10s] $bo ) then // do something end 19
  • 20. Temporal Reasoning operators • Drools implements all 13 temporal operators defined in Allen’s paper • Example: match if and only if the temporal distance between the time when, eventB finished and the time when $eventA started is between ( 3 minutes and 30 seconds ) and ( 4 minutes ). After, before, coincides, during, finishes, finished by, includes, meets, met by, overlaps, overlapped by, starts, started by $eventA : EventA( this after[ 3m30s, 4m ] $eventB ) 20
  • 22. jBPM • a flexible Business Process Management (BPM) Suite. • offers process management features suited for both business users and developers • allows you to model your business goals using flowcharts • Domain-specific nodes can be plugged to make the processes more easily understood by business users. • Eclipse-based and web-based editor • History logging (for querying / monitoring / analysis) • Optional process repository to deploy your process (and other related knowledge) 22