pfx-api:massedit

With this method, the whole response from the API is returned. You can change the target of the response in outputTarget (body, header, property) and outputtargetName (name for header, property).

Properties

Option

Type

Default

Description

Option

Type

Default

Description

outputTarget

string

 

Defines output target for data in the exchange. It can be stored in the header, property or body.

outputTargetName

string

 

Defines output target name for the target type header and property. Put here the name of exchange header and name of exchange property.

massEditFields

string

 

Defines fields for mass edit, separated by a semicolon.

dataSourceName

string

 

Name of the Data Source.

objectType

string

 

Defines the object type, e.g. DM, DMDS, Q, LTV, P, PX.

mapper

string

 

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

valueFields

string

 

Contains strings separated by a comma that specify one or more fields to be returned. If omitted, all fields are returned. The server fetches only these valueFields from the database, so it generally gives a better performance. The result object is then sent as a list of fields instead of a Map. Compare with resultFields.

resultFields

string

 

Contains strings separated by a comma that specify one or more fields to be returned. If omitted, all fields are returned. But the server still fetches all the fields from the database. The result object is sent as a Map. Compare with valueFields.

sql

string

 

Optional parameter. Can be used instead of a regular table filter. Accepts an SQL-like syntax to define a filter logic.

Example: 'SELECT a WHERE b < 1 OR a <= 3 AND x > 1 ORDER BY a ASC'

The From clause has to be omitted – it has no meaning in filter API.

connection

string

 

Defines connection to Pricefx. This is an optional parameter and if it is not mentioned, the connection is taken from the Spring bean named pricefx.

pricingParameterName

string

 

 

pricingParameterId

integer

 

 

mapper

string

 

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

filter

string

 

Defines the sorting. It overrides sortBy from a filter. Allows expression value (groovy, simple, constant).

sortBy

sting

 

Sort by. It overrides sortBy from a filter.

customFilterExpression

string

 

Defines a custom filter expression. It allows for more advanced filtering, for example customFilterExpression=attribute1&gt;attribute2 filters all rows where the value in the attribute1 column is greater than values in the attribute2 column.

Examples

Defining Fields

Fields are defined by the parameter massEditFields of pfx-api:massedit. The format is following: fields are separated by , and pairs name/value are separated by ;.

Example:

<to uri="pfx-api:massedit?massEditFields=attribute40;Y&amp;mapper=carsMapper&amp;filter=pxCarsFilter&amp;objectType=CX"/> to define a field attribute40 with a value Y

<to uri="pfx-api:massedit?massEditFields=attribute40;Y,attribute41;N&amp;mapper=carsMapper&amp;filter=pxCarsFilter&amp;objectType=CX"/> to define fields attribute40 with a value Y and attribute41 with a value N

Datamart massedit Example

<route> <from uri="direct:create5"/> <toD uri="pfx-api:massedit?datasourceName=Accruals&amp;massEditFields=DateSent;${headers.exportDate}&amp;filter=fetchAccrualsUpdateFilter&amp;objectType=DM"/> </route>

You can either set directly the parameter typedId, or you can set datasourceName. If you pick the latter, there will be one more call to the partition to get typedId from datasourceName. Otherwise, the mass edit functionality is the same.

Standard massedit Example

<loadMapper id="carsMapper" includeUnmappedProperties="false"> <simple in="sku" out="13"/> <simple in="manufacturer" out="bmw"/> </loadMapper> <filter id="pxCarsFilter"> <and> <criterion fieldName="name" operator="equals" value="Cars"/> </and> </filter> <routes xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="direct:create"/> <to uri="pfx-api:massedit?mapper=carsMapper&amp;filter=pxCarsFilter&amp;objectType=CX"/> <to uri="mock:res"/> </route> </routes>

 

IntegrationManager version 5.8.0