Managing a Purchase Order
A purchase order moves through a set of operations including submission, verifying status, calculating price, and managing faults. This sample shows the processes used to manage these operations.
Procedure
Configure the Server
Configure the ActiveMatrix BusinessWorks 5.x Client
Result
See the following output:
Purchase ID 1234 is not valid
Submit PurchaseOrder Successful
Status PurchaseOrder :Pending
Status PurchaseOrder: Processed
Understanding the Configuration
The
SellerService main process implements the
submitPurchaseOrder and
checkStatusPurchaseOrder operations. The
submitPurchaseOrder operation returns a purchase order ID. A buyer uses this ID to check status when invoking the
checkStatusPurchaseOrder operation. Each operation calls subprocesses:
- The SubmitPOExecute subprocess is called from the submitPurchaseOrder operation and initiates the purchase order submission by calling the SubmitProcessOrder sub process and then generates the purchase order ID.
- The SubmitProcessOrder subprocess calls the GetPriceForItem and CalculateShippingCosts sub processes to calculate item prices and shipping costs respectively. After these calculations complete, the purchase order changes to processed status, from pending status.
- The GetPriceForItem subprocess reads data from PriceBook.xml and returns the price for an item.
- The CalculateShippingCosts subprocess reads data from ShippingCosts.xml and returns the shipping costs based on region.
- The CheckStatus subprocess is called from the checkStatusPurchaseOrder operation and returns the status of purchase order, either pending or processed.
Copyright © Cloud Software Group, Inc. All rights reserved.