Return-Path: X-Original-To: apmail-camel-issues-archive@minotaur.apache.org Delivered-To: apmail-camel-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CB28018A6D for ; Thu, 24 Mar 2016 21:40:25 +0000 (UTC) Received: (qmail 22676 invoked by uid 500); 24 Mar 2016 21:40:25 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 22516 invoked by uid 500); 24 Mar 2016 21:40:25 -0000 Mailing-List: contact issues-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 issues@camel.apache.org Received: (qmail 22428 invoked by uid 99); 24 Mar 2016 21:40:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Mar 2016 21:40:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 6F7FD2C1F5A for ; Thu, 24 Mar 2016 21:40:25 +0000 (UTC) Date: Thu, 24 Mar 2016 21:40:25 +0000 (UTC) From: "Dye357 (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CAMEL-9756) It would be great if Objects returned by language expressions could be set as the body on an Exchange without using the LanguageProducer MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Dye357 created CAMEL-9756: ----------------------------- Summary: It would be great if Objects returned by language expressions could be set as the body on an Exchange without using the LanguageProducer Key: CAMEL-9756 URL: https://issues.apache.org/jira/browse/CAMEL-9756 Project: Camel Issue Type: Wish Components: camel-script Affects Versions: 2.16.0 Reporter: Dye357 Priority: Minor Scenario: I would like to manipulate a file on the exchange with groovy. However: ScriptProcessor.java states: * A processor which executes the script as an expression and does not change the message body. * In this case GroovyExpression is instantiated and an Object is returned but the returned object is ignored by obvious design. In order to successfully manipulate a file on the exchange using groovy the only way I have found is to explicitly declare the uri: language:groovy:file:/ in a block. This leverages the languageProducer.java class which assigns the returned object from GroovyExpression.java as the body on the Exchange. My question(s) are: 1. Why does Script Processor intentionally not assign the result from GroovyExpression.java to the body? 2. What is the best way in Camel to evaluate a groovy script and assign what is returned from the groovy script to the body on the exchange (In my case a java.io.File Object)? 3. Why does ProcessorDefintion.java not expose Language? My objection using the URI I provided above is that I am programatically generating my camel XML and embedding groovy script with multiple lines in a URI is somewhat fragile & loading the groovyscript from a file is not practical for my use case. Thanks!! -- This message was sent by Atlassian JIRA (v6.3.4#6332)