• Like
  • Save
Business Rules Logical Experssion and SBVR
Upcoming SlideShare
Loading in...5
×
 

Business Rules Logical Experssion and SBVR

on

  • 1,065 views

 

Statistics

Views

Total Views
1,065
Views on SlideShare
1,064
Embed Views
1

Actions

Likes
0
Downloads
0
Comments
0

1 Embed 1

https://www.linkedin.com 1

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Business Rules Logical Experssion and SBVR Business Rules Logical Experssion and SBVR Presentation Transcript

    • Conceptual Graphs, Logical Expressions and SBVR
      By: GeshanManandhar
      12/04/2011
    • Business Rules
      Business rule is “rule that is under business jurisdiction” (Object Management Group, 2008)
      Constraints are ways to enforce business rules.
      Conceptual graphs and logical expression provide a path to translate constraints into physical level implementation.
      SBVR is a formal standard developed by OMG to define business vocabulary and describe rules based on the vocabulary.
      2
    • Constraint 3 : Conceptual Graph
      A pickup biker cannot pickup a consignment in a district which she/he does not cover.
      3
    • Constraint 3: Logical Expression
      Logical Expression:
      not (a valid concept PB of type ‘Pickup Biker’ and a valid concept DP of type ‘Dispatch Parcel’ and a valid concept DD of type ‘District Division’ and a valid concept PC of type ‘Parcel of Consignment’ and a valid concept PD of type ‘Pickup District’ such that PB.Employeeo DD.Employeeand PB.Dispatch Parcel o DP and DP.Parcel of Consignment o PC and PC.Consignmento PD.Consignmentand PD.District <> DD.District)
      4
    • Constraint 3 : SBVR
      5
    • Constraint 3: Trigger
      CREATE TRIGGER [PICKUP_BIKER_COVERS_PICKUP_DISTRICT]
      ON [DISPATCH_PARCEL] FOR INSERT, UPDATE
      AS
      IF EXISTS (SELECT DP.CONSIGNMENT_NR
      FROM DISPATCH_PARCEL DP INNER JOIN EMPLOYEE E ON DP.PICKUP_BIKER = E.EMPLOYEE_NR INNER JOIN INSERTED I ON
      I.PICKUP_BIKER = E.EMPLOYEE_NR INNER JOIN CONSIGNMENT C ON C.CONSIGNMENT_NR = DP.CONSIGNMENT_NR
      WHERE C.PICKUP_DISTRICT_NAME <> E.DISTRICT_NAME
      )
      BEGIN
      RAISERROR 4000005 'THE PICKER BIKER DOES NOT COVER THE PICKUP DISTRICT.'
      ROLLBACK
      END
      6
    • Constraint 4: Conceptual Graph
      The delivery time of a dispatch parcel must not be equal or smaller than the pickup time of that dispatch parcel.
      7
      Logical Expression:
      not (a valid concept DDT of type ‘Dispatch Delivery Time’and a valid concept DPT of type ‘Dispatch Pickup Time’such that DDT.DispatchParcel o DPT.Dispatch Parcel and DDT.Date_Time<= DPT.Date_Time)
    • Constraint 4: SBVR
      8
    • Constraint 4: Check Constraint
      ALTER TABLE DISPATCH_PARCEL WITH CHECK
      ADD CONSTRAINT DISPATCH_DELIVERY_TIME_LATER_THAN_PICKUP_TIME
      CHECK ((DISPATCH_D > DISPATCH_P))
      9
    • Reflection
      Business rules are easy to express in natural language but difficult to implement.
      It is better to write rules as what is not wanted (negative statements).
      A well designed repository of business rules in form of logical expression can help to automate implementation (active approach).
      10