Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id BA703200CE0 for ; Fri, 25 Aug 2017 10:22:13 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B8FC016BD4F; Fri, 25 Aug 2017 08:22:13 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0E03316B8F3 for ; Fri, 25 Aug 2017 10:22:11 +0200 (CEST) Received: (qmail 14219 invoked by uid 500); 25 Aug 2017 08:22:10 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 14210 invoked by uid 99); 25 Aug 2017 08:22:10 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Aug 2017 08:22:10 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 8B1E43A03A1 for ; Fri, 25 Aug 2017 08:22:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1017260 [4/40] - in /websites/production/camel/content: ./ cache/ Date: Fri, 25 Aug 2017 08:22:03 -0000 To: commits@camel.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20170825082207.8B1E43A03A1@svn01-us-west.apache.org> archived-at: Fri, 25 Aug 2017 08:22:13 -0000 Modified: websites/production/camel/content/beanshell.html ============================================================================== --- websites/production/camel/content/beanshell.html (original) +++ websites/production/camel/content/beanshell.html Fri Aug 25 08:22:01 2017 @@ -41,7 +41,6 @@ - -

Using Properties Function

Available from Camel 2.9

If you need to use the Properties component from a script to lookup property placeholders, then its a bit cumbersome to do so. For example, to set a header name myHeader with a value from a property placeholder, whose key is taken from a header named foo.

- -

From Camel 2.9: you can now use the properties function and the same example is simpler:

- -

Loading Script From External Resource

Available from Camel 2.11

You can externalize the script and have Camel load it from a resource such as classpath:, file:, or http:. This is done using the following syntax: resource:scheme:location e.g. to refer to a file on the classpath you can do:

- -

How to Get the Result from Multiple Statements Script

Available from Camel 2.14

The script engine's eval method returns a null when it runs a multi-statement script. However, Camel can look up the value of a script's result by using the key result from the value set. When writing a multi-statement script set the value of the result variable as the script return value.

- -

 

Dependencies

To use scripting languages in your camel routes you need to add the a dependency on camel-script which integrates the JSR-223 scripting engine.

If you use maven you could just add the following to your pom.xml, substituting the version number for the latest & greatest release (see the download page for the latest versions).

- -
+