drools workshop 2015 - latam

36
DROOLS COMMUNITY DROOLS COMMUNITY WORKSHOP WORKSHOP November 2015 Mauricio Salatino http://salaboy.com @salaboy

Upload: mauricio-salaboy-salatino

Post on 15-Feb-2017

1.219 views

Category:

Technology


1 download

TRANSCRIPT

DROOLS COMMUNITYDROOLS COMMUNITYWORKSHOPWORKSHOPNovember 2015

Mauricio Salatino

http://salaboy.com

@salaboy

AGENDAAGENDAI N T R O D U C T I O N T O D R O O L SI N T R O D U C T I O N T O D R O O L S

K I E P L AT F O R MK I E P L AT F O R M

D R O O L S F U S I O ND R O O L S F U S I O N

R O A D M A PR O A D M A P

C O M M U N I T Y T I M E !C O M M U N I T Y T I M E !

DISCLAIMERDISCLAIMERC O M M U N I T Y V S P R O D U C TC O M M U N I T Y V S P R O D U C T

HTTP://BLOG.ATHICO.COM/2011/04/DROOLS-JBPM-HTTP://BLOG.ATHICO.COM/2011/04/DROOLS-JBPM-COMMUNITY-VERSUS-PRODUCT.HTMLCOMMUNITY-VERSUS-PRODUCT.HTML

ABOUT MYSELFABOUT MYSELF SENIOR SOFTWARE ENGINEER @ RED HAT / JBOSSSENIOR SOFTWARE ENGINEER @ RED HAT / JBOSS

System Integrator / App Builder / Tools DevAuthor of some books about jBPM & DroolsMy Blog: http://salaboy.com My twitter: @salaboyPassionate about Drools & jBPM

KIE KIE (DISCLAIMER)(DISCLAIMER)

K N O W L E D G E I S E V E RY T H I N GK N O W L E D G E I S E V E RY T H I N GUmbrella for a set of ProjectsKnowledge formalisation, automation & monitoringKIE Api is about al l these projectsOpen the doors for other projects sharing similar approaches

INTRODUCTION TO DROOLS INTRODUCTION TO DROOLS H I S TO RYH I S TO RY

W H AT I S D R O O L S ?W H AT I S D R O O L S ?

H O W D O E S I T F I T I N O U RH O W D O E S I T F I T I N O U RI N F R A S T R U C T U R E ?I N F R A S T R U C T U R E ?

L E T ' S W R I T E S O M E R U L E S !L E T ' S W R I T E S O M E R U L E S !

HISTORYHISTORYB E G I N I N GB E G I N I N G

2003: Created by Mark Proctor and Bob McWhirter @ Codehaus2005: Acquired by JBoss 2008: Drools 3.x released - Rete OO init ial version

HISTORYHISTORYD R O O L S 3 . X ( 2 0 0 9 )D R O O L S 3 . X ( 2 0 0 9 )

Build with the Java Ecosystem in mindFirst version of the RETE OO AlgorithmBig competitor of JESS -> CLIPS port for JavaTeam size = 3 approx.

HISTORYHISTORYD R O O L S 4 . X ( 2 0 1 1 )D R O O L S 4 . X ( 2 0 1 1 )

Focused on performanceFocused on real l i fe implementationHuge adoption in real l i fe scenariosSeveral Bootcamps around the worldWorld wide community around the projectTeam size = 7 approx.

HISTORYHISTORYD R O O L S 5 . X ( 2 0 1 3 )D R O O L S 5 . X ( 2 0 1 3 )

Focused on integration and unification

Drools ExpertDrools FusionDrools Flow ( jBPM)

Unified APIs (first version)Team size = 12 approx.

HISTORYHISTORYD R O O L S 6 . X ( 2 0 1 5 )D R O O L S 6 . X ( 2 0 1 5 )

Focused on Infrastructure, Deployment and ToolingKIE Platform definition & init ial version

Uberfire (GWT / ERRAI)Workbench first version

Team size = 27 approx.

WHAT IS DROOLS?WHAT IS DROOLS?R U L E E N G I N E / I N F E R E N C E E N G I N ER U L E E N G I N E / I N F E R E N C E E N G I N E

Technically depends on your needs

Core: l ightweight java l ibrary that you can embed in your appsServer: standalone server

Rule Engine -> Inference Engine

Data Driven -> Forward Chaining Goal Driven -> Backward Chaining

Nowadays Drools is a Hybrid Engine

RULE ENGINERULE ENGINE

SIMPLE RULESIMPLE RULE

