SlideShare uma empresa Scribd logo
1 de 37
Baixar para ler offline
Doing Enterprise Business with
      Processes & Rules
       Srinath Perera, Ph.D.
      Senior Software Architect
             WSO2 Inc.
Next 45 Minutes
●   Leave you with the Big picture
       – Why Rules and Business Processes?
       – For both: What? How does it work?
          What can I do with it? When to and not
          to use it?
       – Rules and Business Processes in real
          world
What is the Secret of
 Success for Organiza-
        tions?
 How to survive fierce competi-
             tion?
War and Business are two primary com-
     petitions we know in history!
     Many parallels between war and Business
      Art of War is thought in Business school
Value of Knowledge

  If you know your
 enemies and know
 yourself, you will
 not be imperiled in
 a hundred battles
  -- Sun Tzu
Business at the Speed of Thought
●   In Internet scale, we can not
    do business manually!
●   We delegate to Computer
●   Computer is accurate, fast,
    (unfortunately or rather fortu-
    nately) can not think
●   It is crucial to
        – embed your knowledge
           into computer sys-
           tems
        – know what to decide
           yourself.
But Nothing is Forever

        Everything that has
     been created is subject
       to decay and death.
     Everything is transitory.



 ●   Any advantage that you hold will disappear over time
 ●   You competition will
         –   Buy, Steal, Invent, Figure it out,
              Evolve, or Copy
Natural selection


  In the struggle for sur-
  vival, the fittest win out
  at the expense of their
 rivals because they suc-
  ceed in adapting them-
  selves best to their en-
         vironment.
 --Charles Darwin
OODA Loop (Boyd Cycle)
●   Loop is Observe, Orient,
    Decide, and Act
●   But sooner or later
    everyone will follow OODA
    Loop
●   Boyd said one win by
    getting inside others
    OODA loop
●   Which means you have to
    change fast.
Adaptation
 An organization's abil-
 ity to learn, and trans-
 late that learning into
 action rapidly, is the
 ultimate competitive
 advantage.
       --Jack Welch
Agile Organizations
 ●   Even organizations are susceptible to theory
     of Evolution
 ●   Organizations have to change fast.
 ●   In the digital age this means agile organiza-
     tions which can adept (who can best adept
     their systems) has the best chance.
Point Is
 ●   Knowledge (how we should act) is the greatest
     assert of an organization
 ●   Agile organizations who can understand and
     best adopt themselves (knowledge) has best
     chance of survival
 ●   In the digital age

  To change fast, you have to be able to
  to quickly change knowledge embed-
        ded within your systems!
Business Logic
●   In a Organization, we call this
    Knowledge Business Logic
●   It is how you do things, your under-
    standing, process, formula, al-
    gorithm, recipe, methodology,
    query (minus implementation de-
    tails)
●   It the decisions we take
         –Should  we give him a evalu-
           ation account ?
         –Should we make a partner-
           ship with X?
         –Should we give him Free
           Shipping?
         –What   is the best Prize?
Business Logic Separation
●   Business logic changes much faster than rest
    of the system
●   If your code and logic are mesh together, it is a
    nightmare to change them.



  We need to sep-
arate the Business
 logic from code
Typical Architecture
 ●   Mash all together architecture
 ●   3 tire architecture
 ●   Even with 3 tier architecture still logic is buried in the code
     within services
 ●   Good luck in locating and changing them.
What do we need?
 ●   Separated Business logic
 ●   Store and manage (edit, share, delete) them in a one
     place and through one User Interface.
 ●   If possible in easy to understandable form
 ●   Edit them Visually when possible.

 Let's discuss two ways
to implement this separ-
          ation:
    Rules and Business
        Process
Business Rules
What are Rules?
You must always
drive from the left
(or was it right?)




                      You should not Eat
                       Chocolates (Then
                      pass me a ice cream
                           please!)
What are Rules? (Contd.)
●   It is a knowledge representation. (usually partial
    knowledge)
●   Four types
        1)Derivation or Deduction Rules – Each rule
           express if some statements are true, another
           statement must be true. Called logical
           implication. E.g. Prolog
        2)Transformation Rules- transform between
           knowledge bases, e.g. theorem proving
        3)Integrity Constraints – verification rules
        4)Reaction or Event-Condition-Action (ECA) Rules
           – includes an actions in addition to inference.
           e.g. Drools
How do Rules work?
    ●   Data represented as Facts
    ●   Knowledge represented as Rules
    ●   A Rule engine evaluates Facts against Rules, and optionally
        carry out specified actions. (e.g Drools, JESS)


    Two types of Rules Engines:
