You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/12/30 15:15:06 UTC

(camel) 09/25: CAMEL-19749: Add variables as concept to Camel

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch var
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 23ef6d654bf1d3c3e46733f5fdf0322351040151
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Dec 29 12:45:33 2023 +0100

    CAMEL-19749: Add variables as concept to Camel
---
 .../org/apache/camel/model/removeVariable.xml      | 29 ++++++++++++++++++++++
 .../org/apache/camel/model/setVariable.xml         | 28 +++++++++++++++++++++
 2 files changed, 57 insertions(+)

diff --git a/core/camel-core/src/test/resources/org/apache/camel/model/removeVariable.xml b/core/camel-core/src/test/resources/org/apache/camel/model/removeVariable.xml
new file mode 100644
index 00000000000..cf9f70bb857
--- /dev/null
+++ b/core/camel-core/src/test/resources/org/apache/camel/model/removeVariable.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<routes id="camel" xmlns="http://camel.apache.org/schema/spring">
+  <route>
+    <from uri="seda:a"/>
+    <setVariable name="myBody">
+      <simple>${body}</simple>
+    </setVariable>
+    <to uri="mock:b"/>
+    <removeVariable name="myBody"/>
+  </route>
+</routes>
diff --git a/core/camel-core/src/test/resources/org/apache/camel/model/setVariable.xml b/core/camel-core/src/test/resources/org/apache/camel/model/setVariable.xml
new file mode 100644
index 00000000000..59fc7f8749c
--- /dev/null
+++ b/core/camel-core/src/test/resources/org/apache/camel/model/setVariable.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<routes id="camel" xmlns="http://camel.apache.org/schema/spring">
+  <route>
+    <from uri="seda:a"/>
+    <setVariable name="myBody">
+      <simple>${body}</simple>
+    </setVariable>
+    <to uri="mock:b"/>     
+  </route>
+</routes>