pfx-api:flush
Flush data from a Datamart data feed to a data source. This step is mandatory after loading data into a DMDS (Datamart Data Source) via
loaddataorloaddataFile.
Overview
The flush method moves data that has been loaded into a data feed into its associated data source. In the Pricefx data pipeline:
-
Data is loaded into a data feed (via
loaddataorloaddataFilewith objectType=DMDS) -
The data feed is flushed to the data source (via
flush) -
The datamart can then be refreshed to incorporate the new data (via
refreshorcalculate)
Without the flush step, data loaded into a data feed will not appear in the data source or datamart.
URI Format
pfx-api:flush?dataFeedName=MyFeed&dataSourceName=MyDS
Parameters
|
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
(required) |
The name of the source data feed to flush from. |
|
|
|
(required) |
The name of the target data source to flush into. |
|
|
|
-- |
Incremental date for incremental flushes. When set, only data newer than this date is flushed. |
|
|
|
-- |
Pricefx connection bean name. |
Examples
Basic Flush
<route>
<from uri="direct:flushDM"/>
<to uri="pfx-api:flush?dataFeedName=MyFeed&dataSourceName=MyDS"/>
</route>
Incremental Flush
Flush only data newer than a specific date:
<route>
<from uri="direct:flushIncremental"/>
<to uri="pfx-api:flush?dataFeedName=MyFeed&dataSourceName=MyDS&incrementalDate=2026-01-01"/>
</route>
Full Load-Flush Pipeline
A typical DMDS pipeline: truncate the data source, load new data, then flush:
<route>
<from uri="direct:fullDSLoad"/>
<!-- Truncate existing data -->
<to uri="pfx-api:truncate?objectType=DS&targetName=MyDataSource"/>
<!-- Load new data -->
<to uri="pfx-api:loaddata?objectType=DMDS&dsUniqueName=MyDataSource&mapper=dsMapper&businessKeys=sku,region"/>
<!-- Flush to data source -->
<to uri="pfx-api:flush?dataFeedName=MyFeed&dataSourceName=MyDataSource"/>
</route>
Load from File, Flush, and Refresh
<route>
<from uri="file:input/datasource?noop=true"/>
<to uri="pfx-api:loaddataFile?objectType=DMDS&dsUniqueName=MyDataSource&mapper=dsMapper&businessKeys=sku,region&waitForCompletionStrategy=Always"/>
<to uri="pfx-api:flush?dataFeedName=MyFeed&dataSourceName=MyDataSource"/>
<to uri="pfx-api:refresh?targetName=MyDatamart"/>
</route>
Common Pitfalls
-
Forgetting to flush -- This is the most common mistake with DMDS loads. Data loaded via
loaddataorloaddataFilewith objectType=DMDS sits in the data feed until flushed. If you skip the flush, the data source remains unchanged. -
Wrong dataFeedName or dataSourceName -- The names must match exactly what is configured in Pricefx. A typo will cause the flush to fail silently or with an error.
-
Flushing before load completes -- If using
loaddataFilewithwaitForCompletionStrategy=Never, the load may still be in progress when the route reaches the flush step. UsewaitForCompletionStrategy=Alwaysto ensure data is fully loaded before flushing. -
Incremental date format -- The
incrementalDatemust be in a format recognized by Pricefx (typicallyyyyy-MM-dd). Invalid date formats will cause errors. -
Not refreshing after flush -- Flushing moves data to the data source, but the datamart itself may need a refresh (via
pfx-api:refresh) to recalculate derived columns and make data available in analytics.