●   Forward Chaining – starts with
    facts/data and trigger actions or
    output conclusions (Drools)
●   Backward chaining – starts with
    goals and search how to satisfy
    them (e.g. Prolog)
Why Rules?
●   Externalize the business logic (which are too dy-
    namic) from comparatively static code base
●   Simplify complicated requirements with declarative
    logic, raising the level of abstraction of the system
●   Intuitive and readable than code, easily under-
    stood by business people/ non technical users
●   Create complex interactions which can have
    powerful results, even from simple facts and rules.
●   Different approach to the problem, some problems
    are much easier using rules.
●   Fast and scalable when there is a data set that
    changes little by little
When to use Rules?
●   To separate code and business lo-
    gic
●   When the logic changes often
●   When Domain experts are none
    technical.
●   When all else failed! (When there is
    no satisfactory traditional program-
    ming approach to solve the prob-
    lem! Rules are good in solving prob-
    lems that are not fully understood).
When NOT to use Rules?
 ●   It is slower than usual code most of the time, so unless there
     are obvious benefits
 ●   Complexity of logic is hard to tackle, and one mistake could
     change the results drastically and in unexpected ways (e.g.
     recursive rules)
 ●   More effort for testing and debugging is required, so if results
     are hard to be verified, it should not be used.
Rules in SOA




●   As a Service (e.g. BRS), As a Mediator (E.g. WSO2 ESB)
●    Stored in a registry and referred, so they can be edited and
    found in one place, versioned, reverted back, tested separ-
    ately
Rules in Action?
 ●   Decision tables – in a bidding system, map the bidding rules
     to a Decision table implemented with a Excel file. Business
     analysts can change the Excel file and change Business logic
     of the system.
 ●   A Domain Specific Language that interfaces with rules are
     used to describe when free shipping offers should be given to
     the user. Business analysts change the DSL scripts stored in
     the registry, and Business logic of the system changes.
 ●   Rules are used to route documents between several de-
     partments to increase the processing efficiency. When a new
     pattern is observed, it can be easily added.
 ●   Rules are used to detect error conditions in a complex de-
     ployment and it is easy to add new error conditions by adding
     new rules.
Business Processes
What is Processes?



                      Baking A Cake?




Production Line

                  Conduct a Orchestra
What are Processes?
 ●   Process captures a set of activities designed to
     achieve a specific goal.
 ●   It is a formula, or algorithm, recipe etc.
 ●   Unlike rules, activities in a process are very well con-
     nected with each other (a clear flow).
 ●   Examples
         –   Adding a new employee: Sign the contract, create an
               account, assign to a team, give permissions, assign
               a seat, order hadrware etc.
         –   Release a Product: Design, develop, test, market, ..
Sample Business Processes
 ●   Nodes (services) are connected via dataflows (dependencies)
     or control flows (If, then, while).
How do Business Processes Work?
    ●   Business process is described using a Workflow language
        (e.g. BPEL, BPMN, Python, Java Script)
    ●   Just like a java script runtime executes java scripts, a workflow
        engine executes the workflow description.
             –   e.g. Apache ODE, WSO2 BPS, MS Workflow Founda-
                   tion, Dryad by MSR etc.

●   It is a programming language:
●   Support messaging, asyn-
    chronous invocations etc. as
    first class
    Real difference lies in the
                                            Curiosity is good,
●


    level of abstraction.
                                           unless you are a cat
Why Processes?
●   Abstract out the business logic
●   A different level of abstraction to
    manage the logic

    ●   Special features
             –   Can be visualized, analyzed, and verified
             –   Execution can be monitored
             –   Execution can be hibernated and resumed
             –   Failed workflows can be recovered
             –   Can visually composed
             –   Workfows can be manipulated at runtime
When to use Processes?
●   To abstract out the Business Logic
●   When there are many reusable com-
    ponents (services) that can be com-
    posed together (Mathlab like environ-
    ments)
●   Easy way to evolve the logic (edit)
●   For long running processes where
    monitoring, recovery, hibernation are
    expected.
●   When we want to track how business
    process evolution took place (through
    provenance)
When NOT to use Processes?
  ●   Workflows are often slower than normal code
  ●   Add dependency to new tools (workflow engine), complex to
      setup and harder to debug.
  ●   When logic is too complex (consider implementing complex
      parts as services)
  ●   Do not use unless there are clear benefits
