Designing Client Extensions
Designing your client extension is the most significant part of implementing client extensions. This design cycle involves the following aspects:
Step 1. Understand the appropriate client extension, including its intended purpose, its processing flow, the predefined place that it is called, and its input values.
Step 2. Define and document the requirements and logic of your business rules under all possible conditions. This logic includes the required inputs, the calculations performed, and the corresponding outputs.
Step 3. Determine the data elements required to drive your rules and how you will select or derive each of the required elements. Define additional implementation data and document additional business functions of using the system based on the requirements of your business rules.
Determining Data Elements
Predefined Parameters
Cost Management provides predefined parameters for each client extension. The program which calls and executes the client extension passes in values for the predefined parameters, which define the context of what transaction is being processed.
Derived Information
You can derive additional information from the predefined parameters. For example, a client extension may have a predefined parameter of TRANSACTION_ID, which is the identifier of the transaction. Your business rule needs transaction type, so you derive the transaction type from the TRANSACTION_ID.
Example of Designing Client Extension
Let's use our earlier extension example to illustrate these design steps.
Step 1. After studying client extensions, you have decided to use the account generation extension to implement the following policy:
You should only use product line accounts for
subinventory transfers
Step 2. You define the logic for the account generation extension as:
IF transaction is (subinventory_transfer)
THEN Find out Product Line Account for this
item, organization, and subinventory
RETURN Accounts
Step 3. Determine what input data and output data is required. Per the above example, the data required and its source is listed in the following table:
|
Transaction identifier
| Predefined
|
Organization identifier
| Predefined
|
Inventory item identifier
| Derived
|
Subinventory Code
| Predefined
|
Transaction Action
| Derived
|
The SQL script for capturing the derived data listed in the above table is as follows:
SELECT Transaction_action, inventory_item identifier
FROM mtl_material_transactions
WHERE transaction identifier = current transaction
The following outputs must be derived from these inputs:
SELECT product line accounts
FROM mtl_category_accounts
WHERE inventory_item_id = current item identifier
AND organization_id = current organization identifier
AND subinventory_code = subinventory code