SlideShare una empresa de Scribd logo
1 de 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]

Más contenido relacionado

Destacado

Retoucheren
RetoucherenRetoucheren
RetoucherenDries
 
Industrial relations
Industrial relationsIndustrial relations
Industrial relationsarpita7
 
Flash and Flex in an HTML5 / App Store World
Flash and Flex in an HTML5 / App Store WorldFlash and Flex in an HTML5 / App Store World
Flash and Flex in an HTML5 / App Store WorldEffectiveUI
 
Описание природы. Зима
Описание природы. ЗимаОписание природы. Зима
Описание природы. Зимаtvkam
 
Canoe Trip Glebe Outdoor Ed 2009 Gatineau
Canoe Trip Glebe Outdoor Ed 2009 GatineauCanoe Trip Glebe Outdoor Ed 2009 Gatineau
Canoe Trip Glebe Outdoor Ed 2009 GatineauRachel Collishaw
 
Reputation in Oil Gas and Mining 2014: Reputation, reputation risk and reputa...
Reputation in Oil Gas and Mining 2014: Reputation, reputation risk and reputa...Reputation in Oil Gas and Mining 2014: Reputation, reputation risk and reputa...
Reputation in Oil Gas and Mining 2014: Reputation, reputation risk and reputa...Communicate Magazine
 
Google Plus for businesses and brands: Implementation
Google Plus for businesses and brands: ImplementationGoogle Plus for businesses and brands: Implementation
Google Plus for businesses and brands: ImplementationCommunicate Magazine
 
Impact of budget on individual taxpayers
Impact of budget on individual taxpayersImpact of budget on individual taxpayers
Impact of budget on individual taxpayersTaxmann
 
GST - 24 Things you should know about Draft GST Rules & Forms
GST - 24 Things you should know about Draft GST Rules & FormsGST - 24 Things you should know about Draft GST Rules & Forms
GST - 24 Things you should know about Draft GST Rules & FormsTaxmann
 
Social Media Clicks & Cocktails Seminar - May 2011
Social Media Clicks & Cocktails Seminar -  May 2011 Social Media Clicks & Cocktails Seminar -  May 2011
Social Media Clicks & Cocktails Seminar - May 2011 nic๑click social
 
Semantic MediaWiki and Open Data
Semantic MediaWiki and Open DataSemantic MediaWiki and Open Data
Semantic MediaWiki and Open DataBernhard Krabina
 
Indian Act
Indian Act Indian Act
Indian Act Taxmann
 
India us intergovernmental agreement on fatca
India us intergovernmental agreement on fatcaIndia us intergovernmental agreement on fatca
India us intergovernmental agreement on fatcaTaxmann
 
Training your organisation on SharePoint
Training your organisation on SharePointTraining your organisation on SharePoint
Training your organisation on SharePointMarijn Somers
 
Microteach demo.francisca,oriana
Microteach demo.francisca,orianaMicroteach demo.francisca,oriana
Microteach demo.francisca,orianaOriana Vasquez
 
Effective management criteria
Effective management criteriaEffective management criteria
Effective management criteriaHCL TECHNOLOGIES
 

Destacado (20)

Retoucheren
RetoucherenRetoucheren
Retoucheren
 
Industrial relations
Industrial relationsIndustrial relations
Industrial relations
 
Bosco youth
Bosco youthBosco youth
Bosco youth
 
Rails on HBase
Rails on HBaseRails on HBase
Rails on HBase
 
Flash and Flex in an HTML5 / App Store World
Flash and Flex in an HTML5 / App Store WorldFlash and Flex in an HTML5 / App Store World
Flash and Flex in an HTML5 / App Store World
 
Описание природы. Зима
Описание природы. ЗимаОписание природы. Зима
Описание природы. Зима
 
Canoe Trip Glebe Outdoor Ed 2009 Gatineau
Canoe Trip Glebe Outdoor Ed 2009 GatineauCanoe Trip Glebe Outdoor Ed 2009 Gatineau
Canoe Trip Glebe Outdoor Ed 2009 Gatineau
 
Reputation in Oil Gas and Mining 2014: Reputation, reputation risk and reputa...
Reputation in Oil Gas and Mining 2014: Reputation, reputation risk and reputa...Reputation in Oil Gas and Mining 2014: Reputation, reputation risk and reputa...
Reputation in Oil Gas and Mining 2014: Reputation, reputation risk and reputa...
 
Google Plus for businesses and brands: Implementation
Google Plus for businesses and brands: ImplementationGoogle Plus for businesses and brands: Implementation
Google Plus for businesses and brands: Implementation
 
Impact of budget on individual taxpayers
Impact of budget on individual taxpayersImpact of budget on individual taxpayers
Impact of budget on individual taxpayers
 
GST - 24 Things you should know about Draft GST Rules & Forms
GST - 24 Things you should know about Draft GST Rules & FormsGST - 24 Things you should know about Draft GST Rules & Forms
GST - 24 Things you should know about Draft GST Rules & Forms
 
