This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 52c1046c9b82f8ebf089c9f86bf8c485122a3b8f Author: Claus Ibsen <[email protected]> AuthorDate: Tue Feb 17 16:13:32 2026 +0100 CAMEL-16861: Update docs --- .../docs/modules/eips/pages/setProperty-eip.adoc | 60 +++++++++++++++++++-- .../docs/modules/eips/pages/setVariable-eip.adoc | 62 +++++++++++++++++++--- 2 files changed, 111 insertions(+), 11 deletions(-) diff --git a/core/camel-core-engine/src/main/docs/modules/eips/pages/setProperty-eip.adoc b/core/camel-core-engine/src/main/docs/modules/eips/pages/setProperty-eip.adoc index 0229ab217ac6..da2c5ab193c9 100644 --- a/core/camel-core-engine/src/main/docs/modules/eips/pages/setProperty-eip.adoc +++ b/core/camel-core-engine/src/main/docs/modules/eips/pages/setProperty-eip.adoc @@ -50,6 +50,23 @@ XML:: <to uri="direct:b"/> </route> ---- + +YAML:: ++ +[source,yaml] +---- +- route: + from: + uri: direct:a + steps: + - setProperty: + name: myProperty + expression: + constant: + expression: test + - to: + uri: direct:b +---- ==== === Setting an exchange property from another exchange property @@ -81,12 +98,31 @@ XML:: <to uri="direct:b"/> </route> ---- + +YAML:: ++ +[source,yaml] +---- +- route: + from: + uri: direct:a + steps: + - setProperty: + name: foo + expression: + exchangeProperty: + expression: bar + - to: + uri: direct:b +---- ==== === Setting an exchange property with the current message body It is also possible to set an exchange property with a value -from anything on the `Exchange` such as the message body: +from anything on the `Exchange` such as the message body, +where we use the xref:components:languages:simple-language.adoc[Simple] language +to refer to the message body: [tabs] ==== @@ -95,15 +131,12 @@ Java:: [source,java] ---- from("direct:a") - .setProperty("myBody", body()) + .setProperty("myBody", simple("${body}")) .to("direct:b"); ---- XML:: + -We use the xref:components:languages:simple-language.adoc[Simple] language -to refer to the message body: -+ [source,xml] ---- <route> @@ -114,4 +147,21 @@ to refer to the message body: <to uri="direct:b"/> </route> ---- + +YAML:: ++ +[source,yaml] +---- +- route: + from: + uri: direct:a + steps: + - setProperty: + name: myBody + expression: + simple: + expression: "${body}" + - to: + uri: direct:b +---- ==== diff --git a/core/camel-core-engine/src/main/docs/modules/eips/pages/setVariable-eip.adoc b/core/camel-core-engine/src/main/docs/modules/eips/pages/setVariable-eip.adoc index 662658e09569..df6c866a3c2c 100644 --- a/core/camel-core-engine/src/main/docs/modules/eips/pages/setVariable-eip.adoc +++ b/core/camel-core-engine/src/main/docs/modules/eips/pages/setVariable-eip.adoc @@ -47,9 +47,26 @@ XML:: <to uri="direct:b"/> </route> ---- + +YAML:: ++ +[source,yaml] +---- +- route: + from: + uri: direct:a + steps: + - setVariable: + name: myVar + expression: + constant: + expression: test + - to: + uri: direct:b +---- ==== -=== Setting an variable from a message header +=== Setting a variable from a message header You can also set a variable with the value from a message header. @@ -76,12 +93,31 @@ XML:: <to uri="direct:b"/> </route> ---- + +YAML:: ++ +[source,yaml] +---- +- route: + from: + uri: direct:a + steps: + - setVariable: + name: foo + expression: + header: + expression: bar + - to: + uri: direct:b +---- ==== === Setting variable with the current message body It is of course also possible to set a variable with a value -from anything on the `Exchange` such as the message body: +from anything on the `Exchange` such as the message body, +where we use the xref:components:languages:simple-language.adoc[Simple] language +to refer to the message body: [tabs] ==== @@ -90,15 +126,12 @@ Java:: [source,java] ---- from("direct:a") - .setVariable("myBody", body()) + .setVariable("myBody", simple("${body}")) .to("direct:b"); ---- XML:: + -We use the xref:components:languages:simple-language.adoc[Simple] language -to refer to the message body: -+ [source,xml] ---- <route> @@ -109,4 +142,21 @@ to refer to the message body: <to uri="direct:b"/> </route> ---- + +YAML:: ++ +[source,yaml] +---- +- route: + from: + uri: direct:a + steps: + - setVariable: + name: myBody + expression: + simple: + expression: "${body}" + - to: + uri: direct:b +---- ====
