Upgrade to Pro — share decks privately, control downloads, hide ads and more …

KieLive#24: DMN: squeeze the most out these features

KieLive#24: DMN: squeeze the most out these features

A pragmatic approach to Decision Management with DMN

Link to the live streaming: http://red.ht/KieLive24

KieLive#24: DMN: squeeze the most out these features

Decision Management is an important pillar of Business Automation and a key aspect of all Digital Transformation initiatives. DMN as an open standard is a very effective enabler of decision management both from a methodological but also pragmatic perspective, since the execution semantic is defined in the specification itself. We will delve into some key aspects of DMN in order to understand their characteristics, their advantages and limitations, and their best application in a cloud-native context too. This session is intended to provide interesting insights both to Business Analysts and Developers/Coders.

About the speaker:
"I contribute to the DMN execution engine used in Drools, Kogito and Red Hat Process Automation suite. I believe there is a whole new range of unexplored applications for Expert Systems (AI) within the Corporate business; additionally, I believe defining the Business Rules on the BRMS system not only enables knowledge inference from raw data but, most importantly, helps to shorten the distance between experts and analysts, between developers and end-users, business stakeholders."

Twitter: https://twitter.com/tari_manga

2c8520502587d8827bad79bd2317299b?s=128

KIE Community

February 09, 2021
Tweet

