You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "raulvk.soa" <ra...@gmail.com> on 2008/09/18 12:16:57 UTC

Groovy Processor

Hi,

I need to use a Groovy Processor but I only seem to be able to find support
for Predicates and Expressions on the docs.

Is it possible to use Groovy Processors Out-of-the-box, by referencing
external .groovy files? If so, how exactly should the process method be
implemented?

What I am after is actually the GPath XML processing using the XmlSlurper
class. It looks like a very agile way to do custom validation on an XML.

Thanks!
-- 
View this message in context: http://www.nabble.com/Groovy-Processor-tp19549778s22882p19549778.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Groovy Processor

Posted by Vadim Chekan <vc...@cox.net>.
May be "file:groovy:/path"?
Because "groovy:<expression>" could be used for inline expression then.

Vadim.

James Strachan wrote:
> 2008/9/18 raulvk.soa <ra...@gmail.com>:
>> Hi,
>>
>> I need to use a Groovy Processor but I only seem to be able to find support
>> for Predicates and Expressions on the docs.
>>
>> Is it possible to use Groovy Processors Out-of-the-box, by referencing
>> external .groovy files? If so, how exactly should the process method be
>> implemented?
>>
>> What I am after is actually the GPath XML processing using the XmlSlurper
>> class. It looks like a very agile way to do custom validation on an XML.
> 
> We've no explicit support yet for invoking a script as a processor; we
> should add that.
> 
> In the meantime, if you compile your groovy on the classpath you can
> just refer to the Groovy class in the bean...
> 
>   from("....").bean(SomeClass.class);
> 
> We should maybe have a script endpoint?
> 
>   from("...").to("groovy:foo/bar/Whatnot.groovy");
> 


Re: Groovy Processor

Posted by "raulvk.soa" <ra...@gmail.com>.
Hi James,

Ok, I see.

One thing is puzzling me though. I have come across the following class in
the Camel API: org.apache.camel.builder.script.ScriptBuilder<E>, which
contains a groovy(File) method.

What is this for?

Thanks.



James.Strachan wrote:
> 
> 2008/9/18 raulvk.soa <ra...@gmail.com>:
>> Hi,
>>
>> I need to use a Groovy Processor but I only seem to be able to find
>> support
>> for Predicates and Expressions on the docs.
>>
>> Is it possible to use Groovy Processors Out-of-the-box, by referencing
>> external .groovy files? If so, how exactly should the process method be
>> implemented?
>>
>> What I am after is actually the GPath XML processing using the XmlSlurper
>> class. It looks like a very agile way to do custom validation on an XML.
> 
> We've no explicit support yet for invoking a script as a processor; we
> should add that.
> 
> In the meantime, if you compile your groovy on the classpath you can
> just refer to the Groovy class in the bean...
> 
>   from("....").bean(SomeClass.class);
> 
> We should maybe have a script endpoint?
> 
>   from("...").to("groovy:foo/bar/Whatnot.groovy");
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://open.iona.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Groovy-Processor-tp19549778s22882p19549978.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Groovy Processor

Posted by James Strachan <ja...@gmail.com>.
2008/9/18 raulvk.soa <ra...@gmail.com>:
> Hi,
>
> I need to use a Groovy Processor but I only seem to be able to find support
> for Predicates and Expressions on the docs.
>
> Is it possible to use Groovy Processors Out-of-the-box, by referencing
> external .groovy files? If so, how exactly should the process method be
> implemented?
>
> What I am after is actually the GPath XML processing using the XmlSlurper
> class. It looks like a very agile way to do custom validation on an XML.

We've no explicit support yet for invoking a script as a processor; we
should add that.

In the meantime, if you compile your groovy on the classpath you can
just refer to the Groovy class in the bean...

  from("....").bean(SomeClass.class);

We should maybe have a script endpoint?

  from("...").to("groovy:foo/bar/Whatnot.groovy");

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com