SlideShare une entreprise Scribd logo
1  sur  65
Obey the Rules! ,[object Object],[object Object],[object Object]
What is a rules engine?
Rules engines  ,[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],Business rules Business process : keep stores well stocked. Business rule : If the number of shirts in a store gets below 15, order more.
[object Object],[object Object],[object Object],[object Object],Keep ‘em Separated
 
Why use a rules engine in your application? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How are rules defined and implemented?
Typical workflow from business to technology The organization defines the business processes.
Typical workflow from business to technology A business analyst translates business practices into business rule statements, constraints and actions.
Typical workflow from business to technology The software developer implements the rules engine component in the application. The actions and triggers are implemented by the developer. The application is deployed by a developer with the rules externalized
Typical workflow from business to technology The organization changes some business processes.
Typical workflow from business to technology If the business process doesn’t require new actions, anyone, including this silly intern with a small desk, can update the rules engine.  Win.
Why use a  client-side  rules engine in your Flex RIA? ,[object Object],[object Object],[object Object],[object Object]
How do rules engines work?
Rules Engine Anatomy ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Rules Engine Anatomy: t-shirt inventory Facts Rules Conditions Actions ,[object Object],[object Object],[object Object]
Rules Engine Anatomy: clown alarm system Facts Rules Conditions Actions ,[object Object],[object Object],[object Object],[object Object],[object Object],http://www.axecop.com
Examples!
Real world use case 1 FormBuilderUI:  AS3 rules engine under the hood ,[object Object],[object Object],[object Object]
 
 
The Stack...
The Rules... < rule  id = &quot;isFemale&quot; > < statement ><![CDATA[  @info.sex equalTo 'Female'  ]]></ statement > < actions > < visibleAction  questionIDs = &quot;areYouPregnant&quot; /> </ actions > </ rule > < rule  id = &quot;isTeenager&quot; > < statement ><![CDATA[ @info.age greaterThanOrEqualTo '13' AND  @info.age lessThan '18'  ]]></ statement > < actions > </ actions > </ rule > < rule  id = &quot;isTeenageGirl&quot; > < statement ><![CDATA[ $isTeenager AND $isFemale  ]]></ statement > < actions > < urlAction  url = &quot; http://www.seventeen.com &quot;  /> </ actions > </ rule >
Regular Expressions public   static   var  andOrTrueFalsePattern:RegExp =  /AND|OR|true|false/ gi; public   static   var  ruleTokenPattern:RegExp =  /([a-zA-Z0-9_]+)/ g; public   static   var  propertyTokenPattern:RegExp =  /([a-zA-Z0-9_.]+)/ g; public   static   var  nonSpaceGroups:RegExp =  /([a-zA-Z0-9_.'&quot;]+)([^ ])/ gi; public   static   var  quotesPattern:RegExp =  /'|&quot;/ gi;
Pattern matching a rule...
Boolean parsing using short circuit ,[object Object],var  matches:Array = [ true ,  &quot;AND&quot; ,  false ,  &quot;AND&quot; ,  true ,  &quot;OR&quot;   true ]; var  operator:String;  var  nextValue:Boolean; var  overallValue:Boolean = matches[0]; var i:int = 1; while  (i < matches.length - 1) { operator=matches[i]; nextValue=StringUtil.stringToBoolean(matches[i + 1]); if  (isAndOperator(operator)) { overallValue=(overallValue && nextValue); if  (overallValue ==  false ) return   false ; }  else   if  (isOrOperator(operator)) { overallValue=(overallValue || nextValue); if  (overallValue ==  true ) return   true ; } i = i + 2; }
Hamcrest API - Matchers: public   static   const  EQUAL_TO:String =  &quot;equalTo&quot; ; public   static   const  NOT_EQUAL_TO:String =  &quot;notEqualTo&quot; ; public   static   const  LESS_THAN:String =  &quot;lessThan&quot; ; public   static   const  LESS_THAN_OR_EQUAL_TO:String =  &quot;lessThanOrEqualTo&quot; ; public   static   const  GREATER_THAN:String =  &quot;greaterThan&quot; ; public   static   const  GREATER_THAN_OR_EQUAL_TO:String =  &quot;greaterThanOrEqualTo&quot; ; public   static   const  CONTAINS:String =  &quot;contains&quot; ;
Hamcrest API:  Get your facts straight! public   static   function  evaluateCondition(target:*, operator:String, source:*):Boolean { try  { switch  (operator) { case  Matchers.EQUAL_TO: assertThat(target, equalTo(source)); break ; case  Matchers.NOT_EQUAL_TO: assertThat(target, not(equalTo(source))); break ; case  Matchers.LESS_THAN: assertThat(Number(target), lessThan(Number(source))); break ; default : throw   new  RuleError( &quot;No matcher found for this operator!” ); } }  catch  (e:Error) { if  (e.errorID != RuleError.ILLEGAL_OPERATOR_ERROR) { value= false ; }  else  { _logger.error(e.message, e.errorID); } }
Type of Rules engines ,[object Object]
[object Object],[object Object],[object Object],[object Object],Engine types:  production(inference)
Engine types:  reactive ,[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],Rule Processing Algorithms
Basic Algorithm ,[object Object],[object Object],[object Object],[object Object]
Basic Algorithm Fact condition A Action Fact cB cC cD AND OR Fact Optimizations can give priority to certain conditions, wait to process until all facts are run through conditions, etc.
Rete Algorithm ,[object Object],[object Object],[object Object],[object Object]
Rete Algorithm ,[object Object],[object Object],[object Object],[object Object]
Rete Algorithm ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Rete Algorithm Fact1 condition A Action Fact3 cB cC cD AND OR ,[object Object],[object Object],[object Object],[object Object],[object Object],Fact2
Real world use case 2: Herff Jones Order Manager ,[object Object],[object Object],[object Object]
 
 
Technical Challenges ,[object Object],[object Object],[object Object],[object Object],[object Object]
Core Components ,[object Object],[object Object],[object Object],[object Object]
Core UI ,[object Object],[object Object],[object Object],[object Object],[object Object]
Rule XML Sample <!-- Rule definition --> < rule > < getValue  key = &quot;Metal Quality&quot; >< containsString  value = &quot;Gold&quot; /></ getValue > < addValueOption  key = &quot;Metal Finish&quot;  value = &quot;Gold-on-Gold&quot;  meta = &quot;code:2&quot; /> </ rule >
Macro XML Sample: pricing a stone <!-- Macro definition --> < defineMacro  name = &quot;priceStone&quot; > < rule > < allOf > < getValue  key = &quot;$stoneKey&quot; >< equalTo  value = &quot;$stoneValue&quot; /></ getValue > < getValue  key = &quot;$stoneSizeKey&quot; >< equalTo  value = &quot;$stoneSizeValue&quot; /></ getValue > </ allOf > < addPrice  label = &quot;$stoneKey: $stoneValue&quot;  amount = &quot;$amount&quot; /> </ rule > </ defineMacro > <!-- Macro implementation --> < priceStone  stoneKey = &quot;Royal Stone&quot;  stoneValue = &quot;Birthstones - Alexandrite (Jun)&quot;  stoneSizeKey = &quot;Royal Stone Size&quot;  stoneSizeValue = &quot;12 Point&quot;  amount = &quot;4208&quot; />
Real world use case 3: A Statewide Agency  Government Benefits Application (GBA) ,[object Object],[object Object],[object Object]
GBA Overview ,[object Object]
Functionality ,[object Object],[object Object],[object Object]
Technical Challenges ,[object Object],[object Object],[object Object]
Core Components ,[object Object],[object Object],[object Object]
...Core Components ,[object Object],[object Object],[object Object]
GBA Rules engine architecture Fact (change event) Conditions Actions User Questions Data Model Binding! Binding! Binding!
Core UI ,[object Object],[object Object],[object Object],[object Object]
Question XML < question  id = &quot;362&quot; controlType = &quot;ComboBox&quot; inlineHelp = &quot;Does anyone receive money from elsewhere?&quot; label = &quot;Other Employment&quot; optionsID = &quot;R00013&quot; target = &quot;Household.Income.OtherIncome&quot; />
Condition XML ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Rule XML < rule  id = &quot;doesAnyoneHasOtherEmployment&quot; > < statement > $hasOtherEmployment </ statement > < actions > < visibleAction  questionGroupIDs = &quot;income_other&quot; /> </ actions > </ rule > < rule  id = &quot;NoEmployment&quot; > < statement > $IsOnStrike OR ($NoFutureEmployment AND $NoCurrentEmployment AND $NoPastEmployment AND $NoOtherIncome) </ statement > < actions > < visibleAction  questionIDs = &quot;364&quot; /> </ actions > </ rule >
Data Abstraction
Dynamic Binding using ObjectProxy ,[object Object],[object Object],[object Object],[object Object],[object Object]
What next? ,[object Object],[object Object]
Forward Chaining (modus ponens) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Forward Chaining ,[object Object],[object Object],[object Object],[object Object],[object Object]
Forward Chaining:  definition ,[object Object],[object Object],[object Object],[object Object],[object Object]
Thanks for obeying. Drew McLean twitter: TunnelVisionary [email_address] RJ Owen twitter: rjowen [email_address]

Contenu connexe

Similaire à Obey the Rules! Understand business rules processing theory

Design Summit - Advanced policy state management - John Hardy
Design Summit - Advanced policy state management - John HardyDesign Summit - Advanced policy state management - John Hardy
Design Summit - Advanced policy state management - John HardyManageIQ
 
Spring Transaction
Spring TransactionSpring Transaction
Spring Transactionpatinijava
 
Business Process Execution Language
Business Process Execution LanguageBusiness Process Execution Language
Business Process Execution Language招政 蔣
 
Sap grc process control 10.0
Sap grc process control 10.0Sap grc process control 10.0
Sap grc process control 10.0Latha Kamal
 
ASP.NET MVC introduction
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introductionTomi Juhola
 
ABPerformance Quick Tour
ABPerformance Quick TourABPerformance Quick Tour
ABPerformance Quick TourActive Base
 
Michiel Overeem (AFAS) - Enterprise software schaalbaar maken met Service Fab...
Michiel Overeem (AFAS) - Enterprise software schaalbaar maken met Service Fab...Michiel Overeem (AFAS) - Enterprise software schaalbaar maken met Service Fab...
Michiel Overeem (AFAS) - Enterprise software schaalbaar maken met Service Fab...AFAS Software
 
Oracle Sql Tuning
Oracle Sql TuningOracle Sql Tuning
Oracle Sql TuningChris Adkin
 
Intelligent Supermarket using Apriori
Intelligent Supermarket using AprioriIntelligent Supermarket using Apriori
Intelligent Supermarket using AprioriIRJET Journal
 
Observability foundations in dynamically evolving architectures
Observability foundations in dynamically evolving architecturesObservability foundations in dynamically evolving architectures
Observability foundations in dynamically evolving architecturesBoyan Dimitrov
 
Priority Quick Tour
Priority Quick TourPriority Quick Tour
Priority Quick TourActive Base
 
CiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklum Ukraine
 
How to ace your .NET technical interview :: .Net Technical Check Tuneup
How to ace your .NET technical interview :: .Net Technical Check TuneupHow to ace your .NET technical interview :: .Net Technical Check Tuneup
How to ace your .NET technical interview :: .Net Technical Check TuneupBala Subra
 
Java Script Isn\'t a Toy Anymore
Java Script Isn\'t a Toy AnymoreJava Script Isn\'t a Toy Anymore
Java Script Isn\'t a Toy AnymoreAlexis Williams
 
Drools Presentation for Tallink.ee
Drools Presentation for Tallink.eeDrools Presentation for Tallink.ee
Drools Presentation for Tallink.eeAnton Arhipov
 
The correlation advantages of ANET SURELOG International Edition SIEM product
The correlation advantages of ANET SURELOG International Edition SIEM product The correlation advantages of ANET SURELOG International Edition SIEM product
The correlation advantages of ANET SURELOG International Edition SIEM product Ertugrul Akbas
 
JSON Rules Language
JSON Rules LanguageJSON Rules Language
JSON Rules Languagegiurca
 
130214 wei wu - extracting business rules and removing duplication with iris
130214   wei wu - extracting business rules and removing duplication with iris130214   wei wu - extracting business rules and removing duplication with iris
130214 wei wu - extracting business rules and removing duplication with irisPtidej Team
 
KScope14 Understanding the Zombies that lurk within your system
KScope14 Understanding the Zombies that lurk within your systemKScope14 Understanding the Zombies that lurk within your system
KScope14 Understanding the Zombies that lurk within your systemAlithya
 

Similaire à Obey the Rules! Understand business rules processing theory (20)

Design Summit - Advanced policy state management - John Hardy
Design Summit - Advanced policy state management - John HardyDesign Summit - Advanced policy state management - John Hardy
Design Summit - Advanced policy state management - John Hardy
 
Spring Transaction
Spring TransactionSpring Transaction
Spring Transaction
 
Business Process Execution Language
Business Process Execution LanguageBusiness Process Execution Language
Business Process Execution Language
 
Sap grc process control 10.0
Sap grc process control 10.0Sap grc process control 10.0
Sap grc process control 10.0
 
Boston 16 03
Boston 16 03Boston 16 03
Boston 16 03
 
ASP.NET MVC introduction
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introduction
 
ABPerformance Quick Tour
ABPerformance Quick TourABPerformance Quick Tour
ABPerformance Quick Tour
 
Michiel Overeem (AFAS) - Enterprise software schaalbaar maken met Service Fab...
Michiel Overeem (AFAS) - Enterprise software schaalbaar maken met Service Fab...Michiel Overeem (AFAS) - Enterprise software schaalbaar maken met Service Fab...
Michiel Overeem (AFAS) - Enterprise software schaalbaar maken met Service Fab...
 
Oracle Sql Tuning
Oracle Sql TuningOracle Sql Tuning
Oracle Sql Tuning
 
Intelligent Supermarket using Apriori
Intelligent Supermarket using AprioriIntelligent Supermarket using Apriori
Intelligent Supermarket using Apriori
 
Observability foundations in dynamically evolving architectures
Observability foundations in dynamically evolving architecturesObservability foundations in dynamically evolving architectures
Observability foundations in dynamically evolving architectures
 
Priority Quick Tour
Priority Quick TourPriority Quick Tour
Priority Quick Tour
 
CiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForce
 
How to ace your .NET technical interview :: .Net Technical Check Tuneup
How to ace your .NET technical interview :: .Net Technical Check TuneupHow to ace your .NET technical interview :: .Net Technical Check Tuneup
How to ace your .NET technical interview :: .Net Technical Check Tuneup
 
Java Script Isn\'t a Toy Anymore
Java Script Isn\'t a Toy AnymoreJava Script Isn\'t a Toy Anymore
Java Script Isn\'t a Toy Anymore
 
Drools Presentation for Tallink.ee
Drools Presentation for Tallink.eeDrools Presentation for Tallink.ee
Drools Presentation for Tallink.ee
 
The correlation advantages of ANET SURELOG International Edition SIEM product
The correlation advantages of ANET SURELOG International Edition SIEM product The correlation advantages of ANET SURELOG International Edition SIEM product
The correlation advantages of ANET SURELOG International Edition SIEM product
 
JSON Rules Language
JSON Rules LanguageJSON Rules Language
JSON Rules Language
 
130214 wei wu - extracting business rules and removing duplication with iris
130214   wei wu - extracting business rules and removing duplication with iris130214   wei wu - extracting business rules and removing duplication with iris
130214 wei wu - extracting business rules and removing duplication with iris
 
KScope14 Understanding the Zombies that lurk within your system
KScope14 Understanding the Zombies that lurk within your systemKScope14 Understanding the Zombies that lurk within your system
KScope14 Understanding the Zombies that lurk within your system
 

Plus de Effective

User Testing: Adapt to Fit Your Needs
User Testing: Adapt to Fit Your NeedsUser Testing: Adapt to Fit Your Needs
User Testing: Adapt to Fit Your NeedsEffective
 
Death of a Design: 5 Stages of Grief
Death of a Design: 5 Stages of GriefDeath of a Design: 5 Stages of Grief
Death of a Design: 5 Stages of GriefEffective
 
UX Design Process 101: Where to start with UX
UX Design Process 101: Where to start with UXUX Design Process 101: Where to start with UX
UX Design Process 101: Where to start with UXEffective
 
Give Them What They Want: Discovering Customer Need with Wearable Technology
Give Them What They Want: Discovering Customer Need with Wearable TechnologyGive Them What They Want: Discovering Customer Need with Wearable Technology
Give Them What They Want: Discovering Customer Need with Wearable TechnologyEffective
 
Common Innovation Myths (World Usability Day)
Common Innovation Myths (World Usability Day)Common Innovation Myths (World Usability Day)
Common Innovation Myths (World Usability Day)Effective
 
Introduction to UX
Introduction to UXIntroduction to UX
Introduction to UXEffective
 
2016 SXSW Measures for Justice Panel Picker Presentation
2016 SXSW Measures for Justice Panel Picker Presentation2016 SXSW Measures for Justice Panel Picker Presentation
2016 SXSW Measures for Justice Panel Picker PresentationEffective
 
Water For People UX Awards Submission
Water For People UX Awards SubmissionWater For People UX Awards Submission
Water For People UX Awards SubmissionEffective
 
Getting into the Game: How EA Put User Research into Practice
Getting into the Game: How EA Put User Research into PracticeGetting into the Game: How EA Put User Research into Practice
Getting into the Game: How EA Put User Research into PracticeEffective
 
Scottrade and Understanding the Customer Journey: When Segmentation Isn’t Enough
Scottrade and Understanding the Customer Journey: When Segmentation Isn’t EnoughScottrade and Understanding the Customer Journey: When Segmentation Isn’t Enough
Scottrade and Understanding the Customer Journey: When Segmentation Isn’t EnoughEffective
 
A Blended Space for Heritage Storytelling
A Blended Space for Heritage StorytellingA Blended Space for Heritage Storytelling
A Blended Space for Heritage StorytellingEffective
 
Using Behavioral Modeling to Engage Customers Throughout the Decision-Making ...
Using Behavioral Modeling to Engage Customers Throughout the Decision-Making ...Using Behavioral Modeling to Engage Customers Throughout the Decision-Making ...
Using Behavioral Modeling to Engage Customers Throughout the Decision-Making ...Effective
 
Mobile Website Design: Responsive, Adaptive or Both?
Mobile Website Design: Responsive, Adaptive or Both?Mobile Website Design: Responsive, Adaptive or Both?
Mobile Website Design: Responsive, Adaptive or Both?Effective
 
Integrated Thinking: The Answer to Enterprise IT’s Perpetual Struggle - Forre...
Integrated Thinking: The Answer to Enterprise IT’s Perpetual Struggle - Forre...Integrated Thinking: The Answer to Enterprise IT’s Perpetual Struggle - Forre...
Integrated Thinking: The Answer to Enterprise IT’s Perpetual Struggle - Forre...Effective
 
Liferay and Water For People: From Data to Information
Liferay and Water For People: From Data to InformationLiferay and Water For People: From Data to Information
Liferay and Water For People: From Data to InformationEffective
 
The Rules of UX - Enterprise 2.0
The Rules of UX - Enterprise 2.0The Rules of UX - Enterprise 2.0
The Rules of UX - Enterprise 2.0Effective
 
Making Mobile Meaningful NY 2013
Making Mobile Meaningful NY 2013Making Mobile Meaningful NY 2013
Making Mobile Meaningful NY 2013Effective
 
Experience Driven Development - Future Insights Live 2013
Experience Driven Development - Future Insights Live 2013Experience Driven Development - Future Insights Live 2013
Experience Driven Development - Future Insights Live 2013Effective
 
SXSW 2013 Daily Recap - Sunday GoodxGlobal
SXSW 2013 Daily Recap - Sunday GoodxGlobalSXSW 2013 Daily Recap - Sunday GoodxGlobal
SXSW 2013 Daily Recap - Sunday GoodxGlobalEffective
 
The Human Interface: Making UX An Integral Part of Your Technology Buying Dec...
The Human Interface: Making UX An Integral Part of Your Technology Buying Dec...The Human Interface: Making UX An Integral Part of Your Technology Buying Dec...
The Human Interface: Making UX An Integral Part of Your Technology Buying Dec...Effective
 

Plus de Effective (20)

User Testing: Adapt to Fit Your Needs
User Testing: Adapt to Fit Your NeedsUser Testing: Adapt to Fit Your Needs
User Testing: Adapt to Fit Your Needs
 
Death of a Design: 5 Stages of Grief
Death of a Design: 5 Stages of GriefDeath of a Design: 5 Stages of Grief
Death of a Design: 5 Stages of Grief
 
UX Design Process 101: Where to start with UX
UX Design Process 101: Where to start with UXUX Design Process 101: Where to start with UX
UX Design Process 101: Where to start with UX
 
Give Them What They Want: Discovering Customer Need with Wearable Technology
Give Them What They Want: Discovering Customer Need with Wearable TechnologyGive Them What They Want: Discovering Customer Need with Wearable Technology
Give Them What They Want: Discovering Customer Need with Wearable Technology
 
Common Innovation Myths (World Usability Day)
Common Innovation Myths (World Usability Day)Common Innovation Myths (World Usability Day)
Common Innovation Myths (World Usability Day)
 
Introduction to UX
Introduction to UXIntroduction to UX
Introduction to UX
 
2016 SXSW Measures for Justice Panel Picker Presentation
2016 SXSW Measures for Justice Panel Picker Presentation2016 SXSW Measures for Justice Panel Picker Presentation
2016 SXSW Measures for Justice Panel Picker Presentation
 
Water For People UX Awards Submission
Water For People UX Awards SubmissionWater For People UX Awards Submission
Water For People UX Awards Submission
 
Getting into the Game: How EA Put User Research into Practice
Getting into the Game: How EA Put User Research into PracticeGetting into the Game: How EA Put User Research into Practice
Getting into the Game: How EA Put User Research into Practice
 
Scottrade and Understanding the Customer Journey: When Segmentation Isn’t Enough
Scottrade and Understanding the Customer Journey: When Segmentation Isn’t EnoughScottrade and Understanding the Customer Journey: When Segmentation Isn’t Enough
Scottrade and Understanding the Customer Journey: When Segmentation Isn’t Enough
 
A Blended Space for Heritage Storytelling
A Blended Space for Heritage StorytellingA Blended Space for Heritage Storytelling
A Blended Space for Heritage Storytelling
 
Using Behavioral Modeling to Engage Customers Throughout the Decision-Making ...
Using Behavioral Modeling to Engage Customers Throughout the Decision-Making ...Using Behavioral Modeling to Engage Customers Throughout the Decision-Making ...
Using Behavioral Modeling to Engage Customers Throughout the Decision-Making ...
 
Mobile Website Design: Responsive, Adaptive or Both?
Mobile Website Design: Responsive, Adaptive or Both?Mobile Website Design: Responsive, Adaptive or Both?
Mobile Website Design: Responsive, Adaptive or Both?
 
Integrated Thinking: The Answer to Enterprise IT’s Perpetual Struggle - Forre...
Integrated Thinking: The Answer to Enterprise IT’s Perpetual Struggle - Forre...Integrated Thinking: The Answer to Enterprise IT’s Perpetual Struggle - Forre...
Integrated Thinking: The Answer to Enterprise IT’s Perpetual Struggle - Forre...
 
Liferay and Water For People: From Data to Information
Liferay and Water For People: From Data to InformationLiferay and Water For People: From Data to Information
Liferay and Water For People: From Data to Information
 
The Rules of UX - Enterprise 2.0
The Rules of UX - Enterprise 2.0The Rules of UX - Enterprise 2.0
The Rules of UX - Enterprise 2.0
 
Making Mobile Meaningful NY 2013
Making Mobile Meaningful NY 2013Making Mobile Meaningful NY 2013
Making Mobile Meaningful NY 2013
 
Experience Driven Development - Future Insights Live 2013
Experience Driven Development - Future Insights Live 2013Experience Driven Development - Future Insights Live 2013
Experience Driven Development - Future Insights Live 2013
 
SXSW 2013 Daily Recap - Sunday GoodxGlobal
SXSW 2013 Daily Recap - Sunday GoodxGlobalSXSW 2013 Daily Recap - Sunday GoodxGlobal
SXSW 2013 Daily Recap - Sunday GoodxGlobal
 
The Human Interface: Making UX An Integral Part of Your Technology Buying Dec...
The Human Interface: Making UX An Integral Part of Your Technology Buying Dec...The Human Interface: Making UX An Integral Part of Your Technology Buying Dec...
The Human Interface: Making UX An Integral Part of Your Technology Buying Dec...
 

Dernier

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Dernier (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Obey the Rules! Understand business rules processing theory

  • 1.
  • 2. What is a rules engine?
  • 3.
  • 4.
  • 5.
  • 6.  
  • 7.
  • 8. How are rules defined and implemented?
  • 9. Typical workflow from business to technology The organization defines the business processes.
  • 10. Typical workflow from business to technology A business analyst translates business practices into business rule statements, constraints and actions.
  • 11. Typical workflow from business to technology The software developer implements the rules engine component in the application. The actions and triggers are implemented by the developer. The application is deployed by a developer with the rules externalized
  • 12. Typical workflow from business to technology The organization changes some business processes.
  • 13. Typical workflow from business to technology If the business process doesn’t require new actions, anyone, including this silly intern with a small desk, can update the rules engine. Win.
  • 14.
  • 15. How do rules engines work?
  • 16.
  • 17.
  • 18.
  • 20.
  • 21.  
  • 22.  
  • 24. The Rules... < rule id = &quot;isFemale&quot; > < statement ><![CDATA[ @info.sex equalTo 'Female' ]]></ statement > < actions > < visibleAction questionIDs = &quot;areYouPregnant&quot; /> </ actions > </ rule > < rule id = &quot;isTeenager&quot; > < statement ><![CDATA[ @info.age greaterThanOrEqualTo '13' AND @info.age lessThan '18' ]]></ statement > < actions > </ actions > </ rule > < rule id = &quot;isTeenageGirl&quot; > < statement ><![CDATA[ $isTeenager AND $isFemale ]]></ statement > < actions > < urlAction url = &quot; http://www.seventeen.com &quot; /> </ actions > </ rule >
  • 25. Regular Expressions public static var andOrTrueFalsePattern:RegExp = /AND|OR|true|false/ gi; public static var ruleTokenPattern:RegExp = /([a-zA-Z0-9_]+)/ g; public static var propertyTokenPattern:RegExp = /([a-zA-Z0-9_.]+)/ g; public static var nonSpaceGroups:RegExp = /([a-zA-Z0-9_.'&quot;]+)([^ ])/ gi; public static var quotesPattern:RegExp = /'|&quot;/ gi;
  • 27.
  • 28. Hamcrest API - Matchers: public static const EQUAL_TO:String = &quot;equalTo&quot; ; public static const NOT_EQUAL_TO:String = &quot;notEqualTo&quot; ; public static const LESS_THAN:String = &quot;lessThan&quot; ; public static const LESS_THAN_OR_EQUAL_TO:String = &quot;lessThanOrEqualTo&quot; ; public static const GREATER_THAN:String = &quot;greaterThan&quot; ; public static const GREATER_THAN_OR_EQUAL_TO:String = &quot;greaterThanOrEqualTo&quot; ; public static const CONTAINS:String = &quot;contains&quot; ;
  • 29. Hamcrest API: Get your facts straight! public static function evaluateCondition(target:*, operator:String, source:*):Boolean { try { switch (operator) { case Matchers.EQUAL_TO: assertThat(target, equalTo(source)); break ; case Matchers.NOT_EQUAL_TO: assertThat(target, not(equalTo(source))); break ; case Matchers.LESS_THAN: assertThat(Number(target), lessThan(Number(source))); break ; default : throw new RuleError( &quot;No matcher found for this operator!” ); } } catch (e:Error) { if (e.errorID != RuleError.ILLEGAL_OPERATOR_ERROR) { value= false ; } else { _logger.error(e.message, e.errorID); } }
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35. Basic Algorithm Fact condition A Action Fact cB cC cD AND OR Fact Optimizations can give priority to certain conditions, wait to process until all facts are run through conditions, etc.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.  
  • 42.  
  • 43.
  • 44.
  • 45.
  • 46. Rule XML Sample <!-- Rule definition --> < rule > < getValue key = &quot;Metal Quality&quot; >< containsString value = &quot;Gold&quot; /></ getValue > < addValueOption key = &quot;Metal Finish&quot; value = &quot;Gold-on-Gold&quot; meta = &quot;code:2&quot; /> </ rule >
  • 47. Macro XML Sample: pricing a stone <!-- Macro definition --> < defineMacro name = &quot;priceStone&quot; > < rule > < allOf > < getValue key = &quot;$stoneKey&quot; >< equalTo value = &quot;$stoneValue&quot; /></ getValue > < getValue key = &quot;$stoneSizeKey&quot; >< equalTo value = &quot;$stoneSizeValue&quot; /></ getValue > </ allOf > < addPrice label = &quot;$stoneKey: $stoneValue&quot; amount = &quot;$amount&quot; /> </ rule > </ defineMacro > <!-- Macro implementation --> < priceStone stoneKey = &quot;Royal Stone&quot; stoneValue = &quot;Birthstones - Alexandrite (Jun)&quot; stoneSizeKey = &quot;Royal Stone Size&quot; stoneSizeValue = &quot;12 Point&quot; amount = &quot;4208&quot; />
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54. GBA Rules engine architecture Fact (change event) Conditions Actions User Questions Data Model Binding! Binding! Binding!
  • 55.
  • 56. Question XML < question id = &quot;362&quot; controlType = &quot;ComboBox&quot; inlineHelp = &quot;Does anyone receive money from elsewhere?&quot; label = &quot;Other Employment&quot; optionsID = &quot;R00013&quot; target = &quot;Household.Income.OtherIncome&quot; />
  • 57.
  • 58. Rule XML < rule id = &quot;doesAnyoneHasOtherEmployment&quot; > < statement > $hasOtherEmployment </ statement > < actions > < visibleAction questionGroupIDs = &quot;income_other&quot; /> </ actions > </ rule > < rule id = &quot;NoEmployment&quot; > < statement > $IsOnStrike OR ($NoFutureEmployment AND $NoCurrentEmployment AND $NoPastEmployment AND $NoOtherIncome) </ statement > < actions > < visibleAction questionIDs = &quot;364&quot; /> </ actions > </ rule >
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65. Thanks for obeying. Drew McLean twitter: TunnelVisionary [email_address] RJ Owen twitter: rjowen [email_address]