pfx-api:delete

pfx-api:delete

Delete records from Pricefx by filter criteria, by a single typedId, or by a list of typedId values. Supports asynchronous execution for long-running deletes.


Parameters

Parameter

Type

Default

Description

objectType

ObjectType (enum)

--

The Pricefx object type to delete from (e.g., P, C, PL, PX, CX, etc.).

filter

String

--

Name of the filter bean used to select records for deletion.

typedId

String

--

The typedId of a single record to delete (e.g., 123.PL).

typedIdList

String

--

Comma-separated list of typedIds for batch deletion.

async

Boolean

false

Run the delete operation asynchronously. The route will poll for completion.

asyncTimeout

Integer

30000

Timeout in milliseconds for async operations.

asyncRetry

Integer

10000

Retry/poll interval in milliseconds for checking async job status.

You must provide exactly one of filter, typedId, or typedIdList to identify which records to delete.


XML Route Examples

Delete by filter

Define a filter bean and reference it from the route:

XML
<pfx:filter id="deleteFilter">
    <pfx:and>
        <pfx:criterion fieldName="attribute1" operator="equals" value="OBSOLETE"/>
    </pfx:and>
</pfx:filter>

<route>
    <from uri="direct:deleteByFilter"/>
    <to uri="pfx-api:delete?objectType=P&amp;filter=deleteFilter"/>
</route>

Delete by typedId (synchronous)

XML
<route>
    <from uri="direct:deleteById"/>
    <to uri="pfx-api:delete?objectType=PL&amp;typedId=123.PL"/>
</route>

Delete by typedId (asynchronous)

Use async mode for long-running deletes. The component will poll for completion using asyncRetry as the poll interval, up to asyncTimeout:

XML
<route>
    <from uri="direct:deleteByIdAsync"/>
    <to uri="pfx-api:delete?objectType=PL&amp;typedId=123.PL&amp;async=true&amp;asyncTimeout=60000&amp;asyncRetry=5000"/>
</route>

Delete multiple records by typedIdList

XML
<route>
    <from uri="direct:deleteMultiple"/>
    <to uri="pfx-api:delete?objectType=P&amp;typedIdList=1.P,2.P,3.P"/>
</route>

Common Pitfalls

  • Missing target: You must specify one of filter, typedId, or typedIdList. If none are provided, the operation will fail.

  • Async timeout too short: The default asyncTimeout is 30 seconds. For large deletes, increase this value or the operation may appear to fail even though it is still running on the server.

  • Filter deletes all matching records: Double-check your filter criteria before running delete in production. There is no undo.

  • Object type mismatch: The typedId suffix must match the objectType (e.g., 123.PL with objectType=PL).