pfx-api:loaddata

Bulk loads data into the partition.

Properties

Option

Type

Default

Description

Option

Type

Default

Description

typedId

string

 

Defines typedId of the Pricefx entity.

mapper

string

 

Defines a mapper name which is a Spring bean or definition in the header or property.

objectType

object

 

Defines the object type. Possible values are listed at Type Codes.

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.

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 an expression value (groovy, simple, constant).

enableNullFields

Boolean

false

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

pricingParameterName

string

 

Defines the Price Parameter name for lookup table values.

detectJoinFields

Boolean

 

Defines whether join fields definitions should be taken from the server. 

filter

string

 

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

businessKeys

string

 

Defines the business key.

businessKeysMaxLengths

string

 

Defines the maximum length of business keys. Provide here a comma-separated list where the number of values must be the same as number of business keys. Sum of lengths must be less than or equal to 1024.

truncate

Boolean

false

Defines if truncate should be used for the import command.

deDuplicate

Boolean

true

Defines if deDuplicate should be used for the import command.

dsUniqueName

string

 

Defines dsUniqueName for Datamarts. 

direct2ds

string

 

 

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

loaddata with businessKeys

The following code describes how businessKeys and businessKeysMaxLengths can be used in the loaddata command:

<loadMapper id="carsMapper" includeUnmappedProperties="false"> <simple in="sku" out="13"/> <simple in="manufacturer" out="bmw"/> </loadMapper> <routes xmlns="http://camel.apache.org/schema/spring"> <routes> <from uri="direct:create"/> <to uri="pfx-api:loaddata?mapper=carsMapper&amp;objectType=PX&amp;businessKeys=sku,name,attribute1&amp;businessKeysMaxLengths=255,255"/> <log message="Done"/> </route> </routes>

loaddata with businessKeys of Different Type than String

It is not possible to define length for a business key type other than string. If you want to use non-string business key, put a wildcard character * to the business key length definition:

<loadMapper id="carsMapper" includeUnmappedProperties="false"> <simple in="sku" out="13"/> <simple in="manufacturer" out="bmw"/> <body in="infoDate" out="infoDate"/> </loadMapper> <routes xmlns="http://camel.apache.org/schema/spring"> <routes> <from uri="direct:create"/> <to uri="pfx-api:loaddata?mapper=carsMapper&amp;objectType=PX&amp;businessKeys=sku,infoDate,name&amp;businessKeysMaxLengths=255,*,255"/> <log message="Done"/> </route> </routes>

When the wildcard character is used, the length cannot be computed beforehand, thus you might receive this error: "Business key validation failed: Calculated business key length XXX exceeds the database limit YYY. Please consider using maxJoinFieldsLengths”. You need to handle such error by yourself.

For more details see the Knowledge Base article Loaddata and Business Key Length.

loaddata to Condition Records

For a load of condition records you need to use objectType CRCP and conditionRecordSetName or conditionRecordSetId.

<loadMapper id="conditionRecordsMapper"> <constant expression="test" out="conditionRecordSetName"/> <!-- <constant expression="8" out="conditionRecordSetId"/>--> <body in="key1" out="key1"/> <body in="validFrom" out="validFrom"/> <body in="validTo" out="validTo"/> <body in="conditionValue" out="conditionValue"/> <body in="unitOfMeasure" out="unitOfMeasure"/> <body in="currency" out="currency"/> <body in="attribute1" out="attribute1"/> </loadMapper> <route id="loadConditionRecordsTestRoute"> <from uri="file:{{data.directory}}/import/condition-records?noop=true"/> <to uri="pfx-csv:unmarshal?skipHeaderRecord=true"/> <to uri="pfx-api:loaddata?objectType=CRCP&amp;mapper=conditionRecordsMapper"/> </route>

IntegrationManager version 5.8.0