pfx-api:truncate
Truncate (remove all data from) a data feed, data source, or Datamart in Pricefx. Optionally filter which records to truncate using dtoFilter or limit by incrementalDate.
Parameters
|
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
ObjectType (enum) |
-- |
The type of object to truncate: |
|
|
String |
-- |
The name of the data feed, data source, or Datamart to truncate. |
|
|
String |
-- |
The typedId of the target entity. Can be used instead of |
|
|
String |
-- |
Name of a filter bean to apply on the target, limiting which records are truncated. |
|
|
String |
-- |
Incremental date to restrict truncation to data loaded on or after this date (format: |
Either targetName or typedId must be provided to identify the target.
XML Route Examples
Truncate a Data Source (all records)
<route>
<from uri="direct:truncateDS"/>
<to uri="pfx-api:truncate?objectType=DS&targetName=MyDataSource"/>
</route>
Truncate a Data Feed with a filter
Apply a filter to truncate only matching records from a data feed:
<pfx:filter id="myTruncateFilter">
<pfx:and>
<pfx:criterion fieldName="region" operator="equals" value="EMEA"/>
</pfx:and>
</pfx:filter>
<route>
<from uri="direct:truncateDF"/>
<to uri="pfx-api:truncate?objectType=DF&targetName=MyDataFeed&dtoFilter=myTruncateFilter"/>
</route>
Truncate a Datamart
<route>
<from uri="direct:truncateDM"/>
<to uri="pfx-api:truncate?objectType=DM&targetName=MyDatamart"/>
</route>
Truncate with incremental date
Only truncate records loaded on or after the given date:
<route>
<from uri="direct:truncateIncremental"/>
<to uri="pfx-api:truncate?objectType=DS&targetName=MyDataSource&incrementalDate=2026-01-01"/>
</route>
Truncate by typedId
<route>
<from uri="direct:truncateByTypedId"/>
<to uri="pfx-api:truncate?typedId=5.DMDS"/>
</route>
Common Pitfalls
-
Wrong objectType: Use
DSfor Data Source,DFfor Data Feed, andDMfor Datamart. Using the wrong type will result in an error or no-op. -
Truncate removes all data by default: Without
dtoFilterorincrementalDate, truncate will remove all records from the target. Use with caution in production. -
dtoFilter vs filter: The
dtoFilterparameter is specific to truncate and is different from thefilterparameter used by fetch/delete. Make sure you reference the correct bean name. -
targetName resolution: The
targetNameis resolved to atypedIdinternally. If the name does not match any existing entity, the operation will fail silently or throw an error.