Business Process Execution
 Language (BPEL)
 ●   A programming abstraction that allows developers
     to compose multiple synchronous and asynchronous
     Web services into an end-to-end business flow
 ●   Constructs:
         –   Messaging: invoke, receive, reply, assign,
         –   Structured: sequence, flow, if, while, repeatUntil
         –   Exception handling: fault Handlers (throw catch)
         –   Event processing: onMessage, onAlarm
 ●   Human Task extensions: Let workflows interact with
     humans
 ●   BPMN (Business Process Modeling Notation)
         –   a visual notation for workflows.
Processes in Action
 ●   A Service composition Environment: Expose
     a set of tools as services and use workflows to create
     an environment where users can compose (mash)
     them to create interesting processes.
         –   E.g. Science toolkit
 ●   Governance workflows: Workflows to capture
     processes associated with services in a registry dev-
     >test->production environment
 ●   Modeling Internal process of an organiza-
     tion as Workflows
 ●   Long running business processes: (ability to
     hibernate, recover, and monitor executions)
         –   e.g. Long running scientific worklflows.
Rules vs. Processes
                     Processes are
                    for well under-
        ●
                   stood problems
        ●         where sequence
                  of actions get us
                     into expected
                  state. (e.g. Cook-
                          ing)

   Rules are for partially under-
  stood (AI like heuristic driven)
      problems. e.g. Chess
Conclusion
 ●   Knowledge (Business Logic) is the greatest
     assert to a organizations
 ●   Organizations that can adept themselves to
     change have the best chance of survival
 ●   Separating the Business logic from the code
     enables Business logic to evolve and man-
     aged separately
 ●   Business Rules and Business processes are
     two ways to extract out business logic.
 ●   We discussed them and their applications with-
     in Enterprise Architecture.
Questions?

Mais conteúdo relacionado

Semelhante a Rules and Processes for Dynamic Business Logic

August: DevOps 101 (in lieu of DevOps Patterns Distilled)
August: DevOps 101 (in lieu of DevOps Patterns Distilled)August: DevOps 101 (in lieu of DevOps Patterns Distilled)
August: DevOps 101 (in lieu of DevOps Patterns Distilled)TriTAUG
 
Measuring the Productivity of Your Engineering Organisation - the Good, the B...
Measuring the Productivity of Your Engineering Organisation - the Good, the B...Measuring the Productivity of Your Engineering Organisation - the Good, the B...
Measuring the Productivity of Your Engineering Organisation - the Good, the B...Marin Dimitrov
 
Deploying a data centric approach to enterprise agility
Deploying a data centric approach to enterprise agilityDeploying a data centric approach to enterprise agility
Deploying a data centric approach to enterprise agilityComparative Agility
 
When to Code / Config / Config + Code in Salesforce - Nikunj Doshi
When to Code / Config / Config + Code in Salesforce - Nikunj DoshiWhen to Code / Config / Config + Code in Salesforce - Nikunj Doshi
When to Code / Config / Config + Code in Salesforce - Nikunj DoshiSakthivel Madesh
 
Indix Engineering Culture Code (2015)
Indix Engineering Culture Code (2015)Indix Engineering Culture Code (2015)
Indix Engineering Culture Code (2015)Rajesh Muppalla
 
JBoss Drools - Open-Source Business Logic Platform
JBoss Drools - Open-Source Business Logic PlatformJBoss Drools - Open-Source Business Logic Platform
JBoss Drools - Open-Source Business Logic Platformelliando dias
 
DevOps, Performance Optimization and the Green Life with Magento
DevOps, Performance Optimization and the Green Life with MagentoDevOps, Performance Optimization and the Green Life with Magento
DevOps, Performance Optimization and the Green Life with MagentoLuis Tineo
 
Managing software projects & teams effectively
Managing software projects & teams effectivelyManaging software projects & teams effectively
Managing software projects & teams effectivelyAshutosh Agarwal
 
Agile Network India | Guesstimating the timeline for backlog items
Agile Network India | Guesstimating the timeline for backlog itemsAgile Network India | Guesstimating the timeline for backlog items
Agile Network India | Guesstimating the timeline for backlog itemsAgileNetwork
 
Agile Network India | Guesstimating the timeline for backlog items | Amit Med...
Agile Network India | Guesstimating the timeline for backlog items | Amit Med...Agile Network India | Guesstimating the timeline for backlog items | Amit Med...
Agile Network India | Guesstimating the timeline for backlog items | Amit Med...AgileNetwork
 
