Code Conversion

The Oracle e-Commerce Gateway Code Conversion Module is a flexible and extremely powerful feature used to reconcile (convert) values from your trading partner's application or industry standard to values stored within Oracle Applications.

Code conversion is a common problem in any integration scenario where coded values such as Unit of Measure Code or Currency Code are represented differently in each of the applications being integrated. Many times, rules for performing these conversions can become quite complicated.

If you are integrating with trading partners using multiple applications and/or standards, a simple lookup table with "to" and "from" columns will not be sufficient. Advanced code conversion rules based on trading partner, industry standard, or transaction direction are required to support these complex application integration relationships. Code conversion rules in Oracle e-Commerce Gateway are defined as a set of "to" and "from" values plus additional attributes to determine specific code conversion processing behavior.

Key features of the Oracle e-Commerce Gateway Code Conversion Module include:

To enable code conversion for specific data elements within a transactions, there are three easy setup steps:

Define Code Conversion Category allows you to enter all of the categories applicable to your business processing environment. A category is defined as a group of code conversion rules applicable to a single data element. Many predefined categories are included in Oracle e-Commerce Gateway. You may choose to implement these predefined categories or define your own. See: Defining Code Conversion Categories for details.

Define Code Conversion Values is where simple, or advanced code conversion rules along with their corresponding internal/external values are defined. Internal values are defined as code values stored in Oracle Applications. External values are code values in your trading partner's application or industry standard. In this form you can define advanced rules such as direction-specific, industry-standard-specific, one-to-many, and multi-level hierarchy code conversion rules. Every code conversion rule is associated with a code conversion category. See: Defining Code Conversion Values for details.

Assign Code Conversion Category associates a category (including all rules associated with that category) with a specific data element in a transaction. This assignment will enable code conversion for the transaction/data element. See: Assigning Categories for details.

If you use the code conversion by trading partner standard feature, an additional setup step to enter document standard in the Trading Partner Details form is required. See: Oracle e-Commerce Gateway Implementation Manual for details.

Code Conversion Based on Direction

Direction-specific code conversion is used in situations where a trading partner or group of trading partners have code conversion requirements that apply to only inbound or outbound code conversions. This feature is used in conjunction with the multiple key feature of Code Conversion to provide maximum flexibility and configuration of your unique code conversion requirements.

An example of how this feature can be applied is:

An Oracle Applications trading partner both receives purchase orders and sends invoices electronically. They have separate Order Entry and Accounts Receivable applications, each with its own unique set of UOM codes. Separate code conversion rules must be defined for the same trading partner based on transaction direction.

Direction-specific code conversion rules are defined in the Define Code Conversion Values form of Oracle e-Commerce Gateway. For each code conversion rule, you can also specify if the rule applies to inbound transactions, outbound transactions, or both.

In most situations, you will accept the default value of "Both". However, if you have complex code conversion requirements that require direction-specific code conversion rules, you will specify direction on this form.

Use of Keys in Code Conversion

In many situations, one set of code conversion rules will not apply to all of your trading partners. Code conversion rules may apply to specific trading partners, specific industry standards, or any number of key attributes defined in Oracle Applications.

These rules may be complex and involve a hierarchy of key attributes.

For example, trading partner and trading partner location may be defined as two key attributes. The logical hierarchy structure will look like this:

  Code Conversion Category
     Trading Partner (Key 1)
          Trading Partner Location (Key 2)

During code conversion processing, if a code conversion rule is defined for the specific trading partner, trading partner location combination, that code conversion rule will be applied. Otherwise, processing will default to the trading partner level and apply any code conversion rules for that trading partner. If a rule still cannot be found, processing will default to the category level and apply any code conversion rules that apply to the entire category.

Keys and key hierarchies are user defined and apply to a specific code conversion category. Any data element that appears on the Interface File Definition form can be defined as a key attribute. In addition, Document Standard, defined in the Trading Partner Details form, can also be defined as a key attribute.

Multiple keys are used to construct a logical hierarchy used by code conversion processing to determine which code conversion rules to apply. Up to five levels of keys can be defined for a single code conversion category. See Processing Keys (1-5) for additional details on how multiple keys are processed.

If keys are used for code conversion, setup is required in each of the three code conversion forms.

