pfx-api:fetch
Fetches items. It is used for many object types (P, PX, C, CX, DS,…).
Properties
Option | Type | Default | Description |
---|---|---|---|
| string | Â | Defines |
| 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 If omitted, all fields are returned. |
| string |  | Optional parameter which can be used instead of the The FROM clause has to be omitted – it has no meaning in the filter API. |
| object | Â | Defines the output type for data from the server. Possible values: JSON, EXCEL, CSV, PDF, JSON_DETAIL, PDF_DETAIL, EXCEL_DETAIL. |
| string | Â | Defines the Price Parameter ID. |
| Boolean | Â | Defines if fetch should return only count or also data. |
| 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. |
| string | Â | Defines the sorting. It overrides |
| Boolean | false | Defines if during fetch null fields should be returned via REST API back to a client. |
| 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 If omitted, all fields are returned. |
| Boolean | Â | Determines if the batched mode is used for fetching big data tables. |
| string | Â | Defines the Price Parameter name for lookup table values. |
| integer | Â | Defines a start row for the fetch command. |
| integer | Â | Defines an end row for the fetch command. |
| string | Â | Defines the price list to read. Use the |
| string | Â | Defines Pricelist Item ID. |
| string | Â | Defines |
| string |  | Defines |
| string |  | Defines |
| string | Â | Defines the name of a filter used by the fetch or delete commands. |
| string | Â | Defines a custom filter expression. It allows for more advanced filtering, for example |
Examples
The following code describes how to use the fetch
method.
<route>
<from uri="direct:start"/>
<to uri="pfx-api:fetch?objectType=P&batchedMode=true&batchSize=100&sortBy=sku&filter=filter"/>
</route>
<route>
<from uri="direct:start"/>
<to uri="pfx-api:fetch?filter=myFilter2&objectType=P&connection=pricefx3&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&delay=5000"/>
<to uri="pfx-api:fetch?objectType=CRCI1&filter=conditionRecordsTestFilter"/>
<log message="${body}"/>
</route>
IntegrationManager version 5.8.0