Camel
  1. Camel
  2. CAMEL-4753

Let Method call expression accept a nested list of expressions for parameter mapping in XML DSLs

    Details

    • Estimated Complexity:
      Advanced

      Description

      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

      <method ref="myBean" method="myMethod">
        <xpath>/foo/bar</xpath>
        <simple>${header.cool}</simple>
      </method>
      

      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>

      <bean ref="myBean" method="myMethod">
        <xpath>/foo/bar</xpath>
        <simple>${header.cool}</simple>
      </bean>
      

      And for the Java DSL, we may support this as well by using varargs for the list of expressions

      .beanRef("myBean", "myMethod", xpath("/foo/bar"), simple("${header.cool"))
      

      The trick is to support this as well in the scala DSL.
      And to ensure backwards compatibility.

        Activity

        Hide
        Claus Ibsen added a comment -

        Let the DSL API be as current, so moving to 3.0

        Show
        Claus Ibsen added a comment - Let the DSL API be as current, so moving to 3.0

          People

          • Assignee:
            Unassigned
            Reporter:
            Claus Ibsen
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development