Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Drools Workshop @JBCNCONF 2016

1,115 views

Published on

For the source code of the workshop visit: http://github.com/salaboy/drools-game-engine and follow the instructions there :)

Published in: Software
  • Be the first to comment

Drools Workshop @JBCNCONF 2016

  1. 1. DROOLS ENABLED MICROSERVICES MAURICIO SALATINO JBCNCONF 2016 - HANDS ON WORKSHOP
  2. 2. DROOLS ENABLED MICROSERVICES INSTRUCTIONS ▸ Fork: http://github.com/salaboy/drools-game-engine/ ▸ Clone your forked repository ▸ git clone http://github.com/<user>/drools-game- engine/ ▸ cd drools-game-engine/ ▸ mvn clean install -DskipTests
  3. 3. DROOLS ENABLED MICROSERVICES AGENDA ▸ What is Drools? ▸ Rule Language / Execution Cycle ▸ Drools & Microservices ▸ Scenario
  4. 4. DROOLS ENABLED MICROSERVICES ABOUT ME ▸ Mauricio Salatino (aka Salaboy) ▸ Work for Red Hat ▸ Drools & jBPM Community ▸ http://salaboy.com ▸ @salaboy
  5. 5. DROOLS ENABLED MICROSERVICES WHAT IS DROOLS? ▸ Lightweight Rule Engine (a library) ▸ Rule Engine -> Inference Engine ▸ Change of paradigm from Imperative (Java) to Declarative
  6. 6. DROOLS ENABLED MICROSERVICES RULE STRUCTURE ▸ rule “Warn on low health”
 //<rule attributes>
 When
 Player( health <= 10 )
 Then
 // Warning.. find medicine 
 end

  7. 7. DROOLS ENABLED MICROSERVICES DROOLS ENGINE OVERVIEW (STATIC)
  8. 8. DROOLS ENABLED MICROSERVICES DROOLS ENGINE OVERVIEW (RUNTIME)
  9. 9. DROOLS ENABLED MICROSERVICES RULE EXECUTION CYCLE
  10. 10. DROOLS ENABLED MICROSERVICES KIE APIS ▸ KieContainer ▸ KieBase ▸ KieSession ▸ insert(Object) ▸ retract(FactHandle) ▸ update(FactHandle, Object) ▸ fireAllRules() / fireAllRules(int) ▸ KieScanner ▸ kmodule.xml DROOLS SPECIFICS
  11. 11. DROOLS ENABLED MICROSERVICES MICROSERVICES KEY POINTS ▸ Bounded Context - Domain Driven Design ▸ Aligned with the company structure ▸ Small, managed by a team that knows about that department requirements ▸ Using the right tool for the job ;) ▸ Release Fast - Release Early - Iterate
  12. 12. DROOLS ENABLED MICROSERVICES DROOLS ENABLED MICROSERVICES ▸ Separate the business logic from technical aspects ▸ Use the bounded context model, no need to change anything, leverage the scope ▸ Leverage the rule engine features (instead of creating in house solutions to deal with logical checks and tricky scenarios) ▸ More flexible to business changes ▸ Self documented Micro Services ▸ Micro services that provides justification for each decision made out-of the-box
  13. 13. DROOLS ENABLED MICROSERVICES SCENARIO (GAME)
  14. 14. DROOLS ENABLED MICROSERVICES SCENARIO (GAME)
  15. 15. DROOLS ENABLED MICROSERVICES INSTRUCTIONS ▸ Fork: http://github.com/salaboy/drools-game-engine/ ▸ Clone your forked repository ▸ git clone http://github.com/<user>/drools-game- engine/ ▸ cd drools-game-engine/ ▸ mvn clean install -DskipTests
  16. 16. DROOLS ENABLED MICROSERVICES RULES POWER ▸ Any Java Model (non-intrusive) ▸ Filter Data (Simple Filters) ▸ Correlate Data (Multiple filters between patterns) ▸ Accumulations / Aggregations (accumulate functions) ▸ Inference Chain ▸ Justification Log ▸ Query Data ▸ Truth Maintenance System(TMS)
  17. 17. GETTING STARTED WITH DROOLS COMMUNITY ▸ www.drools.org / www.jbpm.org ▸ Drools & jBPM Mailing lists ▸ Report Bugs & Suggest Features: jira.jboss.org ▸ irc.freenode.net ▸ #drools ▸ #jbpm ▸ Blogs: ▸ blog.athico.com ▸ salaboy.com
  18. 18. QUESTIONS? DROOLS ENABLED MICROSERVICES
  19. 19. GETTING STARTED WITH DROOLS RETE
  20. 20. GETTING STARTED WITH DROOLS PHREAK

×