pfx-api:import

Special Features

Please see these notes (Pricefx staff only).

Properties

Option

Type

Default

Description

Option

Type

Default

Description

outputTarget

string

 

For asynchronous evaluation sets how often the job status will be checked (in milliseconds).

outputTargetName

string

 

Sets a timeout for asynchronous evaluation (in milliseconds).

connection

string

 

Defines a connection to Pricefx.

dsUniqueName

string

 

Defines the Data Source name.

objectType

string

 

Defines the type of the object.

targetName

string

 

Defines the name in the Pricefx system. If left empty, the name is calculated from the input data.

fileName

string

 

Sets the desired name of the local staging file. Can be left empty. If so, the name is concatenated from the input data.

truncate

Boolean

false

Determines whether to ‘truncate’.

deDuplicate

Boolean

true

Determines whether to ‘deDuplicate’.

mapper

string

 

Defines a mapper which is used to map incoming data.

delimiter

char

,

Defines input delimiter.

quoteChar

char

'

Defines input quote character.

escapeChar

char

''

Defines input escape character.

nullValue

char

(empty string)

Defines input null string.

eol

char

/r/n

Defines input record separator.

headers

string

 

List separated by a comma.

stagingFile (since 4.7.0)

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.

deleteStagingFileAfterImport (since 4.7.0)

Boolean

true

Defines if a staging file provided as a parameter should be deleted after import.

skipIndexing (since 4.10.0)

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&amp;dsUniqueName=Transactions&amp;fileName=""" + file.name + """*&amp;mapper=myMapper&amp;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&amp;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&amp;dsUniqueName=Test&amp;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