Social Media Clicks & Cocktails Seminar - May 2011
Social Media Clicks & Cocktails Seminar -  May 2011 Social Media Clicks & Cocktails Seminar -  May 2011
Social Media Clicks & Cocktails Seminar - May 2011
 
Semantic MediaWiki and Open Data
Semantic MediaWiki and Open DataSemantic MediaWiki and Open Data
Semantic MediaWiki and Open Data
 
Indian Act
Indian Act Indian Act
Indian Act
 
India us intergovernmental agreement on fatca
India us intergovernmental agreement on fatcaIndia us intergovernmental agreement on fatca
India us intergovernmental agreement on fatca
 
Training your organisation on SharePoint
Training your organisation on SharePointTraining your organisation on SharePoint
Training your organisation on SharePoint
 
Johnson Matthey IR briefcase
Johnson Matthey IR briefcaseJohnson Matthey IR briefcase
Johnson Matthey IR briefcase
 
Microteach demo.francisca,oriana
Microteach demo.francisca,orianaMicroteach demo.francisca,oriana
Microteach demo.francisca,oriana
 
The home front
The home frontThe home front
The home front
 
Effective management criteria
Effective management criteriaEffective management criteria
Effective management criteria
 

Similar a Flex 360 Rules Engine

Droolsand Rule Based Systems 2008 Srping
Droolsand Rule Based Systems 2008 SrpingDroolsand Rule Based Systems 2008 Srping
Droolsand Rule Based Systems 2008 SrpingSrinath Perera
 
Aug Xml Net Forum Dynamics Integration
Aug Xml Net Forum Dynamics IntegrationAug Xml Net Forum Dynamics Integration
Aug Xml Net Forum Dynamics IntegrationMariAnne Woehrle
 
Practical catalyst
Practical catalystPractical catalyst
Practical catalystdwm042
 
Rules Programming tutorial
Rules Programming tutorialRules Programming tutorial
Rules Programming tutorialSrinath Perera
 
Biz Talk Demo slideshare
Biz Talk Demo slideshareBiz Talk Demo slideshare
Biz Talk Demo slideshareerios
 
Puppeting in a Highly Regulated Industry
Puppeting in a Highly Regulated IndustryPuppeting in a Highly Regulated Industry
Puppeting in a Highly Regulated IndustryPuppet
 
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
 

Similar a Flex 360 Rules Engine (20)

Droolsand Rule Based Systems 2008 Srping
Droolsand Rule Based Systems 2008 SrpingDroolsand Rule Based Systems 2008 Srping
Droolsand Rule Based Systems 2008 Srping
 
Aug Xml Net Forum Dynamics Integration
Aug Xml Net Forum Dynamics IntegrationAug Xml Net Forum Dynamics Integration
Aug Xml Net Forum Dynamics Integration
 
Practical catalyst
Practical catalystPractical catalyst
Practical catalyst
 
Rules Programming tutorial
Rules Programming tutorialRules Programming tutorial
Rules Programming tutorial
 
Biz Talk Demo slideshare
Biz Talk Demo slideshareBiz Talk Demo slideshare
Biz Talk Demo slideshare
 
Puppeting in a Highly Regulated Industry
Puppeting in a Highly Regulated IndustryPuppeting in a Highly Regulated Industry
Puppeting in a Highly Regulated Industry
 
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
 

Más de EffectiveUI

Design essentials For Executives
Design essentials For ExecutivesDesign essentials For Executives
Design essentials For ExecutivesEffectiveUI
 
Designing an App: From Idea to Market
Designing an App: From Idea to MarketDesigning an App: From Idea to Market
Designing an App: From Idea to MarketEffectiveUI
 
Design Essentials for Developers 08.31.11
Design Essentials for Developers 08.31.11Design Essentials for Developers 08.31.11
Design Essentials for Developers 08.31.11EffectiveUI
 
Flex4 Component Lifecycle
Flex4 Component LifecycleFlex4 Component Lifecycle
Flex4 Component LifecycleEffectiveUI
 
The Art of Interaction
The Art of InteractionThe Art of Interaction
The Art of InteractionEffectiveUI
 
Design Essentials for Developers
Design Essentials for DevelopersDesign Essentials for Developers
Design Essentials for DevelopersEffectiveUI
 
Git for the Android Developer
Git for the Android DeveloperGit for the Android Developer
Git for the Android DeveloperEffectiveUI
 
Microsoft Kinect and Molehill
Microsoft Kinect and MolehillMicrosoft Kinect and Molehill
Microsoft Kinect and MolehillEffectiveUI
 
Reasons for Flash: Flash Development in an HTML5 and App Store World
Reasons for Flash: Flash Development in an HTML5 and App Store WorldReasons for Flash: Flash Development in an HTML5 and App Store World
Reasons for Flash: Flash Development in an HTML5 and App Store WorldEffectiveUI
 
Discombobulation, Fire-Breathing Dragons and Wet Noodles: Creating Productive...
Discombobulation, Fire-Breathing Dragons and Wet Noodles: Creating Productive...Discombobulation, Fire-Breathing Dragons and Wet Noodles: Creating Productive...
Discombobulation, Fire-Breathing Dragons and Wet Noodles: Creating Productive...EffectiveUI
 