Why Agile? Back to Basics.
Why Agile? Back to Basics.Why Agile? Back to Basics.
Why Agile? Back to Basics.Lucas Hendrich
 
Software evolution -- Good practices
Software evolution -- Good practicesSoftware evolution -- Good practices
Software evolution -- Good practicesNicolas Anquetil
 
Enterprise Frameworks: Java & .NET
Enterprise Frameworks: Java & .NETEnterprise Frameworks: Java & .NET
Enterprise Frameworks: Java & .NETAnant Corporation
 
End to end MLworkflows
End to end MLworkflowsEnd to end MLworkflows
End to end MLworkflowsAdam Gibson
 
Geek Sync I Agile Data Management vs. Agile Data Modeling
Geek Sync I Agile Data Management vs. Agile Data ModelingGeek Sync I Agile Data Management vs. Agile Data Modeling
Geek Sync I Agile Data Management vs. Agile Data ModelingIDERA Software
 
OutSystems Tips and Tricks
OutSystems Tips and TricksOutSystems Tips and Tricks
OutSystems Tips and TricksOutSystems
 
Devops, the future is here it's not evenly distributed yet
Devops, the future is here it's not evenly distributed yetDevops, the future is here it's not evenly distributed yet
Devops, the future is here it's not evenly distributed yetKris Buytaert
 
Prometheus Overview
Prometheus OverviewPrometheus Overview
Prometheus OverviewBrian Brazil
 

Semelhante a Rules and Processes for Dynamic Business Logic (20)

August: DevOps 101 (in lieu of DevOps Patterns Distilled)
August: DevOps 101 (in lieu of DevOps Patterns Distilled)August: DevOps 101 (in lieu of DevOps Patterns Distilled)
August: DevOps 101 (in lieu of DevOps Patterns Distilled)
 
Measuring the Productivity of Your Engineering Organisation - the Good, the B...
Measuring the Productivity of Your Engineering Organisation - the Good, the B...Measuring the Productivity of Your Engineering Organisation - the Good, the B...
Measuring the Productivity of Your Engineering Organisation - the Good, the B...
 
Deploying a data centric approach to enterprise agility
Deploying a data centric approach to enterprise agilityDeploying a data centric approach to enterprise agility
Deploying a data centric approach to enterprise agility
 
When to Code / Config / Config + Code in Salesforce - Nikunj Doshi
When to Code / Config / Config + Code in Salesforce - Nikunj DoshiWhen to Code / Config / Config + Code in Salesforce - Nikunj Doshi
When to Code / Config / Config + Code in Salesforce - Nikunj Doshi
 
Indix Engineering Culture Code (2015)
Indix Engineering Culture Code (2015)Indix Engineering Culture Code (2015)
Indix Engineering Culture Code (2015)
 
L10 Architecture Considerations
L10 Architecture ConsiderationsL10 Architecture Considerations
L10 Architecture Considerations
 
JBoss Drools - Open-Source Business Logic Platform
JBoss Drools - Open-Source Business Logic PlatformJBoss Drools - Open-Source Business Logic Platform
JBoss Drools - Open-Source Business Logic Platform
 
DevOps, Performance Optimization and the Green Life with Magento
DevOps, Performance Optimization and the Green Life with MagentoDevOps, Performance Optimization and the Green Life with Magento
DevOps, Performance Optimization and the Green Life with Magento
 
Managing software projects & teams effectively
Managing software projects & teams effectivelyManaging software projects & teams effectively
Managing software projects & teams effectively
 
Introduction to Software Engineering
Introduction to Software EngineeringIntroduction to Software Engineering
Introduction to Software Engineering
 
Agile Network India | Guesstimating the timeline for backlog items
Agile Network India | Guesstimating the timeline for backlog itemsAgile Network India | Guesstimating the timeline for backlog items
Agile Network India | Guesstimating the timeline for backlog items
 
Agile Network India | Guesstimating the timeline for backlog items | Amit Med...
Agile Network India | Guesstimating the timeline for backlog items | Amit Med...Agile Network India | Guesstimating the timeline for backlog items | Amit Med...
Agile Network India | Guesstimating the timeline for backlog items | Amit Med...
 
Why Agile? Back to Basics.
Why Agile? Back to Basics.Why Agile? Back to Basics.
Why Agile? Back to Basics.
 
Software evolution -- Good practices
Software evolution -- Good practicesSoftware evolution -- Good practices
Software evolution -- Good practices
 
Enterprise Frameworks: Java & .NET
Enterprise Frameworks: Java & .NETEnterprise Frameworks: Java & .NET
Enterprise Frameworks: Java & .NET
 