rule “Large Orders require approval”

when

Order(items.size >= 10 && total >= 100000)

then

// Trigger approval process

end

MATCHING CYCLEMATCHING CYCLE

HOW DOES IT FIT?HOW DOES IT FIT?. . . I N O U R I N F R A S T R U C T U R E . . .. . . I N O U R I N F R A S T R U C T U R E . . .

You choose based on your scenario

Framework approachServer approachBoth

Hype on MicroServicesDeployment / Distribution / Scaling

Docker / KubernetesOpenshif t Origin

SIMPLE APPSIMPLE APP

APP + REPOSITORYAPP + REPOSITORY

(MICRO) SERVICE(MICRO) SERVICE

SERVICE + KIE SERVERSERVICE + KIE SERVER

CENTRAL KIE SERVERCENTRAL KIE SERVER

KIE SERVER ASKIE SERVER ASINTEGRATION HUBINTEGRATION HUB

THE CLOUD AND BEYONDTHE CLOUD AND BEYOND

KIE APIS KIE APIS H I G H L I G H T SH I G H L I G H T S

Packaging

KJARkmodule.xml

Runtime

KieContainerKieBaseKieSession

KIE APISKIE APISK I E S E S S I O NK I E S E S S I O NREPRESENTS ONE INSTANCE OF THE RULE ENGINEREPRESENTS ONE INSTANCE OF THE RULE ENGINE

Operations

FactHandle insert(Object fact) ;delete(FactHandle handle) ;update(FactHandle handle, Object fact) ;fireAllRules() & fireAllRules( int max)getQueryResults(String queryName, Object... arguments)

EXAMPLESEXAMPLES... CHOOSE YOUR OWN ...... CHOOSE YOUR OWN ...

My First Drools Project : Drools + CDI + Test (Arquil l ian)Drools Rules Examples : some rules examples with dif ferent fil ters and patterns

You can analyse these rules using phreak-inspector

KIE CI (Continuous Integration)

Packing Drools as a MicroService using Wildfly SwarmDrools & Docker

Drools Shopping Cart Example : REST endpoint hiding Drools, intermediate rulesDrools Fusion CEP exampleKIE Server & Docker

KIE PLATFORMKIE PLATFORMP R O J E C T S / C O M P O N E N T SP R O J E C T S / C O M P O N E N T S

Drools ExpertDrools FusionOptaPlannerjBPMKIE ServerUberfire

Workbench

KIE Workbench: Drools & jBPM Authoring + Runtime + MonitoringDrools Workbench: Rules Authoring + KIE Server integrationOptaPlanner Future

KIE WORKBENCHKIE WORKBENCHA R C H I T E C T U R EA R C H I T E C T U R E

KIE WORKBENCHKIE WORKBENCHD E M OD E M O

ROADMAPROADMAPCOMMUNITYCOMMUNITY

Cloud Deployments (tooling for the Cloud)Self-Service ApplicationsDif ferent Vertical 's Packages (Healthcare, Finance, HR, etc)Phreak Optimisations + TuningAPI refactoring towards ServicesMiscellaneous

jBPM Modeller Migration to Lienzo GWT(work in progress)Governance revisionMigration to microservice architectureLivespark project

COMMUNITYCOMMUNITYR E S O U R C E SR E S O U R C E S

Official KIE Blog: http://blog.athico.com

Sites: drools.org, jbpm.org, uberfireframework.org

Report issues: http://j ira. jboss.org -> please with a reproducer

Github: github.com/droolsjbpm/ -> feel free to fork and send pull requests

If you want to contribute get in touch!

IRC: freenode.net #drools #jbpm #uberfire

Look for Drools & jBPM books on Amazon

twitter.com/salaboy

THANK YOU!THANK YOU!

linkedin.com/u/salaboy

BONUS TRACKBONUS TRACKP H R E A KP H R E A K

PHREAK ALGORITHMPHREAK ALGORITHMR E T E E VO L U T I O NR E T E E VO L U T I O NSMALLER TITLESMALLER TITLE

PHREAK takes some of the concepts in the RETE, RETE/UL, LEAPS and Collection OrientedMatch to optimise how the evaluations are performed.

Some characteristics:

The RETE network is sti l l the same (it maintains the same static structure)In runtime PHREAK performs lazy evaluations in contrast with RETEThree levels of memory segments that can be l inked/unlinked for spl itt ing evaluations

RETE NETWORK EXAMPLERETE NETWORK EXAMPLE

PHREAK SEGMENTSPHREAK SEGMENTSPARTITIONINGPARTITIONING