Design Essentials for Developers
Design Essentials for DevelopersDesign Essentials for Developers
Design Essentials for DevelopersEffectiveUI
 
Your Mom Has an iPad
Your Mom Has an iPadYour Mom Has an iPad
Your Mom Has an iPadEffectiveUI
 
Human-Centered Design and the Intersection of the Physical and Digital Worlds
Human-Centered Design and the Intersection of the Physical and Digital WorldsHuman-Centered Design and the Intersection of the Physical and Digital Worlds
Human-Centered Design and the Intersection of the Physical and Digital WorldsEffectiveUI
 
From the Trenches: Building the Accessible Web
From the Trenches: Building the Accessible WebFrom the Trenches: Building the Accessible Web
From the Trenches: Building the Accessible WebEffectiveUI
 
Flexerific Visual Effects
Flexerific Visual EffectsFlexerific Visual Effects
Flexerific Visual EffectsEffectiveUI
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven DevelopmentEffectiveUI
 
An Opinionated Introduction to Mate
An Opinionated Introduction to MateAn Opinionated Introduction to Mate
An Opinionated Introduction to MateEffectiveUI
 
Diving Deep with the Flex Component Life Cycle
Diving Deep with the Flex Component Life CycleDiving Deep with the Flex Component Life Cycle
Diving Deep with the Flex Component Life CycleEffectiveUI
 
Flex 4 Deep Dive
Flex 4 Deep DiveFlex 4 Deep Dive
Flex 4 Deep DiveEffectiveUI
 
Accessibility in Flex
Accessibility in FlexAccessibility in Flex
Accessibility in FlexEffectiveUI
 

Más de EffectiveUI (20)

Design essentials For Executives
Design essentials For ExecutivesDesign essentials For Executives
Design essentials For Executives
 
Designing an App: From Idea to Market
Designing an App: From Idea to MarketDesigning an App: From Idea to Market
Designing an App: From Idea to Market
 
Design Essentials for Developers 08.31.11
Design Essentials for Developers 08.31.11Design Essentials for Developers 08.31.11
Design Essentials for Developers 08.31.11
 
Flex4 Component Lifecycle
Flex4 Component LifecycleFlex4 Component Lifecycle
Flex4 Component Lifecycle
 
The Art of Interaction
The Art of InteractionThe Art of Interaction
The Art of Interaction
 
Design Essentials for Developers
Design Essentials for DevelopersDesign Essentials for Developers
Design Essentials for Developers
 
Git for the Android Developer
Git for the Android DeveloperGit for the Android Developer
Git for the Android Developer
 
Microsoft Kinect and Molehill
Microsoft Kinect and MolehillMicrosoft Kinect and Molehill
Microsoft Kinect and Molehill
 
Reasons for Flash: Flash Development in an HTML5 and App Store World
Reasons for Flash: Flash Development in an HTML5 and App Store WorldReasons for Flash: Flash Development in an HTML5 and App Store World
Reasons for Flash: Flash Development in an HTML5 and App Store World
 
Discombobulation, Fire-Breathing Dragons and Wet Noodles: Creating Productive...
Discombobulation, Fire-Breathing Dragons and Wet Noodles: Creating Productive...Discombobulation, Fire-Breathing Dragons and Wet Noodles: Creating Productive...
Discombobulation, Fire-Breathing Dragons and Wet Noodles: Creating Productive...
 
Design Essentials for Developers
Design Essentials for DevelopersDesign Essentials for Developers
Design Essentials for Developers
 
Your Mom Has an iPad
Your Mom Has an iPadYour Mom Has an iPad
Your Mom Has an iPad
 
Human-Centered Design and the Intersection of the Physical and Digital Worlds
Human-Centered Design and the Intersection of the Physical and Digital WorldsHuman-Centered Design and the Intersection of the Physical and Digital Worlds
Human-Centered Design and the Intersection of the Physical and Digital Worlds
 
From the Trenches: Building the Accessible Web
From the Trenches: Building the Accessible WebFrom the Trenches: Building the Accessible Web
From the Trenches: Building the Accessible Web
 
Flexerific Visual Effects
Flexerific Visual EffectsFlexerific Visual Effects
Flexerific Visual Effects
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Development
 
An Opinionated Introduction to Mate
An Opinionated Introduction to MateAn Opinionated Introduction to Mate
An Opinionated Introduction to Mate
 
Diving Deep with the Flex Component Life Cycle
Diving Deep with the Flex Component Life CycleDiving Deep with the Flex Component Life Cycle
Diving Deep with the Flex Component Life Cycle
 
Flex 4 Deep Dive
Flex 4 Deep DiveFlex 4 Deep Dive
Flex 4 Deep Dive
 
Accessibility in Flex
Accessibility in FlexAccessibility in Flex
Accessibility in Flex
 

Último

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 

Último (20)

E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 

Flex 360 Rules Engine

  • 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]