pfx-api:loaddata

pfx-api:loaddata

Bulk-load data into Pricefx objects (products, customers, pricing parameters, data sources, datamarts, and all extension types).


Overview

The loaddata method is the primary import mechanism in Integration Manager. It takes data from the exchange body (typically a list of maps or a CSV stream), applies a mapper transformation, and bulk-loads it into the specified Pricefx object type.

URI Format

pfx-api:loaddata?objectType=P&mapper=productMapper&businessKeys=sku

Parameters

Parameter

Type

Default

Description

objectType

ObjectType

(required)

Target Pricefx object type (P, C, PX, CX, LTV, MLTV, DMDS, etc.)

mapper

String

--

Name of the mapper bean to transform data before loading.

businessKeys

String

--

Comma-separated business key field names. Required for most object types.

businessKeysMaxLengths

String

--

Comma-separated max lengths for business key fields.

dsUniqueName

String

--

Unique name of the target Data Source. Required when objectType is DMDS.

connection

String

--

Pricefx connection bean name. Defaults to pricefx.

detectJoinFields

Boolean

true

Auto-detect join field definitions from the server.

joinFieldsStrategy

JoinFieldsStrategy

Legacy

Strategy for join fields: Legacy, SetDefaultIfAbsent.

converterStrategyType

MapperConverterStrategyType

--

Data auto-conversion strategy: MANUAL, AUTO.

direct2ds

Boolean

false

If true, data goes directly to the data source, skipping the data feed.


Supported Object Types

Object Type

businessKeys (typical)

Notes

P (Product)

sku

Products master data

C (Customer)

customerId

Customers master data

PX (ProductExtension)

sku

PX3..PX50 extension tables

CX (CustomerExtension)

customerId

CX3..CX50 extension tables

LTV (LookupTableValue)

name

Requires pricingParameterId or pricingParameterName

MLTV (MatrixLookupTableValue)

key1,key2,...

Multi-key lookup tables (MLTV..MLTV6)

DMDS (DMDataSource)

varies

Requires dsUniqueName

DM (DMDatamart)

varies

Datamart direct load

U (User)

loginName

Can also use importUsers method


Mapper Usage

The mapper parameter references a Spring bean that implements LoaddataMapper. The mapper transforms each incoming record into the structure expected by the Pricefx API.

A typical mapper definition in XML:

XML
<pfx:loaddataMapper id="productMapper">
    <pfx:field from="SKU" to="sku"/>
    <pfx:field from="PRODUCT_NAME" to="label"/>
    <pfx:field from="ATTR1" to="attribute1"/>
    <pfx:field from="ATTR2" to="attribute2"/>
</pfx:loaddataMapper>

You can override the mapper at runtime by setting the loadDataMapperPfx header on the exchange.


Business Keys

Business keys identify records uniquely within the target object type. They are used to match incoming data to existing records.

  • For Products: typically sku

  • For Customers: typically customerId

  • For Data Sources: depends on the data source schema

  • For Matrix Lookup Tables: key1, key2, etc.

You can override business keys at runtime using the pfxBusinessKeys header.


Examples

Load Products

XML
<route>
    <from uri="direct:loadProducts"/>
    <to uri="pfx-api:loaddata?objectType=P&amp;mapper=productMapper&amp;businessKeys=sku"/>
</route>

Load Product Extensions (PX)

XML
<route>
    <from uri="direct:loadPX"/>
    <to uri="pfx-api:loaddata?objectType=PX&amp;mapper=pxMapper&amp;businessKeys=sku"/>
</route>

Load Customers

XML
<route>
    <from uri="direct:loadCustomers"/>
    <to uri="pfx-api:loaddata?objectType=C&amp;mapper=customerMapper&amp;businessKeys=customerId"/>
</route>

Load Customer Extensions (CX)

XML
<route>
    <from uri="direct:loadCX"/>
    <to uri="pfx-api:loaddata?objectType=CX&amp;mapper=cxMapper&amp;businessKeys=customerId"/>
</route>

Load Data Source (DMDS)

XML
<route>
    <from uri="direct:loadDataSource"/>
    <to uri="pfx-api:loaddata?objectType=DMDS&amp;dsUniqueName=MyDataSource&amp;mapper=dsMapper&amp;businessKeys=sku,region"/>
</route>

Load Datamart (DM)

XML
<route>
    <from uri="direct:loadDM"/>
    <to uri="pfx-api:loaddata?objectType=DM&amp;dsUniqueName=MyDatamart&amp;mapper=dmMapper&amp;businessKeys=sku"/>
</route>

Headers

Consumed

Header

Type

Description

loadDataMapperPfx

LoaddataMapper

Overrides the mapper for this invocation.

pfxBusinessKeys

String

Overrides the businessKeys parameter.

pfxBusinessKeysMaxLengths

String

Overrides the businessKeysMaxLengths parameter.

Produced

Header

Type

Description

PfxInputRecordsCount

Integer

Number of input records in the current batch.


Common Pitfalls

  1. Missing businessKeys -- Most object types require businessKeys. Without them, the load will fail or produce unexpected results.

  2. Missing dsUniqueName for DMDS -- When loading into a Data Source, you must specify dsUniqueName. The component cannot infer it.

  3. Mapper field mismatch -- If the mapper references fields that do not exist in the incoming data, those fields will be null in the output. Always verify your mapper field names match the source data.

  4. Data type mismatches -- Pricefx enforces types on fields (e.g., numeric attributes). If your mapper sends a string where a number is expected, the load will fail. Consider using converterStrategyType=AUTO for automatic conversion.

  5. Extension table numbering -- PX and CX extension tables must match the configured number on the Pricefx side (PX3..PX50, CX3..CX50). Ensure the objectType matches exactly.

  6. Flush required after DMDS load -- After loading into a Data Source (DMDS), you must call pfx-api:flush to move data from the data feed to the data source. Forgetting this step means data will not be visible in the Datamart.