End to end MLworkflows
End to end MLworkflowsEnd to end MLworkflows
End to end MLworkflows
 
Geek Sync I Agile Data Management vs. Agile Data Modeling
Geek Sync I Agile Data Management vs. Agile Data ModelingGeek Sync I Agile Data Management vs. Agile Data Modeling
Geek Sync I Agile Data Management vs. Agile Data Modeling
 
OutSystems Tips and Tricks
OutSystems Tips and TricksOutSystems Tips and Tricks
OutSystems Tips and Tricks
 
Devops, the future is here it's not evenly distributed yet
Devops, the future is here it's not evenly distributed yetDevops, the future is here it's not evenly distributed yet
Devops, the future is here it's not evenly distributed yet
 
Prometheus Overview
Prometheus OverviewPrometheus Overview
Prometheus Overview
 

Mais de Srinath Perera

Book: Software Architecture and Decision-Making
Book: Software Architecture and Decision-MakingBook: Software Architecture and Decision-Making
Book: Software Architecture and Decision-MakingSrinath Perera
 
Data science Applications in the Enterprise
Data science Applications in the EnterpriseData science Applications in the Enterprise
Data science Applications in the EnterpriseSrinath Perera
 
An Introduction to APIs
An Introduction to APIs An Introduction to APIs
An Introduction to APIs Srinath Perera
 
An Introduction to Blockchain for Finance Professionals
An Introduction to Blockchain for Finance ProfessionalsAn Introduction to Blockchain for Finance Professionals
An Introduction to Blockchain for Finance ProfessionalsSrinath Perera
 
AI in the Real World: Challenges, and Risks and how to handle them?
AI in the Real World: Challenges, and Risks and how to handle them?AI in the Real World: Challenges, and Risks and how to handle them?
AI in the Real World: Challenges, and Risks and how to handle them?Srinath Perera
 
Healthcare + AI: Use cases & Challenges
Healthcare + AI: Use cases & ChallengesHealthcare + AI: Use cases & Challenges
Healthcare + AI: Use cases & ChallengesSrinath Perera
 
How would AI shape Future Integrations?
How would AI shape Future Integrations?How would AI shape Future Integrations?
How would AI shape Future Integrations?Srinath Perera
 
The Role of Blockchain in Future Integrations
The Role of Blockchain in Future IntegrationsThe Role of Blockchain in Future Integrations
The Role of Blockchain in Future IntegrationsSrinath Perera
 
Blockchain: Where are we? Where are we going?
Blockchain: Where are we? Where are we going? Blockchain: Where are we? Where are we going?
Blockchain: Where are we? Where are we going? Srinath Perera
 
Few thoughts about Future of Blockchain
Few thoughts about Future of BlockchainFew thoughts about Future of Blockchain
Few thoughts about Future of BlockchainSrinath Perera
 
A Visual Canvas for Judging New Technologies
A Visual Canvas for Judging New TechnologiesA Visual Canvas for Judging New Technologies
A Visual Canvas for Judging New TechnologiesSrinath Perera
 
Privacy in Bigdata Era
Privacy in Bigdata  EraPrivacy in Bigdata  Era
Privacy in Bigdata EraSrinath Perera
 
Blockchain, Impact, Challenges, and Risks
Blockchain, Impact, Challenges, and RisksBlockchain, Impact, Challenges, and Risks
Blockchain, Impact, Challenges, and RisksSrinath Perera
 
Today's Technology and Emerging Technology Landscape
Today's Technology and Emerging Technology LandscapeToday's Technology and Emerging Technology Landscape
Today's Technology and Emerging Technology LandscapeSrinath Perera
 
An Emerging Technologies Timeline
An Emerging Technologies TimelineAn Emerging Technologies Timeline
An Emerging Technologies TimelineSrinath Perera
 
The Rise of Streaming SQL and Evolution of Streaming Applications
The Rise of Streaming SQL and Evolution of Streaming ApplicationsThe Rise of Streaming SQL and Evolution of Streaming Applications
The Rise of Streaming SQL and Evolution of Streaming ApplicationsSrinath Perera
 
Analytics and AI: The Good, the Bad and the Ugly
Analytics and AI: The Good, the Bad and the UglyAnalytics and AI: The Good, the Bad and the Ugly
Analytics and AI: The Good, the Bad and the UglySrinath Perera
 
Transforming a Business Through Analytics
Transforming a Business Through AnalyticsTransforming a Business Through Analytics
Transforming a Business Through AnalyticsSrinath Perera
 
