pfx-api:import
Special Features
Please see these notes (Pricefx staff only).
Properties
Option | Type | Default | Description |
---|---|---|---|
| string | Â | For asynchronous evaluation sets how often the job status will be checked (in milliseconds). |
| string | Â | Sets a timeout for asynchronous evaluation (in milliseconds). |
| string | Â | Defines a connection to Pricefx. |
| string | Â | Defines the Data Source name. |
| string | Â | Defines the type of the object. |
| string | Â | Defines the name in the Pricefx system. If left empty, the name is calculated from the input data. |
| string | Â | Sets the desired name of the local staging file. Can be left empty. If so, the name is concatenated from the input data. |
| Boolean | false | Determines whether to ‘truncate’. |
| Boolean | true | Determines whether to ‘deDuplicate’. |
| string | Â | Defines a mapper which is used to map incoming data. |
| char | , | Defines input delimiter. |
| char | ' | Defines input quote character. |
| char | '' | Defines input escape character. |
| char | (empty string) | Defines input null string. |
| char | /r/n | Defines input record separator. |
| string | Â | List separated by a comma. |
| string | Â | Defines a staging file used for the import command. The staging file must be a valid CSV file which can be processed by the Pricefx core and must be in the GZIP format. |
| Boolean | true | Defines if a staging file provided as a parameter should be deleted after import. |
| Boolean | false | Defines if indexing should be skipped after import. |
Examples
This route shows how to use raw CSV data which requires mapping and compression into the GZIP format.
<route>
<from uri="direct:start"/>
<to uri="pfx-api:import?objectType=DMDS&dsUniqueName=Transactions&fileName=""" + file.name + """*&mapper=myMapper&delimiter=|"/>
<to uri="mock:response"/>
</route>
The next two examples show how to use import without the need to modify input data into the required format. It means that the input is already a CSV file in GZIP format which can be sent to Pricefx. In such case, you do not define the mapper parameter but instead you provide input data as a file in the body or you set the stagingFile
parameter and define path to the file.
// this route will read file from data.directory. File must be valid csv.gzip
<route>
<from uri="file:{{data.directory}}?noop=true"/>
<to uri="pfx-api:import?objectType=DMDS&dsUniqueName=Test"/>
</route>
// this route will read file from staging-file path. File must be valid csv.gzip
<route>
<from uri="timer://foo?repeatCount=1"/>
<to uri="pfx-api:import?objectType=DMDS&dsUniqueName=Test&stagingFile={{staging-file}}"/>
</route>
Full Process Example
We have a data file price_fx_calc_art_with_header_and_date_and_null_values_and_quoted.csv in a custom format:
Route:
Mapper:
The staged file is created (format according to internal Pricefx requirements https://pricefx.atlassian.net/wiki/spaces/EN/pages/2808709224):
The data will be loaded into Pricefx.
IntegrationManager version 5.8.0