وبلاگ بلیان

Mastering JBoss Drools 6 : Discover the Power of Drools 6 and Business Rules for Developing Complex Scenarios in Your Applications

معرفی کتاب «Mastering JBoss Drools 6 : Discover the Power of Drools 6 and Business Rules for Developing Complex Scenarios in Your Applications» نوشتهٔ Mauricio Salatino, Esteban Aliverti, Mariano Nicolas De Maio، منتشرشده توسط نشر Packt Publishing - ebooks Account در سال 2016. این کتاب در 5 صفحه، فرمت pdf، زبان انگلیسی ارائه شده است.

**Discover the practical applications of Business Rules and the power of the Drools 6 runtime to resolve several real-life scenarios** About This Book* Implement and model different rules using the DRL full syntax * Model complex business decisions and domain models in order to automate and improve your operational decisions with the Drools framework * A practical, fast-paced, hands-on guide to help you use the different components provided by the Drools Rule Engine Who This Book Is ForThis book is for Java developers and architects who need to have a deep understanding of how the Business Rule frameworks behave in real-life implementations. The book assumes that you know the Java language well and also have experience with some widely used frameworks such as Hibernate. You should also know the basics of relational databases and Maven-based applications. What You Will Learn* Automate your application's decisions, such as promotion applying, discount policies, fraud detection, and more * Quickly get started with writing your first rules using the DRL full syntax * Discover the power of the new syntax components of the rule language * Define inferences in your Business Rules to simplify complex decisions * Write decision tables, templates, domain-specific languages and scorecards and learn how to map them inthe Drools framework * Harness the full operational power of Drools through all of its configuration points * Use Drools configurations and architectures for different environments and scenarios In DetailMastering JBoss Drools 6 for Developers will provide you with the knowledge to develop applications that use complex scenarios, where Business Rules are a foundation. You will get to know about the KIE modules needed to create a rule environment, how to use the modules to create a rule runtime, and how the PHREAK algorithm works to enable rules to detect situations in the most performant way. We also cover the relationship that Drools has with the BPM Engine (jBPM), which allows you to enrich your applications.. You can define rules using domain-specific languages, such as spreadsheets, database entries, PMML, or even natural language. You will be briefly introduced to the concept of complex event processing and features such as events, type declarations, and other components of Drools Fusion to detect and manage complex events. Toward the end, this book will take you through the integration of Drools with the Spring and Camel frameworks for more complex applications. Cover 1 Copyright 3 Credits 4 About the Authors 5 About the Reviewer 7 www.PacktPub.com 8 Table of Contents 10 Preface 16 Chapter 1: Rules Declarative Nature 22 What are rules? 23 Rules basic structure 23 Declarative approach 24 Imperative versus Declarative implementation 24 Why do we use rules? 26 Rules independence 26 Rule execution chaining 27 Atomicity of rules 28 Ordering of rules 28 Rule execution life cycle 29 Collaboration with Rules 30 Involving more people with Rules using a BRMS 32 Letting the rule engine do its job 33 Rule engine algorithm 34 When should we use rules? 35 Complex scenario, simple rules 35 Ever-changing scenarios 36 Example–eShop system 37 When not to use a rule engine 38 Summary 39 Chapter 2 : Writing and Executing Rules 40 Setting up our environment 41 Creating our first Drools project 42 Writing and executing our first rule 45 Using CDI to bootstrap the Rule Engine 49 The Rule language 51 Organizing our projects 56 Summary 61 Chapter 3 : Drools Runtime 62 Understanding the Drools runtime instances 62 KieModule & KieContainer 65 Loading rules from the classpath 66 Loading rules using Maven artifacts (Kie-CI) 69 KieModule configurations (KieBases, KieSessions & StatelessKieSessions) 70 KieScanner 74 Artifacts version resolution 75 Dealing with unexpected issues and errors 78 Putting it all together 78 Summary 81 Chapter 4 : Improving Our Rule Syntax 82 Adding external interactions with global variables 82 Modifying the data in the working memory 83 The insert keyword 84 The modify and update keywords 85 The delete/retract keywords 86 Rule attributes 87 Example – controlling which rules will fire 88 Example – splitting rule groups with agenda group 91 Other types of rule groups 93 Rule dates management 94 Controlling loops in rules 95 Lock-on-active 97 Model properties execution control 98 Declared types 99 Property-reactive beans 100 Special Drools operations 102 Boolean and numeric operations 103 Regex operations – matches 104 Collection operations – contains and memberOf 104 Working memory breakdown: the from clause 105 Collect from objects 107 Accumulate keyword 108 Advanced conditional elements 112 NOT keyword 113 EXISTS and FORALL keywords 113 Drools syntactic sugar 115 Nested accessors 115 Inline casts 116 Null-safe operators 116 Decorating our objects in memory 116 Adding traits with the don keyword 118 Removing traits with the shed keyword 118 Logical insertion of elements 119 Handling deviations of our rules 120 Deviations to our deviations 121 Rule inheritance 123 Conditional named consequences 123 Summary 124 Chapter 5 : Understanding KIE Sessions 126 Stateless and stateful Kie Sessions 127 Stateless Kie Sessions 127 Stateful Kie Sessions 130 Kie runtime components 131 Globals 131 Globals as a way to parameterize the condition of a pattern 132 Globals as a way to introduce new information into a session in the LHS 135 Globals as a way to collect information from a session 137 Globals as a way to interact with external systems in the RHS 138 Channels 139 Queries 141 On-demand queries 142 Live queries 143 Event Listeners 144 Kie Base components 146 Functions 146 Custom operators 148 Custom accumulate functions 155 Summary 159 Chapter 6 : Complex Event Processing 160 What is complex event processing? 160 What are events and complex events? 161 Declaring CEP-based Rules 162 Semantics of events 163 Declaring time-based-events in Drools 164 Temporal operators 165 Event-driven architecture 169 Split event sources with entry points 170 Sliding windows 171 Length-based sliding windows 171 Time-based sliding windows 172 Declared sliding windows 173 Running CEP-based Scenarios 174 Stream processing configuration 174 Continuous versus Discrete rule firing 175 Testing with the session clock 176 Drools CEP limitations 177 Summary 179 Chapter 7 : Human-Readable Rules 180 Domain Specific Languages 181 The Dictionary file 181 Adding constraints to patterns 183 Rules files 184 DSL troubleshooting 185 A simple scenario 186 Decision tables 188 What is a decision table? 189 Decision tables structure 189 RuleSet section 190 RuleTable section 192 Coming back to our scenario 194 Decision table troubleshooting 196 Enhanced decision tables 197 Rule templates 199 Rule template structure 199 Working with rule templates 201 Spreadsheet data source 202 Array data source 203 Objects data source 204 SQL result set data source 205 PMML 206 PMML in Drools 207 Customer classification decision tree example 209 Header 210 DataDictionary 210 Model 211 PMML troubleshooting 212 PMML limitations 212 Summary 213 Chapter 8 : Rules' Testing and Troubleshooting 214 Create loosely coupled DRLs 215 Prefer KieHelper over a KieContainer classpath 215 Benefits of using globals 216 Debugging the left-hand side of a rule 217 Left-hand side troubleshooting 218 Compilation errors 218 Runtime errors 219 Rules not being triggered 221 Event listeners 225 Drools logs 228 Create simpler versions of a rule 228 Debugging the right-hand side of a rule 229 Right-hand side troubleshooting 230 Compilation errors 230 Runtime errors 231 Right-hand side good practices 232 Dumping the generated Java classes 233 Reporting a bug in Drools 234 Summary 234 Chapter 9 : Introduction to PHREAK 236 Introducing PHREAK 237 Object Type Nodes 239 Alpha Nodes 241 Alpha Node sharing 242 Constraint JIT compilation 244 Beta Nodes 244 Beta Node sharing 246 Or between patterns 249 Special nodes in the network 250 The Not Node 251 The Exists Node 252 The Accumulate Node 254 The From Node 255 Queries and backward-chaining 257 Unification 258 Positional arguments 261 Backward reasoning in Drools 262 The Query Element Node 265 PHREAK improvements over RETE 266 Delayed rule evaluation 266 Set-oriented propagation 266 Network segmentation 267 Phreak Inspector 267 Summary 268 Chapter 10 : Integrating Rules and Processes 270 jBPM – the process engine 271 Simple business process example 273 Kie Session advanced configurations 276 Kie Session event listeners 276 Kie Session Work Items 276 Understanding our process execution 281 Drools and jBPM: integration patterns 284 Accessing the process engine from our rules 285 Process instances as facts 286 BPMN2 Business Rule Tasks 288 Persistence and transactions 291 How is state persisted? 291 JPA implementation 293 Infinispan implementation 295 Extending persisted data 297 Transaction management 299 Summary 300 Chapter 11 : Integrating Drools with our Apps 302 Architecture considerations 303 Asynchronous versus Synchronous Design 303 Integrating with the rest of an application 305 Embedding Drools into our application 305 Knowledge as a Service 307 CDI integration 309 Spring integration 309 Introducing Spring Framework 310 Kie Spring Config example 310 Camel integration 311 Integrating the Apache Camel framework 311 Creating our Kie endpoints 311 Kie Execution Server 313 Configuring Kie Server 314 Default exposed Kie Server endpoints 315 Kie Workbench 317 Drools and beyond: extending our functionality 320 Summary 322 Index 324 Annotation Discover the power of Drools 6 and Business Rules for developing complex scenarios in your applicationsAbout This Book Implement and model different rules using the DRL full syntax Model complex business decisions and domain models in order to automate and improve your operational decisions with the Drools framework A practical, fast-paced, hands-on guide to help you use the different components provided by the Drools Rule EngineWho This Book Is ForThis book is for Java developers and architects who need to have a deep understanding of how to create or integrate your applications with the Drools Rules Framework. The book assumes that you know the Java language well and also have experience with some widely used frameworks, such as Spring. You should also know the basics of Maven-based applications. What You Will Learn Automate your application's decisions, such as promotion applying, discount policies, fraud detection, and more. Quickly get started with writing your first rules using the DRL full syntax. Discover the power of the new syntax components of the rule language. Define inferences in your business rules to simplify complex decisions. Write decision tables, templates, domain-specific languages, and scorecards, and learn how to map them to the Drools framework. Harness the full operational power of Drools through all of its configuration points. Use Drools configurations and architectures for different environments and scenarios. In DetailMastering JBoss Drools 6 will provide you with the knowledge to develop applications involving complex scenarios. You will learn how to use KIE modules to create and execute Business Rules, and how the PHREAK algorithm internally works to drive the Rule Engine decisions. This book will also cover the relationship between Drools and jBPM, which allows you to enrich your applications by using Business Processes. You will be briefly introduced to the concept of complex event processing (Drools CEP) where you will learn how to aggregate and correlate your data based on temporal conditions. You will also learn how to define rules using domain-specific languages, such as spreadsheets, database entries, PMML, and more. Towards the end, this book will take you through the integration of Drools with the Spring and Camel frameworks for more complex applications. Style and approachApproached from a developer's perspective, the book teaches you all the advanced concepts of Business Rules applicable examples with helpful screenshots, diagrams, tutorials, and examples Discover the practical applications of Business Rules and the power of the Drools 6 runtime to resolve several real-life scenarios About This Book Implement and model different rules using the DRL full syntax Model complex business decisions and domain models in order to automate and improve your operational decisions with the Drools framework A practical, fast-paced, hands-on guide to help you use the different components provided by the Drools Rule Engine Who This Book Is For This book is for Java developers and architects who need to have a deep understanding of how the Business Rule frameworks behave in real-life implementations. The book assumes that you know the Java language well and also have experience with some widely used frameworks such as Hibernate. You should also know the basics of relational databases and Maven-based applications. What You Will Learn Automate your application's decisions, such as promotion applying, discount policies, fraud detection, and more Quickly get started with writing your first rules using the DRL full syntax Discover the power of the new syntax components of the rule language Define inferences in your Business Rules to simplify complex decisions Write decision tables, templates, domain-specific languages and scorecards and learn how to map them inthe Drools framework Harness the full operational power of Drools through all of its configuration points Use Drools configurations and architectures for different environments and scenarios In Detail Mastering JBoss Drools 6 for Developers will provide you with the knowledge to develop applications that use complex scenarios, where Business Rules are a foundation. You will get to know about the KIE modules needed to create a rule environment, how to use the modules to create a rule runtime, and how the PHREAK algorithm works to enable rules to detect situations in the most performant way. We also cover the relationship that Drools has with the BPM Engine (jBPM), which allows you to enrich your applications.. You can define rules using domain-specific languages, such as spreadsheets, database entries, PMML, or even natural language. You will be briefly introduced to the concept of complex event processing and features such as events, type declarations, and other components of Drools Fusion to detect and manage complex events. Toward the end, this book will take you through the integration of Drools with the Spring and Camel frameworks for more complex applications. Discover the power of Drools 6 and Business Rules for developing complex scenarios in your applications.Key Features[•] Implement and model different rules using the DRL full syntax[•] Model complex business decisions and domain models in order to automate and improve your operational decisions with the Drools framework[•] A practical, fast-paced, hands-on guide to help you use the different components provided by the Drools Rule EngineBook DescriptionMastering JBoss Drools 6 will provide you with the knowledge to develop applications involving complex scenarios. You will learn how to use KIE modules to create and execute Business Rules, and how the PHREAK algorithm internally works to drive the Rule Engine decisions. This book will also cover the relationship between Drools and jBPM, which allows you to enrich your applications by using Business Processes. You will be briefly introduced to the concept of complex event processing (Drools CEP) where you will learn how to aggregate and correlate your data based on temporal conditions. You will also learn how to define rules using domain-specific languages, such as spreadsheets, database entries, PMML, and more. Towards the end, this book will take you through the integration of Drools with the Spring and Camel frameworks for more complex applications.What you will learn[•] Automate your application's decisions, such as promotion applying, discount policies, fraud detection, and more.[•] Quickly get started with writing your first rules using the DRL full syntax.[•] Discover the power of the new syntax components of the rule language.[•] Define inferences in your business rules to simplify complex decisions.[•] Write decision tables, templates,domain-specific languages, and scorecards, and learn how to map them to the Drools framework.[•] Harness the full operational power of Drools through all of its configuration points.[•] Use Drools configurations and architectures for different environments and scenarios.Who this book is forThis book is for Java developers and architects who need to have a deep understanding of how to create or integrate your applications with the Drools Rules Framework. The book assumes that you know the Java language well and also have experience with some widely used frameworks, such as Spring. You should also know the basics of Maven-based applications.
دانلود کتاب Mastering JBoss Drools 6 : Discover the Power of Drools 6 and Business Rules for Developing Complex Scenarios in Your Applications