SoC Keynote:The State of the Art in Integration Technology
SoC Keynote:The State of the Art in Integration TechnologySoC Keynote:The State of the Art in Integration Technology
SoC Keynote:The State of the Art in Integration TechnologySrinath Perera
 

Mais de Srinath Perera (20)

Book: Software Architecture and Decision-Making
Book: Software Architecture and Decision-MakingBook: Software Architecture and Decision-Making
Book: Software Architecture and Decision-Making
 
Data science Applications in the Enterprise
Data science Applications in the EnterpriseData science Applications in the Enterprise
Data science Applications in the Enterprise
 
An Introduction to APIs
An Introduction to APIs An Introduction to APIs
An Introduction to APIs
 
An Introduction to Blockchain for Finance Professionals
An Introduction to Blockchain for Finance ProfessionalsAn Introduction to Blockchain for Finance Professionals
An Introduction to Blockchain for Finance Professionals
 
AI in the Real World: Challenges, and Risks and how to handle them?
AI in the Real World: Challenges, and Risks and how to handle them?AI in the Real World: Challenges, and Risks and how to handle them?
AI in the Real World: Challenges, and Risks and how to handle them?
 
Healthcare + AI: Use cases & Challenges
Healthcare + AI: Use cases & ChallengesHealthcare + AI: Use cases & Challenges
Healthcare + AI: Use cases & Challenges
 
How would AI shape Future Integrations?
How would AI shape Future Integrations?How would AI shape Future Integrations?
How would AI shape Future Integrations?
 
The Role of Blockchain in Future Integrations
The Role of Blockchain in Future IntegrationsThe Role of Blockchain in Future Integrations
The Role of Blockchain in Future Integrations
 
Future of Serverless
Future of ServerlessFuture of Serverless
Future of Serverless
 
Blockchain: Where are we? Where are we going?
Blockchain: Where are we? Where are we going? Blockchain: Where are we? Where are we going?
Blockchain: Where are we? Where are we going?
 
Few thoughts about Future of Blockchain
Few thoughts about Future of BlockchainFew thoughts about Future of Blockchain
Few thoughts about Future of Blockchain
 
A Visual Canvas for Judging New Technologies
A Visual Canvas for Judging New TechnologiesA Visual Canvas for Judging New Technologies
A Visual Canvas for Judging New Technologies
 
Privacy in Bigdata Era
Privacy in Bigdata  EraPrivacy in Bigdata  Era
Privacy in Bigdata Era
 
Blockchain, Impact, Challenges, and Risks
Blockchain, Impact, Challenges, and RisksBlockchain, Impact, Challenges, and Risks
Blockchain, Impact, Challenges, and Risks
 
Today's Technology and Emerging Technology Landscape
Today's Technology and Emerging Technology LandscapeToday's Technology and Emerging Technology Landscape
Today's Technology and Emerging Technology Landscape
 
An Emerging Technologies Timeline
An Emerging Technologies TimelineAn Emerging Technologies Timeline
An Emerging Technologies Timeline
 
The Rise of Streaming SQL and Evolution of Streaming Applications
The Rise of Streaming SQL and Evolution of Streaming ApplicationsThe Rise of Streaming SQL and Evolution of Streaming Applications
The Rise of Streaming SQL and Evolution of Streaming Applications
 
Analytics and AI: The Good, the Bad and the Ugly
Analytics and AI: The Good, the Bad and the UglyAnalytics and AI: The Good, the Bad and the Ugly
Analytics and AI: The Good, the Bad and the Ugly
 
Transforming a Business Through Analytics
Transforming a Business Through AnalyticsTransforming a Business Through Analytics
Transforming a Business Through Analytics
 
SoC Keynote:The State of the Art in Integration Technology
SoC Keynote:The State of the Art in Integration TechnologySoC Keynote:The State of the Art in Integration Technology
SoC Keynote:The State of the Art in Integration Technology
 

Último

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
"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
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
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
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
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
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
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
 

