Sets an exchange property to a constant string or a computed value. Unlike a header or the body, a property is not sent to the client; it is only readable by later interceptors in the same exchange, e.g. as
${property.name} in a template or another expression. The value is evaluated as a SpEL template, Groovy, JsonPath, or XPath expression, defaulting to SpEL. See tutorials/orchestration/30-Orchestration.yaml.
Example Configuration Copy api : port : 2000 flow : - setProperty : name : product value : ${ $.product_id} language : jsonpath - call : url : https: //api.predic8.de/shop/v2/products/${ property.product}
api:
port: 2000
flow:
- setProperty:
name: product
value: ${$.product_id}
language: jsonpath
- call:
url: https://api.predic8.de/shop/v2/products/${property.product}
Syntax Copy setProperty : '$ref' : <string> failOnError : <boolean> ifAbsent : <boolean> language : groovy name : <string> value : <string> xmlConfig : { }
setProperty:
'$ref': <string>
failOnError: <boolean>
ifAbsent: <boolean>
language: groovy
name: <string>
value: <string>
xmlConfig: {}
Attributes Name Required Default Description Examples $ref false - Reference a component defined under components . - failOnError false true When true, aborts processing if expression evaluation fails. When false, logs the error and continues unchanged. false ifAbsent false false When true, only sets the field if it is not already present in the message. true language false SpEL Scripting language used to evaluate the value expression. SpEL | groovy | jsonpath | xpath name false - Name of the header field or exchange property key to set. X-Powered-By value false - Value to assign, evaluated as a SpEL template expression by default. Use the language attribute to switch to Groovy, JsonPath, or XPath. ${method}
Child Structure Element Cardinality Description xmlConfig 0..1 XML namespace declarations for XPath expressions in the value.
Can be used in