Transcript

  1. Kie Live #24

  2. Our mailing-lists: • https://groups.google.com/g/kogito-development • https://groups.google.com/g/drools-usage • https://groups.google.com/g/drools-setup All the

    channels: • https://kogito.kie.org/community • https://kie.zulipchat.com (#drools and #kogito channels)
  3. • ◦ ◦ • • •

  4. None
  5. Cloud-native application development has become the preferred model for crafting

    the innovative applications required of digital transformation strategy. Modern programming techniques now exploit shared-distributed cloud architectures, portable container technology and discrete microservices designed to quickly assemble logic , automate processes and adapt when needed. — 451 Research, 2018
  6. AI = + + Extract information from data analysis Model

    the human knowledge and expertise Solve complex problems to better resources allocations + + “The Future of Enterprise AI and Digital Decisions” Machine Learning Digital Decisioning Maths Optimization Ref: Forrester Research, Inc., “The Future of Enterprise AI and Digital Decisions”, BRAIN 2019, Bolzano Rules and Artificial INtelligence Summit Sep 2019
  7. Source: https://www.pcmag.com/news/gartners-top-strategic-technology-trends-for-2021

  8. None
  9. What is Business Analysis? Strategic Analysis IT Analysis Business Analysis

  10. None
  11. Business Automation

  12. Decision Process Business Automation Mathematical Optimization Vehicle Routing // Socrates

    is human. session.insert(new Human("Socrates")); rule "All humans are mortals" when $h : Human() then insertLogical( new Mortal( $h.getName() ) ); end query "Is Socrates mortal?" Mortal( name == "Socrates" ) end
  13. A Standard Based Approach

  14. Decision Management

  15. • Formal methodologies and best practices ◦ Availability of books,

    training, best practices ◦ Availability of professionals, cost reduction • Tools to help with knowledge capturing/mining/modelling ◦ A common ground where IT and Business can meet and collaborate • Scalable, cloud based, dynamic runtimes ◦ Means to draw results from the join effort • Integrated BAM KPI monitoring and analysis for decision services ◦ Means to optimize and improve
  16. DMN, which stands for Decision Model and Notation, is a

    relatively new standard managed by OMG, the organization behind BPMN. … [DMN] is trying to do for Business Decision Management what BPMN did for Business Process Management a decade ago: empower the business to take charge of the logic that drives its operations, through a vendor-independent diagramming language. – Bruce Silver, http://methodandstyle.com/what-is-dmn
  17. • A standard for Decision Management from OMG • A

    sibling and complementary standard to BPMN (processes) and CMMN (case management) • Standardizes decision automation from modelling to execution
  18. • A standard with the potential to drive radical change

    in the DM market ◦ Similar to the impact BPMN caused on the BPM market 10 years ago • A complement to analytics and AI models in general: ◦ DMN integrates with analytic models and provides explainable white box decisions ◦ Important to meet requirements like GDPR compliance • A complement to blockchain smart contract implementations
  19. DMN Introduction: a decision logic example Input Node Decision Node

    Business Knowledge Model
  20. None
  21. • DMN models are one of the supported Drools assets

    ◦ New capability behind the same API ◦ DMN and DRL overlap only for a subset of Drools features ◦ The strength of DMN lies on its standard language, business appeal, and ease of documentation • DMN focus on Decisions, not Rules • DMN models are stateless only ◦ Statefulness can be emulated by retaining state on the client See also https://stackoverflow.com/a/52343002/893991
  22. See also https://stackoverflow.com/a/52343002/893991 DMN DRL includes Decision Table paradigm ⬤

    ⬤ Stateless ⬤ ⬤ Stateful long-running sessions with mutability ◑ ⬤ CEP ◑ ⬤ a Standard notation ⬤ ◐
  23. None
  24. kie-dmn-validation: static analysis toolings • validation of DMN against specification

    XSDs • static validation of DMN file ◦ e.g.: pre-compilation phase semantic validations (duplicate names, etc.) ◦ fun-fact: static validation is performed with… Drools rules! • compilation phase checks • decision tables static analysis ◦ implementing Method & Style checks ◦ semantic checks ◦ Hit Policy recommender ◦ MC/DC test case generator*
  25. Decision Table static analysis features • Table completeness ◦ no

    gaps in the rules • Table consistency ◦ overlaps properly handled by hit policy • Subsumption ◦ rules that could be combined • Rule masking ◦ in P tables where some rule is never the top priority • "Misleading rules" in P tables • Normalization checks • Consistent with DMN expectations ◦ imported ItemDefinition types ◦ null handling ◦ FEEL expressions in output ◦ etc. • Warns about enumerated columns • Consolidated user-friendly messages
  26. The same validation is interoperable from toolings, editors, to build

    systems Contraction: Rules [1, 3] can be combined for contraction by joining on input 1 Overlap detected: Overlap values: [ 660, "Bad" ] for rules: [2, 4]. UNIQUE hit policy decision tables can only have one matching rule. Gap detected: [ >660, "Fair" ]
  27. Another fun example: Misleading rule When this decision table results

    in “CHECK” ? Example taken from Vanthienen
  28. Another fun example: Misleading rule DMN: Rule 4 is a

    misleading rule. It could be misleading over other rules, such as rule: 2 Example taken from Vanthienen
  29. Hit policy recommender in a nutshell • If there are

    Gaps, no recommendations. • If No Gaps and no Overlaps: recommend UNIQUE where possible. • If No Gaps , but Overlaps with same output: recommend ANY • If No Gaps , but Overlaps with different output: recommend PRIORITY where possible
  30. None
  31. None
  32. None
  33. None
  34. • Principles for re-use: ◦ Import Decision Services, BKMs for

    decision logic re-use ◦ Import ItemDefinitions for data structure (dictionary) re-use • At the edge of (pure) functional approach: ◦ today’s date use-case ◦ send a notification/email (with BPMN) use-case ◦ message routing (with Apache Camel) use-case
  35. None
  36. None
  37. #3 #2 • Decision Service • ItemDefinion #1 • BKMs

    • Input Data • Decision
  38. • Principles for re-use: ◦ Import Decision Services, BKMs for

    decision logic re-use ◦ Import ItemDefinitions for data structure (dictionary) re-use • At the edge of (pure) functional approach: ◦ today’s date use-case ◦ send a notification/email (with BPMN) use-case ◦ message routing (with Apache Camel) use-case
  39. None
  40. None
  41. None
  42. None
  43. See also https://github.com/RedHat-Healthcare

  44. None
  45. from("direct:hl7") .bean(HL7RoutingEventParser .class, "buildRoutingEvent(${body})" ) .claimCheck(ClaimCheckOperation .Push) .process(toMap) .process(toDMNCommand) .to("kie-local://ksession1?channel=default")

    // Drools+DMN processing .process(dmnToHeader) .claimCheck(ClaimCheckOperation .Pop) .to("log:com.redhat.idaas?level=DEBUG&showAll=true&multiline=true" ) .transform().simple("${body.messageData}" ) .filter(simple("${header.topicsHeader} contains 'MMSAllADT'")) .to("kafka:MMSAllADT?brokers={{idaas.kafka.bootstrap}} ") .end() .filter(simple("${header.topicsHeader} contains 'MMSDischarges'")) .to("kafka:MMSDischarges?brokers={{idaas.kafka.bootstrap}} ") .end();
  46. None
  47. • The OpenAPI Specification ◦ a broadly adopted industry standard

    for describing modern APIs • Out-of-the-box support for DMN ItemDefinitions, DMN evaluations • An API contract generated automatically from a DMN model • Can also be used to generate/stub clients with ease
  48. See also http://hdl.handle.net/10589/150128

  49. (demo)

  50. None
  51. See also https://github.com/tarilabs/dmn-framingham-cvd-risk-score

  52. (demo)

  53. • ◦ ◦ • ◦ ◦ • ◦ ◦ •

    ◦ ◦
  54. None
  55. • Think decisions, not rules • Focus on communication, documentation,

    common language • Cost reduction: availability of professionals, books, training • No vendor lock-in: DMN standardizes syntax and semantics ◦ DMN TCK: https://dmn-tck.github.io/tck • Native cloud based deployment on OpenShift
  56. https://drools.org/learn/documentation.html https://kogito.kie.org/guides

  57. References: DMN Validation For all levels: Medium/Advanced level: https://www.youtube.com/watch?v=eQRDc6fq2yw

  58. References: DMN Patterns For all levels: Medium/Advanced level: Y-Combinator with

    DMN/FEEL https://blog.kie.org/2020/04/functional-programming-in-dmn-it- feels-like-recursing-my-university-studies-again.html
  59. DMN recommendations and communities (cont.) https://www.mismo.org/news-and-events/all-news/mismo-recommends-dmn-standard- https://www.bpm-plus.org

  60. … and other Communities with also DMN interests https://dmcommunity.org https://dmn-tck.github.io/tck

  61. Resources https://youtu.be/zaTw1c5-47c https://youtu.be/EVXp2q_8yFw Drools featuring DMN support - https://drools.org/learn/dmn.html Learn

    DMN - http://learn-dmn-in-15-minutes.com Kogito - http://kogito.kie.org/ TrustyAI introduction: https://blog.kie.org/2020/06/trusty-ai-introduction.html TrustyAI introduction talk: https://www.youtube.com/watch?v=HdEwp2RhG7w Red Hat Business Process Automation: https://www.redhat.com/en/products/process-automation
  62. A pragmatic approach to Decision Management with DMN Abstract: Decision

    Management is an important pillar of Business Automation and a key aspect of all Digital Transformation initiatives. DMN as an open standard is a very effective enabler of decision management both from a methodological but also pragmatic perspective, since the execution semantic is defined in the specification itself. We will delve into some key aspects of DMN in order to understand their characteristics, their advantages and limitations, and their best application in a cloud-native context too. This session is intended to provide interesting insights both to Business Analysts and Developers/Coders. Speaker: Matteo Mortari I contribute to the DMN execution engine used in Drools, Kogito and Red Hat Process Automation suite. I believe there is a whole new range of unexplored applications for Expert Systems (AI) within the Corporate business; additionally, I believe defining the Business Rules on the BRMS system not only enables knowledge inference from raw data but, most importantly, helps to shorten the distance between experts and analysts, between developers and end-users, business stakeholders.