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 |
|---|---|---|---|
|
|
|
(required) |
Target Pricefx object type (P, C, PX, CX, LTV, MLTV, DMDS, etc.) |
|
|
|
-- |
Name of the mapper bean to transform data before loading. |
|
|
|
-- |
Comma-separated business key field names. Required for most object types. |
|
|
|
-- |
Comma-separated max lengths for business key fields. |
|
|
|
-- |
Unique name of the target Data Source. Required when objectType is DMDS. |
|
|
|
-- |
Pricefx connection bean name. Defaults to |
|
|
|
|
Auto-detect join field definitions from the server. |
|
|
|
|
Strategy for join fields: Legacy, SetDefaultIfAbsent. |
|
|
|
-- |
Data auto-conversion strategy: MANUAL, AUTO. |
|
|
|
|
If true, data goes directly to the data source, skipping the data feed. |
Supported Object Types
|
Object Type |
businessKeys (typical) |
Notes |
|---|---|---|
|
|
|
Products master data |
|
|
|
Customers master data |
|
|
|
PX3..PX50 extension tables |
|
|
|
CX3..CX50 extension tables |
|
|
|
Requires |
|
|
|
Multi-key lookup tables (MLTV..MLTV6) |
|
|
varies |
Requires |
|
|
varies |
Datamart direct load |
|
|
|
Can also use |
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:
<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
<route>
<from uri="direct:loadProducts"/>
<to uri="pfx-api:loaddata?objectType=P&mapper=productMapper&businessKeys=sku"/>
</route>
Load Product Extensions (PX)
<route>
<from uri="direct:loadPX"/>
<to uri="pfx-api:loaddata?objectType=PX&mapper=pxMapper&businessKeys=sku"/>
</route>
Load Customers
<route>
<from uri="direct:loadCustomers"/>
<to uri="pfx-api:loaddata?objectType=C&mapper=customerMapper&businessKeys=customerId"/>
</route>
Load Customer Extensions (CX)
<route>
<from uri="direct:loadCX"/>
<to uri="pfx-api:loaddata?objectType=CX&mapper=cxMapper&businessKeys=customerId"/>
</route>
Load Data Source (DMDS)
<route>
<from uri="direct:loadDataSource"/>
<to uri="pfx-api:loaddata?objectType=DMDS&dsUniqueName=MyDataSource&mapper=dsMapper&businessKeys=sku,region"/>
</route>
Load Datamart (DM)
<route>
<from uri="direct:loadDM"/>
<to uri="pfx-api:loaddata?objectType=DM&dsUniqueName=MyDatamart&mapper=dmMapper&businessKeys=sku"/>
</route>
Headers
Consumed
|
Header |
Type |
Description |
|---|---|---|
|
|
|
Overrides the mapper for this invocation. |
|
|
|
Overrides the businessKeys parameter. |
|
|
|
Overrides the businessKeysMaxLengths parameter. |
Produced
|
Header |
Type |
Description |
|---|---|---|
|
|
|
Number of input records in the current batch. |
Common Pitfalls
-
Missing businessKeys -- Most object types require businessKeys. Without them, the load will fail or produce unexpected results.
-
Missing dsUniqueName for DMDS -- When loading into a Data Source, you must specify
dsUniqueName. The component cannot infer it. -
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.
-
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=AUTOfor automatic conversion. -
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.
-
Flush required after DMDS load -- After loading into a Data Source (DMDS), you must call
pfx-api:flushto move data from the data feed to the data source. Forgetting this step means data will not be visible in the Datamart.