camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ├ľnder Sezgin (JIRA) <j...@apache.org>
Subject [jira] [Commented] (CAMEL-4753) Let Method call expression accept a nested list of expressions for parameter mapping in XML DSLs
Date Wed, 12 Jul 2017 16:20:00 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-4753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16084250#comment-16084250
] 

├ľnder Sezgin commented on CAMEL-4753:
-------------------------------------

scala dsl is deprecated already? we should consider for java and xml dsls?

> Let Method call expression accept a nested list of expressions for parameter mapping
in XML DSLs
> ------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-4753
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4753
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-blueprint, camel-core, camel-spring
>    Affects Versions: 2.9.0
>            Reporter: Claus Ibsen
>              Labels: dsl
>             Fix For: 3.0.0
>
>
> When using a method call expression, people may want to map parameters. Currently they
can use the method name attribute, which supports this in Camel 2.9 onwards. Using a syntax
that is similar to java code. See
> http://camel.apache.org/bean-binding.html
> However Christian S. suggested to also allow to map using a nested list of Expression.
So you can do
> {code:xml}
> <method ref="myBean" method="myMethod">
>   <xpath>/foo/bar</xpath>
>   <simple>${header.cool}</simple>
> </method>
> {code}
> That will invoke the myMethod with 2 parameters, and the 1st is the xpath, and the 2nd
the simple.
> Likewise we could consider improving the <bean> as well, if you want to invoke
a bean in a route, eg like a <to>
> {code:xml}
> <bean ref="myBean" method="myMethod">
>   <xpath>/foo/bar</xpath>
>   <simple>${header.cool}</simple>
> </bean>
> {code}
> And for the Java DSL, we may support this as well by using varargs for the list of expressions
> {code}
> .beanRef("myBean", "myMethod", xpath("/foo/bar"), simple("${header.cool"))
> {code}
> The trick is to support this as well in the scala DSL.
> And to ensure backwards compatibility.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message