Summary: Reference for all datamart/data source operations -- load, flush, truncate, calculate, refresh, and data mirroring from Products/Customers.
Overview
Datamart operations allow you to manage Pricefx Data Marts (DM), Data Sources (DMDS), and Data Feeds (DMF). These elements are defined in the pfx namespace (http://www.pricefx.eu/schema/pfx) and are used within integration route configurations.
dmLoad
Loads data into a datamart data source. This is the primary element for pushing external data (e.g., from CSV or database) into a Pricefx Data Source.
Attributes
|
Attribute |
Type |
Required |
Description |
|---|---|---|---|
|
|
|
Yes |
Unique bean identifier for this element. |
|
|
|
Yes |
The unique name of the target Data Source (DMDS) in Pricefx. |
|
|
|
No |
Strategy for type conversion during load (e.g., handling numbers, dates). |
|
|
|
Yes |
Reference to a |
|
|
|
No |
Comma-separated list of business key field names for upsert behavior. |
|
|
|
No |
Target partition override. Used when loading data into a partition different from the default connection. |
Example: Load CSV into a Data Source
<pfx:mapper id="salesDataMapper" type="loaddata">
<pfx:body in="ProductID" out="attribute1"/>
<pfx:body in="Region" out="attribute2"/>
<pfx:body in="Revenue" out="attribute3" converter="StringToNumber"/>
<pfx:body in="TransDate" out="attribute4" converter="StringToDate" format="yyyy-MM-dd"/>
</pfx:mapper>
<pfx:dmLoad id="loadSalesData"
dsUniqueName="SalesData_DS"
mapper="salesDataMapper"/>
Example: Load with Business Keys (upsert)
<pfx:dmLoad id="loadSalesDataUpsert"
dsUniqueName="SalesData_DS"
mapper="salesDataMapper"
businessKeys="attribute1,attribute2"/>
Example: Load into a Specific Partition
<pfx:dmLoad id="loadSalesDataPartition"
dsUniqueName="SalesData_DS"
mapper="salesDataMapper"
partitionPfxApi="otherPartitionConnection"/>
dmFlush
Flushes (submits) data from a Data Source into a Data Feed. After loading data into a DMDS with dmLoad, you must flush it so the data becomes available in the associated DMF.
Attributes
|
Attribute |
Type |
Required |
Description |
|---|---|---|---|
|
|
|
Yes |
Unique bean identifier. |
|
|
|
Yes |
Name of the Data Source (DMDS) to flush. |
|
|
|
Yes |
Name of the target Data Feed (DMF) to flush into. |
|
|
|
No |
Date expression for incremental flush. Only data newer than this date will be flushed. Supports Camel Simple expressions. |
Example: Flush a Data Source to a Data Feed
<pfx:dmFlush id="flushSalesData"
dataSourceName="SalesData_DS"
dataFeedName="SalesData_DMF"/>
Example: Incremental Flush
<pfx:dmFlush id="flushSalesDataIncremental"
dataSourceName="SalesData_DS"
dataFeedName="SalesData_DMF"
incrementalDate="${header.lastRunDate}"/>
dmTruncate
Truncates (deletes) data from a Data Source or Data Feed. Use this to clear existing data before a full reload.
Attributes
|
Attribute |
Type |
Required |
Description |
|---|---|---|---|
|
|
|
Yes |
Unique bean identifier. |
|
|
|
Yes |
Name of the DMDS or DMF to truncate. |
|
|
|
No |
Typed identifier of the target (e.g., |
|
|
|
No |
Date expression for incremental truncation. Only data older than this date will be removed. |
|
|
|
No |
Reference to a filter bean for conditional truncation. Only matching records are removed. |
Example: Full Truncate of a Data Feed
<pfx:dmTruncate id="truncateSalesDMF"
targetName="SalesData_DMF"/>
Example: Truncate with Filter
<pfx:filter id="oldDataFilter">
<pfx:and>
<pfx:criterion fieldName="attribute4" operator="lessThan" value="2025-01-01"/>
</pfx:and>
</pfx:filter>
<pfx:dmTruncate id="truncateOldSales"
targetName="SalesData_DMF"
dtoFilter="oldDataFilter"/>
Example: Incremental Truncate
<pfx:dmTruncate id="truncateIncremental"
targetName="SalesData_DS"
incrementalDate="${header.cutoffDate}"/>
dmCalculate
Triggers a datamart calculation. This runs the logic defined on a Datamart (DM) to process its Data Feeds and produce calculated results.
Attributes
|
Attribute |
Type |
Required |
Description |
|---|---|---|---|
|
|
|
Yes |
Unique bean identifier. |
|
|
|
Yes |
Typed identifier of the Datamart (e.g., |
|
|
|
Yes |
Name of the Datamart to calculate. |
|
|
|
No |
Date expression for incremental calculation. |
Example: Full Datamart Calculation
<pfx:dmCalculate id="calculateSalesDM"
typedId="DM.12345"
targetName="SalesDatamart"/>
Example: Incremental Calculation
<pfx:dmCalculate id="calculateSalesDMIncremental"
typedId="DM.12345"
targetName="SalesDatamart"
incrementalDate="${header.lastCalcDate}"/>
dmRefresh
Refreshes a datamart, triggering a full recalculation of all its feeds and logic. Typically used after data loads and flushes are complete.
Attributes
|
Attribute |
Type |
Required |
Description |
|---|---|---|---|
|
|
|
Yes |
Unique bean identifier. |
|
|
|
No |
Name of the Datamart to refresh. If omitted, refreshes the default datamart. |
|
|
|
No |
Date expression for incremental refresh. |
Example: Full Refresh
<pfx:dmRefresh id="refreshSalesDM"
dataMartName="SalesDatamart"/>
Example: Incremental Refresh
<pfx:dmRefresh id="refreshSalesDMIncremental"
dataMartName="SalesDatamart"
incrementalDate="${header.lastRefreshDate}"/>
dmCustomers
Mirrors customer master data into the datamart. This loads customer data from the Pricefx Customer Master into the DM for use in datamart calculations and analytics.
Attributes
|
Attribute |
Type |
Required |
Description |
|---|---|---|---|
|
|
|
Yes |
Unique bean identifier. |
|
|
|
No |
Date expression for incremental customer mirroring. Only customers modified after this date will be loaded. |
Example: Full Customer Mirror
<pfx:dmCustomers id="mirrorCustomers"/>
Example: Incremental Customer Mirror
<pfx:dmCustomers id="mirrorCustomersIncremental"
incrementalDate="${header.lastCustomerSync}"/>
dmProducts
Mirrors product master data into the datamart. This loads product data from the Pricefx Product Master into the DM for use in datamart calculations and analytics.
Attributes
|
Attribute |
Type |
Required |
Description |
|---|---|---|---|
|
|
|
Yes |
Unique bean identifier. |
|
|
|
No |
Date expression for incremental product mirroring. Only products modified after this date will be loaded. |
Example: Full Product Mirror
<pfx:dmProducts id="mirrorProducts"/>
Example: Incremental Product Mirror
<pfx:dmProducts id="mirrorProductsIncremental"
incrementalDate="${header.lastProductSync}"/>
Common Patterns
Full Datamart Reload Pipeline
A typical end-to-end pattern: truncate old data, load new data from CSV, flush to the feed, and refresh the datamart.
<!-- 1. Define the mapper -->
<pfx:mapper id="salesMapper" type="loaddata">
<pfx:body in="ProductID" out="attribute1"/>
<pfx:body in="Region" out="attribute2"/>
<pfx:body in="Revenue" out="attribute3" converter="StringToNumber"/>
</pfx:mapper>
<!-- 2. Truncate the Data Feed -->
<pfx:dmTruncate id="truncateSales" targetName="SalesData_DMF"/>
<!-- 3. Load CSV into the Data Source -->
<pfx:dmLoad id="loadSales"
dsUniqueName="SalesData_DS"
mapper="salesMapper"/>
<!-- 4. Flush from Data Source to Data Feed -->
<pfx:dmFlush id="flushSales"
dataSourceName="SalesData_DS"
dataFeedName="SalesData_DMF"/>
<!-- 5. Refresh the Datamart -->
<pfx:dmRefresh id="refreshDM" dataMartName="SalesDatamart"/>
In the route, these would be called in sequence:
<route id="fullDmReloadRoute">
<from uri="direct:fullDmReload"/>
<to uri="pfx-api:truncateSales"/>
<to uri="pfx-csv:file:data/sales.csv?dataFormat=salesCsvFormat"/>
<to uri="pfx-api:loadSales"/>
<to uri="pfx-api:flushSales"/>
<to uri="pfx-api:refreshDM"/>
</route>
Incremental Load with Customer/Product Mirror
<pfx:dmCustomers id="syncCustomers" incrementalDate="${header.lastSync}"/>
<pfx:dmProducts id="syncProducts" incrementalDate="${header.lastSync}"/>
<pfx:dmLoad id="loadIncrementalSales"
dsUniqueName="SalesData_DS"
mapper="salesMapper"
businessKeys="attribute1,attribute2"/>
<pfx:dmFlush id="flushIncrementalSales"
dataSourceName="SalesData_DS"
dataFeedName="SalesData_DMF"
incrementalDate="${header.lastSync}"/>
<pfx:dmRefresh id="refreshDMIncremental"
dataMartName="SalesDatamart"
incrementalDate="${header.lastSync}"/>
See Also
-
Mappers -- field mapping configuration for
dmLoad -
Filters -- filter syntax used by
dmTruncate.dtoFilter -
Routes -- how to wire datamart operations into integration routes
-
Pfx API Component -- the
pfx-api:endpoint used to invoke these operations