90
Mark Proctor Drools Co-creator Chief Architect BRMS and BPMS

Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Embed Size (px)

Citation preview

Page 1: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Mark ProctorDrools Co-creator Chief Architect BRMS and BPMS

Page 2: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Co-founded Drools (early 2000)

The Journey

Page 3: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

The Journey• Co-founded Drools (early 2000)

<import>org.drools.examples.fibonacci.Fibonacci</import>

<rule name="Bootstrap 1" salience="20"> <parameter identifier="f"> <class>Fibonacci</class> </parameter>

<java:condition>f.getSequence() == 1</java:condition> <java:condition>f.getValue() == -1</java:condition> <java:consequence> f.setValue( 1 ); System.err.println( f.getSequence() + " == " + f.getValue() ); drools.modifyObject( f ); </java:consequence> </rule>

Drools 2.x XML Syntax

Page 4: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

The Journey• Co-founded Drools (early 2000) • JBoss (2005)

Page 5: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

The Journey• Co-founded Drools (early 2000) • JBoss (2005) • Red Hat (2006)

Page 6: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

The Journey• Co-founded Drools (early 2000) • JBoss (2005) • Red Hat (2006) • Drools 3 (2006)

import org.drools.examples.fibonacci.FibonacciExample.Fibonacci;

rule Bootstrap when f : Fibonacci( sequence == 1 ) then modify ( f ){ value = 1 }; System.out.println( f.sequence + " == " + f.value ); end

Drools 3.x - 7.x Syntax

Page 7: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

The Journey• Co-founded Drools (early 2000) • JBoss (2005) • Red Hat (2006) • Drools 3 (2006) • Drools 4 (2007)

• Increased expressiveness • ‘from’ keyword for external data • Drools Flow • Better Performance • BRMS

Page 8: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

The Journey• Co-founded Drools (early 2000) • JBoss (2005) • Red Hat (2006) • Drools 3 (2006) • Drools 4 (2007) • Drools 5 (2009)

• Guvnor (BRMS with extjs port) • CEP • Drools-Flow full workflow • Knowledge Agent (Provisioning)

Page 9: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

The Journey• Co-founded Drools (early 2000) • JBoss (2005) • Red Hat (2006) • Drools 3 (2006) • Drools 4 (2007) • Drools 5 (2009) • Product Manager (2010)

Page 10: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

The Journey• Co-founded Drools (early 2000) • JBoss (2005) • Red Hat (2006) • Drools 3 (2006) • Drools 4 (2007) • Drools 5 (2009) • Product Manager (2010) • jBPM 5 (2011)

• incorporated from drools-flow

Page 11: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

The Journey• Co-founded Drools (early 2000) • JBoss (2005) • Red Hat (2006) • Drools 3 (2006) • Drools 4 (2007) • Drools 5 (2009) • Product Manager (2010) • jBPM 5 (2011)

• incorporated from drools-flow

Page 12: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

The Journey• Co-founded Drools (early 2000) • JBoss (2005) • Red Hat (2006) • Drools 3 (2006) • Drools 4 (2007) • Drools 5 (2009) • Product Manager (2010) • jBPM 5 (2011) • Polymita acquisition (2012)

Page 13: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

The Journey• Co-founded Drools (early 2000) • JBoss (2005) • Red Hat (2006) • Drools 3 (2006) • Drools 4 (2007) • Drools 5 (2009) • Product Manager (2010) • jBPM 5 (2011) • Polymita acquisition (2012) • Drools & jBPM 6.0 (2013)

• UberFire Workbench • Phreak • Methodolgy based:

• Author, build, deploy, utilise • Declarative

• OptaPlanner

KIE

Drools jBPMOptaPlanner UberFire

Guvnor

Drools-WB jBPM-WB

KIE-WB

Page 14: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

The Journey• Co-founded Drools (early 2000) • JBoss (2005) • Red Hat (2006) • Drools 3 (2006) • Drools 4 (2007) • Drools 5 (2009) • Product Manager (2010) • jBPM 5 (2011) • Polymita acquisition (2012) • Drools & jBPM 6.0 (2013) • Since 2011 tripled engineering team size (2017)

