pfx-api:loaddata
Bulk loads data into the partition.
Properties
Option | Type | Default | Description |
---|---|---|---|
| string |
| Defines |
| string |
| Defines a mapper name which is a Spring bean or definition in the header or property. |
| object |
| Defines the object type. Possible values are listed at Type Codes. |
| 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. |
| 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 |
| Defines the Price Parameter name for lookup table values. |
| Boolean |
| Defines whether join fields definitions should be taken from the server. |
| string |
| Defines the name of a filter used by the fetch or delete commands. |
| string |
| Defines the business key. |
| 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. |
| Boolean | false | Defines if truncate should be used for the import command. |
| Boolean | true | Defines if deDuplicate should be used for the import command. |
| string |
| Defines |
| string |
|
|
| string |
| Defines a custom filter expression. It allows for more advanced filtering, for example |
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&objectType=PX&businessKeys=sku,name,attribute1&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&objectType=PX&businessKeys=sku,infoDate,name&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&mapper=conditionRecordsMapper"/>
</route>
IntegrationManager version 5.8.0