Skip to main content

Set Context

Set Context is used to add a header to the message or to define a property or to change the content of the message. When adding a Header or Property, it is important to specify the value type. While the Constant option is used to add a fixed value, the Expression option is used to get the value from Camel Exchange, XPath from XML, Header from message headers, Property from message properties, and JSONPath from JSON.

https://usemip.com/flow/design

If header is defined with Set Context, these values are added as HTTP Header.

If property is defined, this becomes the variable defined during the whole flow. After the property is defined, it can be used as ${exchangeProperty.propertyName} in connectors.

If a value is written in the Body textarea section in the Change Context tab, the current input is the value written in this field. The value written in this field can be defined as expression. If you want to change the value with expression, the Use Simple Query box should be checked.

Parameters of Context Header;

FieldDescription
NameName of header.
TypeConstant/XPath/JSONPath/Expression/Header/Property
ValueIt depends on header type.

Parameters of Context Property;

FieldDescription
NameName of property.
TypeConstant/XPath/JSONPath/Expression/Header/Property
ValueIt depends on property type.

Parameters of Change Context;

FieldDescription
Use Simple QueryIf it is wanted to change the body with expression, it should be checked.
BodyBody value. If Use Simple Query checked, Constant and Expression values can be used together. Example : name is : ${exchangeProperty.name}