pfx-api:truncate

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

ObjectType (enum)

--

The type of object to truncate: DF (Data Feed), DS (Data Source), or DM (Datamart).

targetName

String

--

The name of the data feed, data source, or Datamart to truncate.

typedId

String

--

The typedId of the target entity. Can be used instead of targetName.

dtoFilter

String

--

Name of a filter bean to apply on the target, limiting which records are truncated.

incrementalDate

String

--

Incremental date to restrict truncation to data loaded on or after this date (format: YYYY-MM-DD).

Either targetName or typedId must be provided to identify the target.


XML Route Examples

Truncate a Data Source (all records)

XML
<route>
    <from uri="direct:truncateDS"/>
    <to uri="pfx-api:truncate?objectType=DS&amp;targetName=MyDataSource"/>
</route>

Truncate a Data Feed with a filter

Apply a filter to truncate only matching records from a data feed:

XML
<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&amp;targetName=MyDataFeed&amp;dtoFilter=myTruncateFilter"/>
</route>

Truncate a Datamart

XML
<route>
    <from uri="direct:truncateDM"/>
    <to uri="pfx-api:truncate?objectType=DM&amp;targetName=MyDatamart"/>
</route>

Truncate with incremental date

Only truncate records loaded on or after the given date:

XML
<route>
    <from uri="direct:truncateIncremental"/>
    <to uri="pfx-api:truncate?objectType=DS&amp;targetName=MyDataSource&amp;incrementalDate=2026-01-01"/>
</route>

Truncate by typedId

XML
<route>
    <from uri="direct:truncateByTypedId"/>
    <to uri="pfx-api:truncate?typedId=5.DMDS"/>
</route>

Common Pitfalls

  • Wrong objectType: Use DS for Data Source, DF for Data Feed, and DM for Datamart. Using the wrong type will result in an error or no-op.

  • Truncate removes all data by default: Without dtoFilter or incrementalDate, truncate will remove all records from the target. Use with caution in production.

  • dtoFilter vs filter: The dtoFilter parameter is specific to truncate and is different from the filter parameter used by fetch/delete. Make sure you reference the correct bean name.

  • targetName resolution: The targetName is resolved to a typedId internally. If the name does not match any existing entity, the operation will fail silently or throw an error.