1 / 39

Welcome to the Twin Cities BizTalk User Group

Welcome to the Twin Cities BizTalk User Group. July 2006. Implementing a BizTalk Rule Engine Solution. Tips, Tricks & Best Practices. Balaji Thiagarajan ITRGroup, Inc www.itrgroupinc.com. This event is sponsored by ITR Group, Inc. Introduce you to the group. About me.

gilles
Download Presentation

Welcome to the Twin Cities BizTalk User Group

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Welcome to the Twin Cities BizTalk User Group July 2006

  2. Implementing a BizTalk Rule Engine Solution. Tips, Tricks & Best Practices Balaji Thiagarajan ITRGroup, Inc www.itrgroupinc.com

  3. This event is sponsored byITR Group, Inc

  4. Introduce you to the group

  5. About me • Working on BizTalk since the BizTalk 2000 days • MCP in BizTalk since August 2002 • Worked for Microsoft Consulting Services, India. • Currently working as a BizTalk Consultant for ITRGroup, Inc.

  6. Agenda • Overview of BizTalk Rules Engine(BRE) • Features • Building Rules • Architecture • Rules & Orchestration • Q & A

  7. BRE Overview What are Rules? • Rules are • Declarative statements for capturing changing business policies • Represented as: IF <Condition(s)> THEN <Action(s)> • Logically grouped into policies • Rules allow users to • Define & own business policies without coding • Change business policies in real time without rebuilding/redeploying applications

  8. BRE Overview BizTalk Rules in a Nutshell • Lightweight .Net engine • Host-agnostic for in-process scenarios • Integrated with BizTalk Server • Powerful Framework & Tools • Supports Developers, IT Admin and IW • Complete API for design & execution • Rich Modeling Capabilities • Data Sources: .Net Objects, XML, DB • Logical expressions • Enterprise-Ready • Security, Performance, Versioning

  9. BRE Overview Rules Tools - Development • Business Rule Composer • Bind Vocabularies • Build & test policies • Deploy Policies • Visual Studio.NET • OD – Integrate policies & processes • Build supporting code • Fact Retrievers – long term facts • Custom operations

  10. BRE Overview Rules Tools – Admin/Management • Rule Engine Deployment Wizard • Deploy policies • Export/Import policies & vocabularies • HAT • Tracking configuration • Policy execution monitoring

  11. Demo #1 Automated Loan Processing

  12. Agenda • Overview of BizTalk Rules Engine(BRE) • Features • Building Rules • Architecture • Rules & Orchestration • Q & A

  13. Features Design Time • Rich built-in library that includes: • Temporal, relational predicates • Support for ranges and regular expressions • Arithmetic operations • Engine execution control functions • Support for complex logical expressions(AND / OR / NOT) • User-defined predicates/functions/actions • Policy testing

  14. Features Run Time • Application integration via Policy object • Support for long-term (semi-static) & short-term (dynamic) facts • Performance optimizations • Forward Chaining Inference Mechanism • Finds all true statements given knowledge base and a new set of facts • Execution tracking

  15. Agenda • Overview of BizTalk Rules Engine(BRE) • Features • Building Rules • Architecture • Rules & Orchestration • Q & A

  16. Building Rules .Net Objects • Drag and drop public members • Actions • Predicates • Arguments • Assert .Net Instances IF MyClass.A = 5 THEN MyClass.B() MyClass Engine Assert

  17. Building Rules Data Connection • Perform dynamic queries on a DB DataConnection(“DataSetName”,”TableName”, SqlConnection,SqlTransaction)

  18. Building Rules Data Connection - Retrieve IF Table.CustType = “Residential” AND Table.Balance > 1000 THEN …. SELECT * FROM Table WHERE CustType = “Residential” and Balance > 1000 TDR Engine TDR

  19. Building Rules Data Connection - Update IF Table.CustType = “Residential” AND Table.Balance > 1000 THEN Table.Status = “Over Limit” SELECT * FROM Table WHERE CustType = “Residential” and Balance > 1000 Modify Call DC.Update() and commit the SQL Transaction TDR Engine TDR Modify

  20. Building Rules TypedDataTable • Wrapper class on ADO.NET DataTable • Rules built against DB tables, using “Database binding type” field • Asserts individual TypedDataRows Note: If you assert a DataTable – without the TypedDataTable wrapper – it is treated as a standard .NET object

  21. Demo #2 Automated Loan Processing with DB

  22. Building Rules TypedXmlDocument

  23. Building Rules TypedXmlDocument

  24. Building Rules TypedXmlDocument IF orderline.quantity > 5 THEN orderline.discount = 10

  25. Building Rules TypedXmlDocument • Objects are created based on XPath selectors; Xpath Field represents object “property” • Other points • Adding nodes • XPath editing

  26. Policy Rule 1 If A.amount > $0 Then B.total + A.amount Rule 2 If B.total > $50 & < $100 Then B.discount = 10% Rule 3 If B.total >= $100 Then B.discount = 15% A.Amount = $25 B.Total = $80 Rule Engine Agenda B.Total = B.total + A.amount B.Discount = 10% Building RulesForward Chaining

  27. Policy Rule 1 If A.amount > $0 Then B.total + A.amount Rule 2 If B.total > $50 & < $100 Then B.discount = 10% Rule 3 If B.total >= $100 Then B.discount = 15% A.Amount = $25 B.Total = $80 $105 Rule Engine Agenda B.Total = B.total + A.amount B.Discount = 10% B.Discount = 15% B.Discount = 15% Building RulesForward Chaining

  28. Building Rules Engine Control Functions • Assert • Add facts to working memory • Retracts • Remove facts from working memory • RetractByType • Remove all instances of the specified type • Update • Instruct engine to reevaluate relevant facts/conditions

  29. Building Rules Engine Control Functions • CreateObject • Exposed as constructors in Composer • Halt • Stop engine processing • Clear • Clear facts from memory • Clear actions from agenda • Executor • Handle to the rule engine instance

  30. Agenda • Overview of BizTalk Rules Engine(BRE) • Features • Building Rules • Architecture • Rules & Orchestration • Q & A

  31. Architecture Schematic

  32. Architecture Policy Instantiation – Get RE Instance

  33. Architecture Policy Instantiation – Execute Engine

  34. Architecture Policy Instantiation – Get RE Instance

  35. Demo #3 Policy Testing

  36. Agenda • Overview of BizTalk Rules Engine(BRE) • Features • Building Rules • Architecture • Rules & Orchestration • Q & A

  37. Rules and Orchestration Patterns Illustrated

  38. Rules and Orchestration Patterns Illustrated

  39. Q & A

More Related