Drools Happenings 7.0 - Devnation 2016

1,011 views

Published on

My talk covering Drools and it's eco system, with an eye on where we are going.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,011
On SlideShare
0
From Embeds
0
Number of Embeds
20
Actions
Shares
0
Downloads
23
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Drools Happenings 7.0 - Devnation 2016

  1. 1. Mark Proctor Drools 7.0 Happenings
  2. 2. Where we are
  3. 3. Where we were mid 2013
  4. 4. 6.4 • 6.0 Nov 2013 • 6.4 2016 • Upgrade to Pattern Fly • Fully redesign the execution server UI • Improved and augmented process runtime views
  5. 5. KIE - Knowledge Is Everything • Drools • jBPM • DashBuilder • OptaPlanner • UberFire
  6. 6. The Family Drools jBPMDashBuilder OptaPlanner GWT Errai UberFire Commons Drools WB Kie WB
  7. 7. Product Maturity Model
  8. 8. Remote Java Developer
  9. 9. Citizen Developer
  10. 10. Associate Process Manager
  11. 11. Senior Process Manager
  12. 12. Case Management
  13. 13. Case Management
  14. 14. Usability / Pattern Fly
  15. 15. Workbench / Data Modeller
  16. 16. Workbench / Data Modeller
  17. 17. jBPM Reports
  18. 18. jBPM Reports
  19. 19. Execution Server
  20. 20. Web Stack
  21. 21. GWT 2.8 + Errai • Client-side depending injection 
 (consistent with CDI). • Client-side templating. • 2-way data-binding with Pojos. • Dynamic runtime modules. • qualifier annotations to determine which dependencies. • a bean satisfies. • Constructor field and setter injections. • More CDI and EJB features: • @Alternative, @Specializes, @Produced scopes, CDI Events, JPA, … • Injecting native Javascript objects into doc with JSInterop. • Support for native DOM-based UI • support for GWT 2.8 + Java8.
  22. 22. Errai UI • Bind Java class elements to elements in an HTML template. • Template files can be HTML fragments or full pages. • The HTML file is the template. • The Java class is a template bean • Data field can be @Bound to the model and automatically updated
  23. 23. Errai - Data Binding
  24. 24. UberFire Rich Client Framework • Perspective • Screen • Page Composer • Security • Permissions • Preferences (TODO)
  25. 25. Form Builder
  26. 26. Old Form Builder
  27. 27. Bootstrap Grid Views
  28. 28. Bootstrap Grid Views
  29. 29. Web Forms for Java Developers • Pojo • JPA • Bean Validator
  30. 30. Form Builder Video
  31. 31. OpenShift JVM
  32. 32. Provisioning the Form app
  33. 33. DashBuilder / Page Composer
  34. 34. DashBuilder Example
  35. 35. DashBuilder Example
  36. 36. jBPM Runtime View
  37. 37. Data Set Creation • SQL • Bean (Java Class) • CSV • Elastic Search
  38. 38. Data Set Configuration
  39. 39. Data Set Preview
  40. 40. Advanced Configuration
  41. 41. Data Set Explorer
  42. 42. Cache
  43. 43. DashBuilder Video
  44. 44. User Group Admin Video
  45. 45. Permissions Video
  46. 46. Execution Server
  47. 47. Rule Execution Server
  48. 48. Rest Call
  49. 49. Rest Call
  50. 50. Phreak
  51. 51. ReteOO • Node Sharing • Alpha Indexing • Beta Indexing • Tree based graphs • Modify-in-place • Property Reactive • Sub-networks • Backward Chaining • Lazy Truth Maintenance • Heap Based Agenda Queue • Dynamic Rules
  52. 52. Phreak • Lazy Evaluation • Isolated Rule Evaluation • Incremental Goal Oriented Evaluations • Set Oriented Propagations • Set Oriented Match (Future) • Stack baed evaluations, with pause and resume
  53. 53. Layered Memory
  54. 54. Bit Masks and Linking
  55. 55. Bit Masks and Linking
  56. 56. Bit Masks and Linking A D R1 Not B Not C R2 R1 = A not ( B not ( C ) ) D R2 = A B C
  57. 57. Thread Safety / State Machine
  58. 58. State Transition INACTIVE FIRE_ALL_RULES FIRE_UNTIL_HALT HALTING EXECUTE_TASK fireAllRules fireUntilHalt at rest halt halt executeTask
  59. 59. fireAllRules() fireUntilHalt() sync(engineLock) isFiring() == trueTrue False waitAndEnter(FIRE_ALL_RULES) fireLoop(RestHandler.FIRE_ALL_RULES) fireAllRules() sync(engineLock) state=FIRE_UNTIL_HALTTrue False waitAndEnter(FIRE_UNTIL_HALT) fireLoop(RestHandler. FIRE_UNTIL_HALT) fireUntilHalt()
  60. 60. fireLoop Loop fireLoop(restHandler) head=takeAll() returnedFireCount=0 loop=true flush(head) head != null True head=takeAll() returnedFireCount = fireNextItem() False isFiring() == true true false atRest(head, returnedFireCount head=handleRest(restHandler) isFiring() == true immediateHalt() true false flush(head)
  61. 61. FIRE_UNTIL_HALT FIRE_ALL_RULES sync(queueLock) RestHander.FIRE_UNTIL_HALT head = takeAll() queueLock.wait() head == null && state == FIRE_UNTIL_HALT true return head false head = takeAll() The thread will sleep until the addEntry notifies it to wake up sync(engineLock) RestHander.FIRE_ALL_RULES head = takeAll() state = INACTIVE head == null true return head false
  62. 62. WaitAndEnter immediateHalt state!=INACTIVE True true engineLock.wait() state = newState waitAndEnter(newState) The thread will sleep until the immediateHalt is called which calls the engineLock.notify. Note this method must always be called from inside of a sync(engineLock) block. immedateHalt() sync(engineLock) state!=INACTIVE false true state = INACTIVE engineLock.notify() This will wake any threads currently waiting in the waitAndEnter method.
  63. 63. Multicore Scalability
  64. 64. Immutable Use Cases
  65. 65. OOPath
  66. 66. Reactive List Comprehension rule R whenn" + Adult( $child: /children ) thenn" + list.add( $child.getName() ); end
  67. 67. Nested Reactive List Comprehension rule R whenn" + Adult( $child: /children ) thenn" + list.add( $child.getName() ); end rule R whenn" + Man( $toy: /wife/children/toys ) thenn" + list.add( $toy.getName() ); end
  68. 68. No Comprehension or Reactivity rule R whenn" + Man( $toy: /wife/children/toys ) thenn" + list.add( $toy.getName() ); end rule R whenn" + Man( $toy: /wife/children.toys ) thenn" + list.add( $toy.getName() ); end
  69. 69. Constraints rule R whenn" + Man( $toy: /wife/children{age > 10}/toys ) thenn" + list.add( $toy.getName() ); end rule R whenn" + Man( $toy: /wife/children{age > 10, name.length > 5}.toys ) thenn" + list.add( $toy.getName() ); end
  70. 70. Non Reactivity rule R whenn" + Man( $toy: ?/wife/children{age > 10}/toys ) thenn" + list.add( $toy.getName() ); end rule R whenn" + Man( $toy: /wife/children{age > 10}?/toys ) thenn" + list.add( $toy.getName() ); end
  71. 71. Casting and Type Filtering rule R whenn" + Man( $name: /wife/children{ #BabyGirl, favoriteDollName.startsWith(”A”) }.name ) thenn" + list.add( $name ); end
  72. 72. Back Referencing rule R whenn" + Man( $toy: /wife/children/toys{ name.length == ../name.length } ) thenn" + list.add( $toy.getName() ); end
  73. 73. Out of Pattern Usage query isContainedIn( Thing $x, Thing $y ) $y := /$x/children or ( $z := /$x/children and isContainedIn( $z, $y; ) ) end
  74. 74. Pojo Rules
  75. 75. DRL Fire Alarm Example
  76. 76. Pojo-Rules Fire Alarm Example
  77. 77. DRL Fire Alarm Example
  78. 78. Pojo-Rules Fire Alarm Example
  79. 79. DRLX
  80. 80. DRLX • Java super-set • Java pre-processing using Antlr Java8.g • Similar approach to pizza language that gave us generics • Will output pojo-rules underneath • But be more succinct and friendly that poco-rules

×