The use of keys can also be combined with direction-specific code conversion rules to provide maximum flexibility and configuration of your unique code conversion requirements. See Code Conversion Based on Direction for additional information on direction-specific code conversion.

Code Conversion Processing

The Oracle e-Commerce Gateway Code Conversion Module is designed to process very basic or very complex code conversion rules.

Key setup data elements used in code conversion processing are:

For inbound code conversion, values for each of these data elements (except Internal Value) are used to derive Internal Value.

For outbound code conversion, values for each of these data elements (except External Value 1-5) are used to derive External Value (1-5).

Inbound Code Conversion Processing

During inbound transaction processing, inbound files are processed based on the interface file definition in Oracle e-Commerce Gateway. The interface file definition, as defined in the Interface File Definition form, will determine file layout and structure. It will also identify External Values (1-5) used for inbound code conversion processing.

Code conversion category data entered in the Assign Code Conversion Category form determine which fields require inbound code conversion processing. Key values are also derived from data in this form.

Inbound code conversion processing uses:

All of these values are used to find a record in the Code Conversion Values table that matches the above values. If found, convert External Values (1-5) to Internal Value based on this record definition.

If no match is found, continue processing key values (if keys are used).

If no match is found, locate a record in the Code Conversion Values table with no key values defined and convert External Values (1-5) to Internal Values based on this record definition.

If no match is found, default External Value 1 into the Internal Value field.

Note: If an Internal Value is present in the inbound interface file, inbound code conversion processing will not overwrite the Inbound Value in the file.

Outbound Code Conversion Processing

During outbound transaction processing, code conversion category data entered in the Assign Code Conversion Category form determine which fields require outbound code conversion processing. Key values are also derived from data in this form.

Outbound code conversion processing uses:

All of these values are used to find a record in the Code Conversion Values table that matches the above values. If found, convert Internal Value to the External Value (1-5) based on this record definition.

If no match is found, continue processing key values (if keys are used).

If no match is found, locate a record in the Code Conversion Values table with no key values defined and convert Internal Value to External Value (1-5) based on this record definition.

If no match is found, default Internal Value into the External Value 1 field.

Processing Keys (1-5)

In Oracle e-Commerce Gateway, keys are used to construct a logical hierarchy of key attributes. Code conversion processing derives key values based on data entered in the Assign Code Conversion Category form.

Once key values are derived from the interface file (inbound) or transaction record (outbound), a composite key is constructed with values for all key levels that apply for the code conversion category.

Code conversion processing will use this composite key to locate records in the Code Conversion Values table with exactly the same composite key plus matching attributes for the other critical data elements in code conversion processing.

Failure to located a matching record will cause code conversion processing to construct a new composite key by using values for all key levels except the highest key level. This is effectively the same as stepping up one level in the hierarchy of key attributes.

For example, trading partner and trading partner location may be defined as two key attributes. The logical hierarchy structure will look like this:

  Code Conversion Category = "UOM".
    Trading Partner (Key 1) = "Company ABC".
          Trading Partner Location (Key 2) = "CA"

The initial composite key will contain values "Company ABC" and "CA". Any records in the Code Conversion Values table that have matching Key 1 and Key 2 values, plus meet all other matching criteria, will be used to convert internal or external values.

If a matching record is not found, the new composite key will contain the value "Company ABC" ("CA" has been removed from the composite key). Now, code conversion processing is looking for a match on Trading Partner (Key 1) only.

This cycle of stepping up the hierarchy of key attributes to construct new composite keys is repeated until the composite key contains no values. At this point, code conversion processing attempts to locate a match based on Code Conversion Category only.

Processing External Values (1-5)

External Values (1-5) are processed as one, composite external value. Code conversion processing does not view External Values (1-5) as a hierarchy or multiple composite values.

During outbound code conversion processing, any Code Conversion Values record that contains multiple External Values will convert all External Values and write them to the interface file (if the Code Conversion Values record matches all other criteria).

During inbound code conversion processing, all External Values plus other matching criteria must be contained in the Code Conversion Values record in order for that record to qualify for code conversion.

Additional Information: For additional information, see:

Code Conversion, Oracle e-Commerce Gateway Implementation Manual

Defining Code Conversion Categories

Assigning Categories

Predefined Code Categories

Defining Code Conversion