pfx-api:fetch

Fetches items. It is used for many object types (P, PX, C, CX, DS,…).

Properties

Option

Type

Default

Description

Option

Type

Default

Description

typedId

string

 

Defines typedId of the Pricefx entity.

valueFields

string

 

Specifies one or more fields (strings separated by a comma) to be returned. Only these fields are fetched by the server from the database, so it generally gives a better performance. The result object is sent as a list of fields (instead of a Map; compare with resultFields).

If omitted, all fields are returned.

sql

string

 

Optional parameter which can be used instead of the PfxApiConfigurationfilter link. Accepts an SQL-like syntax to define a filter logic. For example: 'SELECT a WHERE b 1 ORDER BY a ASC'

The FROM clause has to be omitted – it has no meaning in the filter API.

output

object

 

Defines the output type for data from the server. Possible values: JSON, EXCEL, CSV, PDF, JSON_DETAIL, PDF_DETAIL, EXCEL_DETAIL.

pricingParameterId

string

 

Defines the Price Parameter ID.

countOnly

Boolean

 

Defines if fetch should return only count or also data.

connection

string

 

Defines connection to Pricefx. This is an optional parameter and if it is omitted, the connection is taken from the Spring bean named pricefx.

sortBy

string

 

Defines the sorting. It overrides sortBy from a filter. Allows expression value (groovy, simple, constant).

enableNullFields

Boolean

false

Defines if during fetch null fields should be returned via REST API back to a client. 

resultFields

string

 

Specifies one or more fields (strings separated by a comma) to be returned (but the server still fetches all the fields from the database). The result object is sent as a Map (compare with valueFields).

If omitted, all fields are returned.

batchedMode

Boolean

 

Determines if the batched mode is used for fetching big data tables.

pricingParameterName

string

 

Defines the Price Parameter name for lookup table values.

startRow

integer

 

Defines a start row for the fetch command.

endRow

integer

 

Defines an end row for the fetch command.

priceListId

string

 

Defines the price list to read. Use the typedId parameter instead.

priceListItemId

string

 

Defines Pricelist Item ID.

dsUniqueName

string

 

Defines dsUniqueName for Datamarts. 

quoteUniqueName

string

 

Defines quoteUniqueName for Quote API.

dcrUniqueName

string

 

Defines dcrUniqueName for Data Change Request API.

filter

string

 

Defines the name of a filter used by the fetch or delete commands.

customFilterExpression

string

 

Defines a custom filter expression. It allows for more advanced filtering, for example customFilterExpression=attribute1>attribute2 filters all rows where the value in the attribute1 column is greater than values in the attribute2 column.

Examples

The following code describes how to use the fetch method.

<route> <from uri="direct:start"/> <to uri="pfx-api:fetch?objectType=P&amp;batchedMode=true&amp;batchSize=100&amp;sortBy=sku&amp;filter=filter"/> </route>
<route> <from uri="direct:start"/> <to uri="pfx-api:fetch?filter=myFilter2&amp;objectType=P&amp;connection=pricefx3&amp;resultFields=sku,attribute3,attribute6"/> </route>

Fetch Conditional Records

For fetching conditional records it is important to use the correct objectType. It depends on the number of key attributes which should be between CRCI1-12 and correct conditionalRecordSetId.

<filter id="conditionRecordsTestFilter"> <and> <criterion fieldName="conditionRecordSetId" operator="equals" value="8"/> </and> </filter> <route id="exportConditionRecordsTestRoute"> <from uri="timer://runOnce?repeatCount=1&amp;delay=5000"/> <to uri="pfx-api:fetch?objectType=CRCI1&amp;filter=conditionRecordsTestFilter"/> <log message="${body}"/> </route>

IntegrationManager version 5.8.0