1 / 37

Rules Processing and BPM An Architectural Perspective

Rules Processing and BPM An Architectural Perspective. Charles Young Principal Consultant. Agenda. Rule processing What are rules, what do they do and how do you use them in business processes? Why use rule engines? The architectural drivers Rule patterns and practices

giolla
Télécharger la présentation

Rules Processing and BPM An Architectural Perspective

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. Rules Processingand BPMAn Architectural Perspective Charles Young Principal Consultant

  2. Agenda • Rule processing • What are rules, what do they do and how do you use them in business processes? • Why use rule engines? The architectural drivers • Rule patterns and practices • Rules-driven process governance • Common inter- and intra-process rule patterns • Rules at the edge • Event-driven scenarios • Interaction with the physical world • What about the user interface?

  3. RULE PROCESSING

  4. What are Rules? • “A law or regulation that governs behaviour, actions, or operations.”AMS Glossary • “A clause that defines the relationship or relationships between facts.”PC AI Glossary • “A data-driven programming construct…consisting of a condition and action. A rule’s action is executed (‘fired’) when its condition is satisfied by objects in memory. Sometimes called a ‘production’ or ‘production rule’.” AT&T R++ User Manual

  5. What Rules Do • Define scope and meaning of terms • Define structure of systems and organisations • Constrain actions and bind activities • Derive information and knowledge from data • Rules are everywhere! • Intrinsic to any organisation or process • Intrinsic to any software system or service

  6. Rule Categories • RuleML categories • Integrity constraints • Assertions, SQL foreign key (RI) constraints, etc. • Derivation rules • Static • Condition  Conclusion • Reaction rules • Temporal • On event, if condition then action • SQL triggers, event handlers, Subscription-based routing • Production rules • If condition then action • Widely supported in rules engines • Transformation rules • If condition then transform A into B • Deontic rules (future support) • Rights, obligations and empowerments

  7. Implementing Rules • No single approach • Rules are everywhere! • Custom code • Message routing and subscription • Workflows and processes • Database systems • Rules engines • XSLT • etc.

  8. Rules Engines • Executable rules • Rule sets • Policies: govern decision making and interaction • Production rules • Map to other rule categories • Sequential engines • Less expressive, powerful and scalable • Procedural: familiar, easier to debug • Excellent for simple decision logic • Microsoft: WF rules • Set-based pattern matching engines • Production systems • More expressive, powerful and scalable (esp. large rule sets) • Good support for highly combinatorial matching • Declarative: unfamiliar, harder to debug • Inferencing and reasoning • Microsoft: MS BRE

  9. IF State == POReceived THEN PO=GetPurchaseOrder() State == ValidatingCustomer IF AND State == ValidatingCustomer IsApprovedCustomer(PO.CustomerID) NOT OR AccountSuspended(PO.CustomerID) OutstandingArrears(PO.CustomerID, 8000) THEN PO.Accepted = true State = ProcessingPO IF AND State == ProcessingPO PO.Accepted == true PO.Total >= 100000 THEN SendApprovalRequest(PO.RefId) State = ApprovingPO IF AND State == ProcessingPO OR PO.Accepted == false PO.Total < 100000 THEN State = CompletingPOProc IF AND State == ApprovingPO AP.Approved== true THEN State = CompletingPOProc IF AND State == ApprovingPO AP.Approved== false THEN PO.Accepted = false State = CompletingPOProc IF AND State == CompletingPOProc PO.Accepted == true THEN EnterPODetails(PO) State = POProcCompleted IF AND State == CompletingPOProc PO.Accepted == false THEN SendDeclineEmail(PO) State = POProcCompleted

  10. Why use Rules Engines? • Better separation of concerns • Separate process definition from governance • Improved traceability • Align process logic to business goals • Validate completeness and correctness • Externalisation of rules • Direct definition and maintenance by business users • Orthogonal versioning of rules and processes • Inferencing • Sophisticated and efficient framework for reasoning over facts

  11. MS Business Rules Framework Application, Orchestration, etc. “Short Term” Facts Assert Facts, Execute Rules Policy Tester Rule Policy Objects (executable rule sets) Assert Facts, Execute Rules Get Rule Set Get Facts Rule Engine Object Tracking Interceptor Rule Set Translator Rule Set Update Service Fact Retriever (Fact Remover) Executor Pub/Sub Adapter Specified In Rule Set Cache Pub/Sub Agent Get Rule Set Fact Creator Rule Store Object Event Service Pub/Sub Service Policy Composer Rule Language Converter “Long Term” Facts Rule Sets & Vocabularies Fact Stores Application Data Deployment Tool Rule Set Deployment Driver Versioning

  12. RULE PATTERNS & PRACTICES

  13. Mapping Business Rules to Executable Rules • Business rules • Business abstractions • Not driven by technology • Highly declarative • No run-time context • Map at two levels • Business rule  Executable rule • Business rule  Policy (rule-sets) • Policy ‘chaining’

  14. Process Definition • A process may… • Decompose to several sub-processes • Multiple orchestrations or workflows • Include both automated and manual processing • Span multiple platforms and services • Enterprise BPM servers (e.g. BizTalk Server) • Human Workflow tools • Web services and browser / desktop applications • Line of Business and back office applications • Cross multiple organisational boundaries

  15. Process Governance • Governance involves… • Enforcing organisational policies within processes • Managing the alignment of processes to corporate requirements and strategies • Ensuring traceability, accountability and openness within processes • Ensuring optimal reuse of services across process and organisational boundaries • Policy-driven • Externalised • Managed

  16. Technology Alignment

  17. Intra-Process Rule Patterns • Used within a single executable process • e.g. within a single orchestration • Basic rule-based patterns for BPM • Rule-based derivations • Rule-based assertions • Rule-driven process flow

  18. Rule-Based Derivations • Intent • Derive and infer new facts from existing facts • Applicability • Data and message generation • Data and message transformation • Uses • Decision support • Rating • Analysis • Prediction • Scheduling and process optimisation

  19. Rule-Based Assertions • Intent • Enforce validity and integrity constraints within a process • Applicability • Data and message validation • Uses • Validation • Policy enforcement • Enforcement of obligations and permissions (deontic rules) • Alerting and notification

  20. Rule-Driven Process Flow • Intent • Control sequence of state transitions and process activities • Applicability • Process decision points • Conditional process logic • Processes with branches and loops • Uses • Policy-driven processes • Process automation • Human interactions and workflow

  21. Intra-Process Patterns: Relationships Rules Engine Estimate anticipated profit margin for new product based on monthly sales of similar products, market conditions, etc. Rule-Based Derivations Rules Engine Rule-Based Assertions Estimated profit margin for new product is > 10% Orchestration If estimated profit margin is not > 10%, notify product manager Rule-Driven Process Flow

  22. An Intra-Process Anti-Pattern • Flow-based derivation • Controlling cyclic derivation logic through process flow • Using process flow inappropriately to implement activity logic • Symptoms • Excessively nested loop structures • Iterating data collections • Constructing new data collections • ‘Meta-loops’ to repeat work when date collections change • (Forward chaining) • Consequences • Inefficient, resource-intensive code • Hard to verify, stabilise and maintain • Resolution • Replace with set-based pattern matching approach using a Rules Engine • Use declarative rules rather than complex procedural code

  23. Inter-Process Rule Patterns • Used across multiple executable process definitions • e.g. within across multiple orchestrations • Advanced rule-driven patterns for BPM • Rule-driven process routing • Policy-driven process versioning • Policy-driven process composition

  24. Rule-Driven Process Routing • Intent • Implement dynamic patterns of process invocation • Applicability • Message exchange between different processes • Uses • Subscription-based routing • Dynamic policy-driven routing • Foundational for advanced patterns • Fine-grained orthogonal versioning of individual processes • Dynamic composition of discrete processes and services

  25. Example: BizTalk Server Enhanced Subscription Orchestration A Set context properties and promote using correlation set Context Port Message Message Box Rules Engine Message Agent Orchestration B Policy Port Event-Condition-Action Dynamic Routing Subscription Rules Filter Subscribe on promoted message properties

  26. Policy-Driven Process Versioning • Intent • Fine-grained versioning control of individual processes • Applicability • Discrete sub processes that can be re-used across multiple business processes • Processes that must constantly adapt to rapidly changing business environments • Uses • Anywhere there is a need to regularly re-deploy versioned processes with maximum agility and minimum impact

  27. Invocation and Worker Processes

  28. Policy-Driven Process Composition • Intent • Dynamic composition of discrete services and processes • Applicability • Discrete sub processes that can be re-used across multiple business processes • Processes that must constantly adapt to rapidly changing business environments • Uses • Anywhere there is a need to regularly change the composition of overall processes with maximum agility and minimum impact

  29. Process Controllers and Steps

  30. RULES AT THE EDGE

  31. Rules in Edge Processing • Edge processes • Contextualised • Customer / service-focused • ‘Real world’ interactions • Event-driven • Non-deterministic • Transformational • Map between events / interactions and managed process definitions • Filtering and cleansing

  32. Event-Condition-Action Rules

  33. Example: RFID Services

  34. Rules in the Presentation Tier • “The system architecture … is the user agent”Fred Brooks - The Mythical Man-Month • Rule-driven interfaces • Validation and derivation • Composition and navigation • Analysis, inference and prediction • Guidance and learning • Shared rule-base with central processes

  35. SUMMARY

  36. Call to Action • Investigate rule technologies • Many vendors, many approaches • Built-in vs. external tool sets • Distinguish between process definition and process governance • Apply rule patterns and practices to process design • Assess, measure and improve!

More Related