• with dedicated QE and UXD

KIE

Drools jBPMOptaPlanner UberFire

Guvnor

Drools-WB jBPM-WB

KIE-WB

Page 15: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

The Journey• Co-founded Drools (early 2000) • JBoss (2005) • Red Hat (2006) • Drools 3 (2006) • Drools 4 (2007) • Drools 5 (2009) • Product Manager (2010) • jBPM 5 (2011) • Polymita acquisition (2012) • Drools & jBPM 6.0 (2013) • Since 2011 tripled engineering team size (2017) • Remote engineers

• All over the globe

KIE

Drools jBPMOptaPlanner UberFire

Guvnor

Drools-WB jBPM-WB

KIE-WB

Page 16: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Co-founded Drools (early 2000) • JBoss (2005) • Red Hat (2006) • Drools 3 (2006) • Drools 4 (2007) • Drools 5 (2009) • Product Manager (2010) • jBPM 5 (2011) • Polymita acquisition (2012) • Drools & jBPM 6.0 (2013) • Since 2011 tripled engineering team size (2017) • Remote engineers • Multipliers

The Journey

KIE

Drools jBPMOptaPlanner UberFire

Guvnor

Drools-WB jBPM-WB

KIE-WB

Page 17: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Co-founded Drools (early 2000) • JBoss (2005) • Red Hat (2006) • Drools 3 (2006) • Drools 4 (2007) • Drools 5 (2009) • Product Manager (2010) • jBPM 5 (2011) • Polymita acquisition (2012) • Drools & jBPM 6.0 (2013) • Since 2011 tripled engineering team size (2017) • Remote engineers • Multipliers

The Journey

14k Twitter follows

Top 20 Java influencer 2017

Java Champion

KIE

Drools jBPMOptaPlanner UberFire

Guvnor

Drools-WB jBPM-WB

KIE-WB

Page 18: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Co-founded Drools (early 2000) • JBoss (2005) • Red Hat (2006) • Drools 3 (2006) • Drools 4 (2007) • Drools 5 (2009) • Product Manager (2010) • jBPM 5 (2011) • Polymita acquisition (2012) • Drools & jBPM 6.0 (2013) • Since 2011 tripled engineering team size (2017) • Remote engineers • Multipliers

The Journey

KIE

Drools jBPMOptaPlanner UberFire

Guvnor

Drools-WB jBPM-WB

KIE-WB

Page 19: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Co-founded Drools (early 2000) • JBoss (2005) • Red Hat (2006) • Drools 3 (2006) • Drools 4 (2007) • Drools 5 (2009) • Product Manager (2010) • jBPM 5 (2011) • Polymita acquisition (2012) • Drools & jBPM 6.0 (2013) • Since 2011 tripled engineering team size (2017) • Remote engineers • Multipliers • Super Stars

The Journey

KIE

Drools jBPMOptaPlanner UberFire

Guvnor

Drools-WB jBPM-WB

KIE-WB

Page 20: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• CI • Jenkins • Github Integration

Agile Community

Page 21: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• CI • Gate Keepers

• Peer reviewedcode merges

Agile Community

Page 22: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• CI • Gate Keepers • Sprints

• 2 Weeks

Agile Community

Page 23: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• CI • Gate Keepers • Sprints • JIRA Agile boards

• Updated in sprint meeting • Includes external contributors

Agile Community

Page 24: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• CI • Gate Keepers • Sprints • JIRA Agile boards • Feature branches

Agile Community

Page 25: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• CI • Gate Keepers • Sprints • JIRA Agile boards • Feature branches • CD

Agile Community

Page 26: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• CI • Gate Keepers • Sprints • JIRA Agile boards • Feature branches • CD • Town Halls

Agile Community

Page 27: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• CI • Gate Keepers • Sprints • JIRA Agile boards • Feature branches • CD • Town Halls

• Keep brief • Not a tutorial • Relevance • Impact

Agile Community

