pfx-api:execute
Execute a Pricefx formula. Formulas are server-side logic units that can be invoked by SKU or formula name.
URI Format
pfx-api:execute?param1=value1¶m2=value2
Parameters
|
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
sku |
String |
-- |
SKU to execute the formula against. Either sku or formulaName must be provided |
|
formulaName |
String |
-- |
Name of the formula to execute. Either formulaName or sku must be provided |
|
mapper |
String |
-- |
Name of the mapper bean used to transform data before sending to Pricefx |
XML Route Examples
Execute a formula by name
<route>
<from uri="direct:executeFormula"/>
<to uri="pfx-api:execute?formulaName=MyFormula"/>
</route>
Execute a formula for a specific SKU
<route>
<from uri="direct:executeForSku"/>
<to uri="pfx-api:execute?sku=PROD-001"/>
</route>
Execute a formula with a mapper
<route>
<from uri="direct:executeWithMapper"/>
<to uri="pfx-api:execute?formulaName=MyFormula&mapper=formulaInputMapper"/>
</route>
Execute a formula with both SKU and name
<route>
<from uri="direct:executeFormulaFull"/>
<to uri="pfx-api:execute?formulaName=PriceCalculation&sku=PROD-001&mapper=formulaMapper"/>
</route>
Common Pitfalls
-
sku or formulaName required: At least one of
skuorformulaNamemust be provided. Without either, the component does not know which formula to execute. -
Mapper usage: The
mapperparameter is optional but useful when the formula expects structured input. The mapper transforms the exchange body before sending it to the Pricefx API. -
Formula must exist on server: The formula identified by
formulaNameorskumust already exist in the Pricefx partition. A missing formula will result in an API error. -
Return value: The formula execution result is placed in the exchange body. The structure of the result depends on the formula implementation on the Pricefx side.