Último (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
"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
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 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
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
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
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
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
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
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
 

Rules and Processes for Dynamic Business Logic

  • 1. Doing Enterprise Business with Processes & Rules Srinath Perera, Ph.D. Senior Software Architect WSO2 Inc.
  • 2. Next 45 Minutes ● Leave you with the Big picture – Why Rules and Business Processes? – For both: What? How does it work? What can I do with it? When to and not to use it? – Rules and Business Processes in real world
  • 3. What is the Secret of Success for Organiza- tions? How to survive fierce competi- tion? War and Business are two primary com- petitions we know in history! Many parallels between war and Business Art of War is thought in Business school
  • 4. Value of Knowledge If you know your enemies and know yourself, you will not be imperiled in a hundred battles -- Sun Tzu
  • 5. Business at the Speed of Thought ● In Internet scale, we can not do business manually! ● We delegate to Computer ● Computer is accurate, fast, (unfortunately or rather fortu- nately) can not think ● It is crucial to – embed your knowledge into computer sys- tems – know what to decide yourself.
  • 6. But Nothing is Forever Everything that has been created is subject to decay and death. Everything is transitory. ● Any advantage that you hold will disappear over time ● You competition will – Buy, Steal, Invent, Figure it out, Evolve, or Copy
  • 7. Natural selection In the struggle for sur- vival, the fittest win out at the expense of their rivals because they suc- ceed in adapting them- selves best to their en- vironment. --Charles Darwin
  • 8. OODA Loop (Boyd Cycle) ● Loop is Observe, Orient, Decide, and Act ● But sooner or later everyone will follow OODA Loop ● Boyd said one win by getting inside others OODA loop ● Which means you have to change fast.
  • 9. Adaptation An organization's abil- ity to learn, and trans- late that learning into action rapidly, is the ultimate competitive advantage. --Jack Welch
  • 10. Agile Organizations ● Even organizations are susceptible to theory of Evolution ● Organizations have to change fast. ● In the digital age this means agile organiza- tions which can adept (who can best adept their systems) has the best chance.
  • 11. Point Is ● Knowledge (how we should act) is the greatest assert of an organization ● Agile organizations who can understand and best adopt themselves (knowledge) has best chance of survival ● In the digital age To change fast, you have to be able to to quickly change knowledge embed- ded within your systems!
  • 12. Business Logic ● In a Organization, we call this Knowledge Business Logic ● It is how you do things, your under- standing, process, formula, al- gorithm, recipe, methodology, query (minus implementation de- tails) ● It the decisions we take –Should we give him a evalu- ation account ? –Should we make a partner- ship with X? –Should we give him Free Shipping? –What is the best Prize?
  • 13. Business Logic Separation ● Business logic changes much faster than rest of the system ● If your code and logic are mesh together, it is a nightmare to change them. We need to sep- arate the Business logic from code
  • 14. Typical Architecture ● Mash all together architecture ● 3 tire architecture ● Even with 3 tier architecture still logic is buried in the code within services ● Good luck in locating and changing them.
  • 15. What do we need? ● Separated Business logic ● Store and manage (edit, share, delete) them in a one place and through one User Interface. ● If possible in easy to understandable form ● Edit them Visually when possible. Let's discuss two ways to implement this separ- ation: Rules and Business Process
  • 17. What are Rules? You must always drive from the left (or was it right?) You should not Eat Chocolates (Then pass me a ice cream please!)
  • 18. What are Rules? (Contd.) ● It is a knowledge representation. (usually partial knowledge) ● Four types 1)Derivation or Deduction Rules – Each rule express if some statements are true, another statement must be true. Called logical implication. E.g. Prolog 2)Transformation Rules- transform between knowledge bases, e.g. theorem proving 3)Integrity Constraints – verification rules 4)Reaction or Event-Condition-Action (ECA) Rules – includes an actions in addition to inference. e.g. Drools
  • 19. How do Rules work? ● Data represented as Facts ● Knowledge represented as Rules ● A Rule engine evaluates Facts against Rules, and optionally carry out specified actions. (e.g Drools, JESS) Two types of Rules Engines: ● Forward Chaining – starts with facts/data and trigger actions or output conclusions (Drools) ● Backward chaining – starts with goals and search how to satisfy them (e.g. Prolog)
  • 20. Why Rules? ● Externalize the business logic (which are too dy- namic) from comparatively static code base ● Simplify complicated requirements with declarative logic, raising the level of abstraction of the system ● Intuitive and readable than code, easily under- stood by business people/ non technical users ● Create complex interactions which can have powerful results, even from simple facts and rules. ● Different approach to the problem, some problems are much easier using rules. ● Fast and scalable when there is a data set that changes little by little
  • 21. When to use Rules? ● To separate code and business lo- gic ● When the logic changes often ● When Domain experts are none technical. ● When all else failed! (When there is no satisfactory traditional program- ming approach to solve the prob- lem! Rules are good in solving prob- lems that are not fully understood).
  • 22. When NOT to use Rules? ● It is slower than usual code most of the time, so unless there are obvious benefits ● Complexity of logic is hard to tackle, and one mistake could change the results drastically and in unexpected ways (e.g. recursive rules) ● More effort for testing and debugging is required, so if results are hard to be verified, it should not be used.
  • 23. Rules in SOA ● As a Service (e.g. BRS), As a Mediator (E.g. WSO2 ESB) ● Stored in a registry and referred, so they can be edited and found in one place, versioned, reverted back, tested separ- ately
  • 24. Rules in Action? ● Decision tables – in a bidding system, map the bidding rules to a Decision table implemented with a Excel file. Business analysts can change the Excel file and change Business logic of the system. ● A Domain Specific Language that interfaces with rules are used to describe when free shipping offers should be given to the user. Business analysts change the DSL scripts stored in the registry, and Business logic of the system changes. ● Rules are used to route documents between several de- partments to increase the processing efficiency. When a new pattern is observed, it can be easily added. ● Rules are used to detect error conditions in a complex de- ployment and it is easy to add new error conditions by adding new rules.
  • 26. What is Processes? Baking A Cake? Production Line Conduct a Orchestra
  • 27. What are Processes? ● Process captures a set of activities designed to achieve a specific goal. ● It is a formula, or algorithm, recipe etc. ● Unlike rules, activities in a process are very well con- nected with each other (a clear flow). ● Examples – Adding a new employee: Sign the contract, create an account, assign to a team, give permissions, assign a seat, order hadrware etc. – Release a Product: Design, develop, test, market, ..
  • 28. Sample Business Processes ● Nodes (services) are connected via dataflows (dependencies) or control flows (If, then, while).
  • 29. How do Business Processes Work? ● Business process is described using a Workflow language (e.g. BPEL, BPMN, Python, Java Script) ● Just like a java script runtime executes java scripts, a workflow engine executes the workflow description. – e.g. Apache ODE, WSO2 BPS, MS Workflow Founda- tion, Dryad by MSR etc. ● It is a programming language: ● Support messaging, asyn- chronous invocations etc. as first class Real difference lies in the Curiosity is good, ● level of abstraction. unless you are a cat
  • 30. Why Processes? ● Abstract out the business logic ● A different level of abstraction to manage the logic ● Special features – Can be visualized, analyzed, and verified – Execution can be monitored – Execution can be hibernated and resumed – Failed workflows can be recovered – Can visually composed – Workfows can be manipulated at runtime
  • 31. When to use Processes? ● To abstract out the Business Logic ● When there are many reusable com- ponents (services) that can be com- posed together (Mathlab like environ- ments) ● Easy way to evolve the logic (edit) ● For long running processes where monitoring, recovery, hibernation are expected. ● When we want to track how business process evolution took place (through provenance)
  • 32. When NOT to use Processes? ● Workflows are often slower than normal code ● Add dependency to new tools (workflow engine), complex to setup and harder to debug. ● When logic is too complex (consider implementing complex parts as services) ● Do not use unless there are clear benefits
  • 33. Business Process Execution Language (BPEL) ● A programming abstraction that allows developers to compose multiple synchronous and asynchronous Web services into an end-to-end business flow ● Constructs: – Messaging: invoke, receive, reply, assign, – Structured: sequence, flow, if, while, repeatUntil – Exception handling: fault Handlers (throw catch) – Event processing: onMessage, onAlarm ● Human Task extensions: Let workflows interact with humans ● BPMN (Business Process Modeling Notation) – a visual notation for workflows.
  • 34. Processes in Action ● A Service composition Environment: Expose a set of tools as services and use workflows to create an environment where users can compose (mash) them to create interesting processes. – E.g. Science toolkit ● Governance workflows: Workflows to capture processes associated with services in a registry dev- >test->production environment ● Modeling Internal process of an organiza- tion as Workflows ● Long running business processes: (ability to hibernate, recover, and monitor executions) – e.g. Long running scientific worklflows.
  • 35. Rules vs. Processes Processes are for well under- ● stood problems ● where sequence of actions get us into expected state. (e.g. Cook- ing) Rules are for partially under- stood (AI like heuristic driven) problems. e.g. Chess
  • 36. Conclusion ● Knowledge (Business Logic) is the greatest assert to a organizations ● Organizations that can adept themselves to change have the best chance of survival ● Separating the Business logic from the code enables Business logic to evolve and man- aged separately ● Business Rules and Business processes are two ways to extract out business logic. ● We discussed them and their applications with- in Enterprise Architecture.