Page 28: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Branding • Project Names : Drools, jBPM, OptaPlanner • Product Names : Red Hat BRMS, Red Hat BPMS

Project and Product

Page 29: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Branding • 100% Open Source

Project and Product

Page 30: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Branding • 100% Open Source • Product is a branch off community

Project and Product

Page 31: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Branding • 100% Open Source • Product is a branch off community • Sanity through sanitisation

Project and Product

Page 32: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Branding • 100% Open Source • Product is a branch off community • Sanity through sanitisation • Cross platform and version compatibility

• Fuse, EAP

Project and Product

Page 33: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Branding • 100% Open Source • Product is a branch off community • Sanity through sanitisation • Cross platform and version compatibility • 3rd party certifications

• Oracle DB

Project and Product

Page 34: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Branding • 100% Open Source • Product is a branch off community • Sanity through sanitisation • Cross platform and version compatibility • 3rd party certifications • Direct impact on roadmap

Project and Product

Page 35: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Branding • 100% Open Source • Product is a branch off community • Sanity through sanitisation • Cross platform and version compatibility • 3rd party certifications • Direct impact on roadmap • Community independence

Project and Product

Page 36: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Drools • Rule Engine • CEP

KIE - Current Top Level Projects

Page 37: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Drools • Rule Engine • CEP

• jBPM • Workflow • Human Tasks

KIE - Current Top Level Projects

Page 38: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Drools • Rule Engine • CEP

• jBPM • Workflow • Human Tasks

• Optaplanner • Optimisation with Constraint Solving

KIE - Current Top Level Projects

Page 39: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Drools • Rule Engine • CEP

• jBPM • Workflow • Human Tasks

• Optaplanner • Optimisation with Constraint Solving

KIE - Current Top Level Projects

Page 40: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Drools • Rule Engine • CEP

• jBPM • Workflow • Human Tasks

• Optaplanner • Optimisation with Constraint Solving

KIE - Current Top Level Projects

Page 41: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Drools • Rule Engine • CEP

• jBPM • Workflow • Human Tasks

• Optaplanner • Optimisation with Constraint Solving

KIE - Current Top Level Projects

Page 42: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Drools • Rule Engine • CEP

• jBPM • Workflow • Human Tasks

• Optaplanner • Optimisation with Constraint Solving

• Workbench / Console

KIE - Current Top Level Projects

Page 43: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Drools • Rule Engine • CEP

• jBPM • Workflow • Human Tasks

• Optaplanner • Optimisation with Constraint Solving

• Workbench / Console • Execution Server

KIE - Current Top Level Projects

Page 44: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Drools • Rule Engine • CEP

• jBPM • Workflow • Human Tasks

• Optaplanner • Optimisation with Constraint Solving

• Workbench / Console • Execution Server • AppFormer

• Coming Soon

KIE - Current Top Level Projects

Page 45: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• UberFire • Will become AppFormer-Core

KIE - Projects to be renamed / moved

Page 46: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• UberFire • Guvnor

• Terminated • Merged into other projects

KIE - Projects to be renamed / moved

Page 47: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• UberFire • Guvnor • DashBuilder

• Moved to AppFormer - Insight

KIE - Projects to be renamed / moved

Page 48: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Cognitive Platform • e.g. CDSS

KIE AI - Knowledge is Everything

Because not everyoneis as smart as House

Page 49: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Cognitive Platform • Knowledge Representation and Reasoning (KRR)

• Core AI

KIE AI - Knowledge is Everything

Page 50: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Cognitive Platform • Knowledge Representation and Reasoning (KRR) • Hybrid and Integrated Reasoning

• Hybrid - forward, backward, relational, object graph, defeasible, beliefs

• Integrated - Drools integration with jBPM, Optaplanner, Bayesian Networks

KIE AI - Knowledge is Everything

Page 51: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Cognitive Platform • Knowledge Representation and Reasoning (KRR) • Hybrid and Integrated Reasoning

• Hybrid - forward, backward, relational, object graph, defeasible, beliefs

• Integrated - Drools integration with jBPM, OptaPlanner, Bayesian Networks

