You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bu...@apache.org on 2016/09/13 17:20:59 UTC
svn commit: r997316 [1/5] - in /websites/production/camel/content: ./ cache/
Author: buildbot
Date: Tue Sep 13 17:20:59 2016
New Revision: 997316
Log:
Production update by buildbot for camel
Modified:
websites/production/camel/content/bean-language.html
websites/production/camel/content/beanshell.html
websites/production/camel/content/book-in-one-page.html
websites/production/camel/content/book-languages-appendix.html
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/constant.html
websites/production/camel/content/exchangeproperty.html
websites/production/camel/content/file-language.html
websites/production/camel/content/groovy.html
websites/production/camel/content/javascript.html
websites/production/camel/content/php.html
websites/production/camel/content/python.html
websites/production/camel/content/ruby.html
websites/production/camel/content/scripting-languages-context.html
websites/production/camel/content/scripting-languages.html
Modified: websites/production/camel/content/bean-language.html
==============================================================================
--- websites/production/camel/content/bean-language.html (original)
+++ websites/production/camel/content/bean-language.html Tue Sep 13 17:20:59 2016
@@ -85,12 +85,12 @@
<tbody>
<tr>
<td valign="top" width="100%">
-<div class="wiki-content maincontent"><h2 id="BeanLanguage-BeanLanguage">Bean Language</h2><p>The purpose of the Bean Language is to be able to implement an <a shape="rect" href="expression.html">Expression</a> or <a shape="rect" href="predicate.html">Predicate</a> using a simple method on a bean.</p><p>So the idea is you specify a bean name which will then be resolved in the <a shape="rect" href="registry.html">Registry</a> such as the <a shape="rect" href="spring.html">Spring</a> ApplicationContext then a method is invoked to evaluate the <a shape="rect" href="expression.html">Expression</a> or <a shape="rect" href="predicate.html">Predicate</a>.</p><p>If no method name is provided then one is attempted to be chosen using the rules for <a shape="rect" href="bean-binding.html">Bean Binding</a>; using the type of the message body and using any annotations on the bean methods.</p><p>The <a shape="rect" href="bean-binding.html">Bean Binding</a> rules are used to bind the <a shape="rec
t" href="message.html">Message</a> Exchange to the method parameters; so you can annotate the bean to extract headers or other expressions such as <a shape="rect" href="xpath.html">XPath</a> or <a shape="rect" href="xquery.html">XQuery</a> from the message.</p><h3 id="BeanLanguage-UsingBeanExpressionsfromtheJavaDSL">Using Bean Expressions from the Java DSL</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from("activemq:topic:OrdersTopic").
- filter().method("myBean", "isGoldCustomer").
- to("activemq:BigSpendersQueue");
+<div class="wiki-content maincontent"><h2 id="BeanLanguage-BeanLanguage">Bean Language</h2><p>The purpose of the Bean Language is to be able to implement an <a shape="rect" href="expression.html">Expression</a> or <a shape="rect" href="predicate.html">Predicate</a> using a simple method on a bean. The bean name is resolved using a <a shape="rect" href="registry.html">Registry</a>, such as the <a shape="rect" href="spring.html">Spring</a> <strong><code>ApplicationContext</code></strong>, then a method is invoked to evaluate the <a shape="rect" href="expression.html">Expression</a> or <a shape="rect" href="predicate.html">Predicate</a>. If no method name is provided then one is chosen using the rules for <a shape="rect" href="bean-binding.html">Bean Binding</a>; using the type of the message body and using any annotations on the bean methods.</p><p>The <a shape="rect" href="bean-binding.html">Bean Binding</a> rules are used to bind the <a shape="rect" href="message.html">Message<
/a> Exchange to the method parameters; so you can annotate the bean to extract headers or other expressions such as <a shape="rect" href="xpath.html">XPath</a> or <a shape="rect" href="xquery.html">XQuery</a> from the message.</p><h3 id="BeanLanguage-UsingBeanExpressionsinJava">Using Bean Expressions in Java</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from("activemq:topic:OrdersTopic")
+ .filter().method("myBean", "isGoldCustomer")
+ .to("activemq:BigSpendersQueue");
]]></script>
-</div></div><h3 id="BeanLanguage-UsingBeanExpressionsfromXML">Using Bean Expressions from XML</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BeanLanguage-UsingBeanExpressionsinSpringXML">Using Bean Expressions in Spring XML</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<route>
<from uri="activemq:topic:OrdersTopic"/>
<filter>
@@ -99,46 +99,46 @@
</filter>
</route>
]]></script>
-</div></div><div class="confluence-information-macro confluence-information-macro-tip"><p class="title">Bean attribute now deprecated</p><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>Note, the <code>bean</code> attribute of the method expression element is now deprecated. You should now make use of <code>ref</code> attribute instead.</p></div></div><h3 id="BeanLanguage-Writingtheexpressionbean">Writing the expression bean</h3><p>The bean in the above examples is just any old Java Bean with a method called isGoldCustomer() that returns some object that is easily converted to a <strong>boolean</strong> value in this case, as its used as a predicate.</p><p>So we could implement it like this...</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><div class="confluence-information-macro confluence-information-macro-warning"><p class="title">Bean Attribute Now Deprecated</p><span class="aui-icon aui-icon-small aui-iconfont-error confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>The <strong><code>bean</code></strong> attribute of the method expression element is now deprecated. Use the <strong><code>ref</code></strong> attribute instead.</p></div></div><h3 id="BeanLanguage-WritingtheExpressionBean">Writing the Expression Bean</h3><p>The bean in the above examples is just any old Java Bean with a method called <strong><code>isGoldCustomer()</code></strong> that returns some object that is easily converted to a <strong><code>boolean</code></strong> value in this case, as its used as a predicate.</p><p>Example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[public class MyBean {
public boolean isGoldCustomer(Exchange exchange) {
- ...
+ // ...
}
}
]]></script>
-</div></div><p>We can also use the <a shape="rect" href="bean-integration.html">Bean Integration</a> annotations. For example you could do...</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>We can also use the <a shape="rect" href="bean-integration.html">Bean Integration</a> annotations.</p><p>Example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[public boolean isGoldCustomer(String body) {...}
]]></script>
</div></div><p>or</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[public boolean isGoldCustomer(@Header(name = "foo") Integer fooHeader) {...}
]]></script>
-</div></div><p>So you can bind parameters of the method to the Exchange, the <a shape="rect" href="message.html">Message</a> or individual headers, properties, the body or other expressions.</p><h3 id="BeanLanguage-Nonregistrybeans">Non registry beans</h3><p>The <a shape="rect" href="bean-language.html">Bean Language</a> also supports invoking beans that isn't registered in the <a shape="rect" href="registry.html">Registry</a>. This is usable for quickly to invoke a bean from Java DSL where you don't need to register the bean in the <a shape="rect" href="registry.html">Registry</a> such as the <a shape="rect" href="spring.html">Spring</a> ApplicationContext.</p><p>Camel can instantiate the bean and invoke the method if given a class or invoke an already existing instance. This is illustrated from the example below:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ from("activemq:topic:OrdersTopic").
- filter().expression(BeanLanguage(MyBean.class, "isGoldCustomer")).
- to("activemq:BigSpendersQueue");
+</div></div><p>So you can bind parameters of the method to the Exchange, the <a shape="rect" href="message.html">Message</a> or individual headers, properties, the body or other expressions.</p><h3 id="BeanLanguage-Non-RegistryBeans">Non-Registry Beans</h3><p>The <a shape="rect" href="bean-language.html">Bean Language</a> also supports invoking beans that isn't registered in the <a shape="rect" href="registry.html">Registry</a>. This is usable for quickly to invoke a bean from Java DSL where you don't need to register the bean in the <a shape="rect" href="registry.html">Registry</a> such as the <a shape="rect" href="spring.html">Spring</a> <strong><code>ApplicationContext</code></strong>. Camel can instantiate the bean and invoke the method if given a class or invoke an already existing instance.</p><p>Example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from("activemq:topic:OrdersTopic")
+ .filter().expression(BeanLanguage(MyBean.class, "isGoldCustomer"))
+ .to("activemq:BigSpendersQueue");
]]></script>
-</div></div><p>The 2nd parameter <code>isGoldCustomer</code> is an optional parameter to explicit set the method name to invoke. If not provided Camel will try to invoke the best suited method. If case of ambiguity Camel will thrown an Exception. In these situations the 2nd parameter can solve this problem. Also the code is more readable if the method name is provided. The 1st parameter can also be an existing instance of a Bean such as:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ private MyBean my;
+</div></div><p>The 2nd parameter <strong><code>isGoldCustomer</code></strong> is an optional parameter to explicit set the method name to invoke. If not provided Camel will try to invoke the most suitable method. If case of ambiguity Camel will thrown an Exception. In these situations the 2nd parameter can solve this problem. Also the code is more readable if the method name is provided. The 1st parameter can also be an existing instance of a Bean such as:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[private MyBean my;
- from("activemq:topic:OrdersTopic").
- filter().expression(BeanLanguage.bean(my, "isGoldCustomer")).
- to("activemq:BigSpendersQueue");
+from("activemq:topic:OrdersTopic")
+ .filter().expression(BeanLanguage.bean(my, "isGoldCustomer"))
+ .to("activemq:BigSpendersQueue");
]]></script>
-</div></div><p>In Camel 2.2 onwards you can avoid the <code>BeanLanguage</code> and have it just as:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ private MyBean my;
+</div></div><p>In <strong>Camel 2.2</strong>: you can avoid the <strong><code>BeanLanguage</code></strong> and have it just as:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[private MyBean my;
- from("activemq:topic:OrdersTopic").
- filter().expression(bean(my, "isGoldCustomer")).
- to("activemq:BigSpendersQueue");
+from("activemq:topic:OrdersTopic")
+ .filter().expression(bean(my, "isGoldCustomer"))
+ .to("activemq:BigSpendersQueue");
]]></script>
</div></div><p>Which also can be done in a bit shorter and nice way:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ private MyBean my;
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[private MyBean my;
- from("activemq:topic:OrdersTopic").
- filter().method(my, "isGoldCustomer").
- to("activemq:BigSpendersQueue");
+from("activemq:topic:OrdersTopic")
+ .filter().method(my, "isGoldCustomer")
+ .to("activemq:BigSpendersQueue");
]]></script>
-</div></div><h3 id="BeanLanguage-Otherexamples">Other examples</h3><p>We have some test cases you can look at if it'll help</p><ul><li><a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/MethodFilterTest.java">MethodFilterTest </a> is a JUnit test case showing the Java <a shape="rect" href="dsl.html">DSL</a> use of the bean expression being used in a filter</li><li><a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/aggregator.xml">aggregator.xml</a> is a Spring XML test case for the <a shape="rect" href="aggregator.html">Aggregator</a> which uses a bean method call to test for the completion of the aggregation.</li></ul><h3 id="BeanLanguage-Dependencies">Dependencies</h3><p>The Bean language is part of <strong>camel-core</strong>.</p></div>
+</div></div><h3 id="BeanLanguage-OtherExamples">Other Examples</h3><p>We have some test cases you can look at if it'll help</p><ul><li><a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/MethodFilterTest.java">MethodFilterTest </a> is a JUnit test case showing the Java <a shape="rect" href="dsl.html">DSL</a> use of the bean expression being used in a filter</li><li><a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/aggregator.xml">aggregator.xml</a> is a Spring XML test case for the <a shape="rect" href="aggregator.html">Aggregator</a> which uses a bean method call to test for the completion of the aggregation.</li></ul><h3 id="BeanLanguage-Dependencies">Dependencies</h3><p>The Bean language is part of <strong><code>camel-core</code></strong>.</p></div>
</td>
<td valign="top">
<div class="navigation">
Modified: websites/production/camel/content/beanshell.html
==============================================================================
--- websites/production/camel/content/beanshell.html (original)
+++ websites/production/camel/content/beanshell.html Tue Sep 13 17:20:59 2016
@@ -115,7 +115,7 @@
<p>You could follow the examples above to create an <a shape="rect" href="predicate.html">Predicate</a> in a <a shape="rect" href="message-filter.html">Message Filter</a> or as an <a shape="rect" href="expression.html">Expression</a> for a <a shape="rect" href="recipient-list.html">Recipient List</a></p>
-<h3 id="BeanShell-ScriptContext">ScriptContext</h3><p>The JSR-223 scripting languages ScriptContext is pre configured with the following attributes all set at <code>ENGINE_SCOPE</code>:</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Attribute</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Value</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>context</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.CamelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Camel Context ( It cannot be used in groovy)</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><span>camelContext</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.CamelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Th
e Camel Context</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>exchange</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Exchange</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The current Exchange</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>request</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The message (IN message)</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>response</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Deprecated</strong>: The OUT message. The OUT message if null by default. Use IN message instead.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>properties</p></td><td colspan="1" rowspan="1" class
="confluenceTd"><p><code>org.apache.camel.builder.script.PropertiesFunction</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9:</strong> Function with a <code>resolve</code> method to make it easier to use Camels <a shape="rect" href="properties.html">Properties</a> component from scripts. See further below for example.</p></td></tr></tbody></table></div><p>See <a shape="rect" href="scripting-languages.html">Scripting Languages</a> for the list of languages with explicit DSL support.</p><h3 id="BeanShell-AdditionalargumentstoScriptingEngine">Additional arguments to ScriptingEngine</h3><p><strong>Available as of Camel 2.8</strong></p><p>You can provide additional arguments to the <code>ScriptingEngine</code> using a header on the Camel message with the key <code>CamelScriptArguments</code>.<br clear="none"> See this example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<h3 id="BeanShell-ScriptContextOptions"><code>ScriptContext</code> Options</h3><p> </p><div class="confluence-information-macro confluence-information-macro-information"><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body">The <code>JSR-223</code> scripting language's <strong><code>ScriptContext</code></strong> is pre-configured with the following attributes all set at <strong><code>ENGINE_SCOPE</code></strong>.</div></div><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Attribute</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Value</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><span><code>camelContext</code><br clear="none"></span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.cam
el.CamelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Camel Context.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>context</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.CamelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Camel Context (cannot be used in groovy).</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>exchange</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Exchange</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The current Exchange.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>properties</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.builder.script.PropertiesFunction</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9:</strong> Function with a <st
rong><code>resolve</code></strong> method to make it easier to use Camels <a shape="rect" href="properties.html">Properties</a> component from scripts. See further below for example.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>request</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The <strong><code>IN</code></strong> message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>response</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Deprecated</strong>: The <strong><code>OUT</code></strong> message. The <strong><code>OUT</code></strong> message is <strong><code>null</code></strong> by default. Use the <strong><code>IN</code></strong> message instead.</p></td></tr></tbody>
</table></div><p>See <a shape="rect" href="scripting-languages.html">Scripting Languages</a> for the list of languages with explicit DSL support.</p><h3 id="BeanShell-PassingAdditionalArgumentstotheScriptingEngine">Passing Additional Arguments to the <code>ScriptingEngine</code></h3><p><strong>Available from Camel 2.8</strong></p><p>You can provide additional arguments to the <strong><code>ScriptingEngine</code></strong> using a header on the Camel message with the key <strong><code>CamelScriptArguments</code></strong>.</p><p>Example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
public void testArgumentsExample() throws Exception {
getMockEndpoint("mock:result").expectedMessageCount(0);
@@ -132,22 +132,22 @@ public void testArgumentsExample() throw
assertMockEndpointsSatisfied();
}
]]></script>
-</div></div><h3 id="BeanShell-Usingpropertiesfunction">Using properties function</h3><p><strong>Available as of Camel 2.9</strong></p><p>If you need to use the <a shape="rect" href="properties.html">Properties</a> component from a script to lookup property placeholders, then its a bit cumbersome to do so.<br clear="none"> For example to set a header name myHeader with a value from a property placeholder, which key is provided in a header named "foo".</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BeanShell-UsingPropertiesFunction">Using Properties Function</h3><p><strong>Available from Camel 2.9</strong></p><p>If you need to use the <a shape="rect" href="properties.html">Properties</a> component from a script to lookup property placeholders, then its a bit cumbersome to do so. For example, to set a header name <strong><code>myHeader</code></strong> with a value from a property placeholder, whose key is taken from a header named <strong><code>foo</code></strong>.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[.setHeader("myHeader").groovy("context.resolvePropertyPlaceholders('{{' + request.headers.get('foo') + '}}')")
]]></script>
-</div></div><p>From Camel 2.9 onwards you can now use the properties function and the same example is simpler:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>From <strong>Camel 2.9</strong>: you can now use the properties function and the same example is simpler:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[.setHeader("myHeader").groovy("properties.resolve(request.headers.get('foo'))")
]]></script>
-</div></div><h3 id="BeanShell-Loadingscriptfromexternalresource">Loading script from external resource</h3><p><strong>Available as of Camel 2.11</strong></p><p>You can externalize the script and have Camel load it from a resource such as <code>"classpath:"</code>, <code>"file:"</code>, or <code>"http:"</code>.<br clear="none"> This is done using the following syntax: <code>"resource:scheme:location"</code>, eg to refer to a file on the classpath you can do:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BeanShell-LoadingScriptFromExternalResource">Loading Script From External Resource</h3><p><strong>Available from Camel 2.11</strong></p><p>You can externalize the script and have Camel load it from a resource such as <strong><code>classpath:</code></strong>, <strong><code>file:</code></strong>, or <strong><code>http:</code></strong>. This is done using the following syntax: <strong><code>resource:scheme:location</code></strong> e.g. to refer to a file on the classpath you can do:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[.setHeader("myHeader").groovy("resource:classpath:mygroovy.groovy")
]]></script>
-</div></div><h3 id="BeanShell-Howtogettheresultfrommultiplestatementsscript">How to get the result from multiple statements script</h3><p><strong>Available as of Camel 2.14</strong></p><p>As the scripteengine evale method just return a Null if it runs a multiple statments script. Camel now look up the value of script result by using the key of "result" from the value set. If you have multiple statements script, you need to make sure you set the value of result variable as the script return value.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BeanShell-HowtoGettheResultfromMultipleStatementsScript">How to Get the Result from Multiple Statements Script</h3><p><strong>Available from Camel 2.14</strong></p><p>The script engine's eval method returns a <strong><code>null</code></strong> when it runs a multi-statement script. However, Camel can look up the value of a script's result by using the key <strong><code>result</code></strong> from the value set. When writing a multi-statement script set the value of the <strong><code>result</code></strong> variable as the script return value.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<script class="brush: text; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[bar = "baz";
# some other statements ...
# camel take the result value as the script evaluation result
result = body * 2 + 1
]]></script>
-</div></div><p> </p><h3 id="BeanShell-Dependencies">Dependencies</h3><p>To use scripting languages in your camel routes you need to add the a dependency on <strong>camel-script</strong> which integrates the JSR-223 scripting engine.</p><p>If you use maven you could just add the following to your pom.xml, substituting the version number for the latest & greatest release (see <a shape="rect" href="download.html">the download page for the latest versions</a>).</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p> </p><h3 id="BeanShell-Dependencies">Dependencies</h3><p>To use scripting languages in your camel routes you need to add the a dependency on <strong><code>camel-script</code></strong> which integrates the JSR-223 scripting engine.</p><p>If you use maven you could just add the following to your <strong><code>pom.xml</code></strong>, substituting the version number for the latest & greatest release (see <a shape="rect" href="download.html">the download page for the latest versions</a>).</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-script</artifactId>