next up previous contents
Next: References Up: The Functional Model Previous: Guidelines for Drawing

A Toy Sales Order Entry & Processing System (Example):

I give below the functional specifications for a toy sales order entry and processing system. The specifications given are for the logical aspects of the system only, and therefore are, incomplete. They are also incomplete in that the behavior model is absent. They are given as illustrations only. They consist of:

I will not provide the physical DFDs below, since they are implementation dependent, and I have not based this toy system on any real-world accounting system.

We have yet to discuss the data models and databases. We will not be discussing programming aspects of systems. Therefore, the database specifications are given as a prelude to our class discussions on databases later in the semester. The code is given just for the purpose of appreciation.

We are talking about a very small firm that considers orders from customers for one item. You should be able to add bells and whistles as you wish. The situation considered is rather unrealistic, but it makes important points about specifications for an accounting system and its documentation.

Dataflow Diagrams:

Context Diagram: (Sales Order Entry & Processing System)

 
Figure:   Context Diagram

Level 0 Logical Dataflow Diagram: (Sales Order Entry & Processing System)

 
Figure:   Level 0 Dataflow Diagram

Level 1 Logical Dataflow Diagram: (Sales Order Entry Sub-system)

 
Figure:   Level 1 Dataflow Diagram (Sales Order Entry Subsystem)

Level 1 Logical Dataflow Diagram: (Sales Order Processing Sub-system)

 
Figure:   Level 1 Dataflow Diagram (Sales Order Processing Subsystem

Dataflow Specifications

Syntax: dataflowName(attribute1, attribute2,.....)

order(CustomerName, CustomerAddress, Item, Quantity)

pricedOrder(CustomerName, CustomerAddress, Item, Quantity, OrderPrice)

weDontSell(CustomerName, CustomerAddress, Item)

sorryBadCredit(CustomerName, CustomerAddress)

approvedOrder(CustomerName, CustomerAddress, Item, Quantity, OrderPrice)

sorryNotInStock(CustomerName, CustomerAddress, Item)

acceptedOrder(CustomerName, CustomerAddress, Item, Quantity, OrderPrice)

salesOrder(CustomerName, CustomerAddress, Item, Quantity, OrderPrice)

billOfLading(CustomerName, CustomerAddress, Item, Quantity)

invoice(CustomerName, CustomerAddress, Item, Quantity, OrderPrice)

Datastore Specifications:

Syntax: relationName(attribute1, attribute2,......)

priceList(Item, Price)

customerMaster(CustomerName, CustomerAddress, Balance, CreditLimit)

inventoryMaster(Item, QuantityOnHand)

salesOrderMaster(CustomerName, Item, Quantity, OrderPrice)

billOfLading(CustomerName, Item, Quantity)

openInvoices(CustomerName, Item, Quantity, OrderPrice)

customer(CustomerName, CustomerAddress)

order(CustomerName, CustomerAddress, Item, Quantity)

Process Specifications:

Syntax: prolog clause

/* Orders are priced by multiplying the quantity ordered by the price for the item on the price list */

pricedOrder(CustomerName, CustomerAddress, Item, Quantity, OrderPrice)

if

order(CustomerName, CustomerAddress, Item, Quantity),

priceList(Item, Price),

orderPrice is Price * Quantity.

/* We don't sell the item ordered by the customer if such item is not on the price list */

weDontSell(CustomerName, CustomerAddress, Item)

if

order(CustomerName, CustomerAddress, Item, Quantity),

not priceList(Item, - ).

/* A customer order for an item is approved if the order is priced and the account balance after the order is less than the credit limit */

approvedOrder(CustomerName, CustomerAddress, Item, Quantity, OrderPrice)

if

pricedOrder(CustomerName, CustomerAddress, Item, Quantity, OrderPrice),

customerMaster(CustomerName, CustomerAddress, Balance, CreditLimit),

NewBalance is Balance + OrderPrice,

NewBalance < CreditLimit.

/* A customer order is rejected on account of bad credit if the order is priced and the account balance after the order exceeds the credit limit for the customer */

sorryBadCredit(CustomerName, CustomerAddress)

if

pricedOrder(CustomerName, CustomerAddress, Item, Quantity, OrderPrice),

customerMaster(CustomerName, CustomerAddress, Balance, CreditLimit),

NewBalance is Balance + OrderPrice,

NewBalance >= CreditLimit.

/* A customer order is accepted if it is approved and the quantity on hand of the item ordered is at least as much as the quantity ordered */

acceptedOrder(CustomerName, CustomerAddress, Item, Quantity, OrderPrice)

if

approvedOrder(CustomerName, CustomerAddress, Item, Quantity, OrderPrice),

inventoryMaster(Item, QuantityOnHand),

QuantityOnHand >= Quantity.

/* A sales order is prepared if a customer order is accepted */

salesOrder(CustomerName, CustomerAddress, Item, Quantity, OrderPrice)

if

acceptedOrder(CustomerName, CustomerAddress, Item, Quantity, OrderPrice),

/* A bill of lading is prepared if a sales order is prepared */

billOfLading(CustomerName, CustomerAddress, Item, Quantity)

if

salesOrder(CustomerName, CustomerAddress, Item, Quantity, OrderPrice).

/* An open invoice is prepared if a bill of lading is prepared */

openInvoices(CustomerName, Item, Quantity, OrderPrice)

if

billOfLading(CustomerName, CustomerAddress, Item, Quantity).

/* A customer's account is updated by adding the order price to the current balance in the account if open invoice is prepared */

updateCustomerAccountsForInvoices

if

openInvoices(CustomerName, Item, Quantity, OrderPrice),

retract(customerMaster(CustomerName, CustomerAddress, Balance, CreditLimit)),

NewBalance is Balance + OrderPrice,

assert(customerMaster(CustomerName, CustomerAddress, NewBalance, CreditLimit)).



next up previous contents
Next: References Up: The Functional Model Previous: Guidelines for Drawing



Jagdish Gangolly
Fri Sep 8 20:22:25 EDT 2000