• Coming Soon • Bayesian Networks • PMML • Imperfect Reasoning (fuzzy, probability, certainty factors)

KIE AI - Knowledge is Everything

Page 52: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

7.x

Page 53: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Workbench / Data Modeller

Page 54: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Reporting

Page 55: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Execution Server

Page 56: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Workbench

Page 57: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)
Page 58: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)
Page 59: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

BPM Designer

Page 60: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

BPM Designer

Page 61: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)
Page 62: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

DashBuilder

Page 63: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)
Page 64: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Forms

Page 65: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Old Forms

Page 66: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Bootstrap Grid Views

Page 67: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Bootstrap Grid Views

Page 68: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Web Forms for Java Developers

• Pojo • JPA • Bean Validator

Page 69: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Web Forms for Java Developers

Page 70: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Decision Tables

Page 71: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)
Page 72: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

V&V

Page 73: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• For entire Table. • Rows subsuming each other. • Row redundancy. • Conflicting rows. • Unique single hit. • Missing range (gap analysis) when row contains

• current supports booleans, number and dates. • other types on way, such as enumerations

• For each row • Missing actions/conditions • Redundant actions/conditions • Conflicting conditions

Supported Validation and Verification

Page 74: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)
Page 75: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Data Sources

Page 76: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Datasource management perspective

Page 77: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Datasource management: New driver

Page 78: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Datasource management: New datasource

Page 79: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Datasource management: datasource editor

Page 80: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Datasource management: Browse schema

Page 81: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Datasource management: Browse tables

Page 82: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Datasource management: Browse data

Page 83: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Executable Model

Page 84: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Executable Model Rule rule = rule( "beta" )

.view(

expr("exprA", markV, p -> p.getName().equals("Mark"))

.indexedBy( String.class, ConstraintType.EQUAL, Person::getName, "Mark" )

.reactOn( "name", "age" ), // also react on age, see RuleDescr.lookAheadFieldsOfIdentifier

expr("exprB", olderV, p -> !p.getName().equals("Mark"))

.indexedBy( String.class, ConstraintType.NOT_EQUAL, Person::getName, "Mark" )

.reactOn( "name" ),

expr("exprC", olderV, markV, (p1, p2) -> p1.getAge() > p2.getAge())

.indexedBy( int.class, ConstraintType.GREATER_THAN, Person::getAge, Person::getAge )

.reactOn( "age" )

)

Page 85: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Thread Safety

Page 86: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

State Transition

INACTIVE

FIRE_ALL_RULES FIRE_UNTIL_HALT

HALTING

EXECUTE_TASK

fireAllRules fireUntilHalt

at rest

halt halt

executeTask

Page 87: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Multi Core Scalability

Page 88: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

• Immutable Data • Supports revision, if new instance provided

• Partitions the rules • Propagation queue per partition • Partitioning for most used class + field

• As long as that field is used in each pattern for that class. And each constraint on that field is equality, ‘==‘.

• Round robin rule allocation for all other rules • Downsides is all data goes to all partitions.

Only shows an advantage if a partition has enough match attempts to justify the cost of parallelising.

Focus on Immutable CEP use cases

Page 89: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Units, Guards and OOPath

Page 90: Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)

Unit

unit HouseUnit

rule WhileAlarmOn when /house/alarm[power == on]then drools.guard( new AlarmUnit(persons, c.age) );end

unit AlarmUnit

rule TurnSprinklerOn when when /home/alarm[status == ALERT] s : /rooms/sprinklers[status == OFF]then s.sprinkler(ON)end

rule TurnSprinklerOf when /home/alarm[status == NORMAL] s : /rooms/sprinklers[status == ON]then s.sprinkler(OFF)end

public class HouseUnit implements RuleUnit { private House house; private DataSource<Room> rooms;

public HouseUnit( House house DataSource<Room> rooms ) { this.house = house; }. . .

public class AlarmUnit implements RuleUnit { private House house; private DataSource<Room> rooms;

public AlarmUnit( House house DataSource<Room> rooms ) { this.house = house; }. . .