Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-5252

Simple language - Improved OGNL invocation with simple expression as functions for parameters

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9.2
    • Fix Version/s: 2.18.0
    • Component/s: camel-core
    • Labels:
      None
    • Estimated Complexity:
      Advanced

      Description

      See nabble
      http://camel.465427.n5.nabble.com/Invoking-a-bean-returned-by-a-previous-bean-invocation-tp5676696.html

      The example with the nested animal parameter.
      We should see if we can better detect this use-case, and avoid the intermediate String conversion, when its a parameter type.

             public void testBodyOgnlOnAnimalWithOgnlParams() throws Exception {
                     exchange.getIn().setBody(new Animal("tiger", 13));
                     exchange.getIn().setHeader("friend", new Animal("donkey", 4));
                     assertExpression("${body.setFriend(${header.friend})}", null);
             }
      

      Fails with org.apache.camel.NoTypeConversionAvailableException: No type
      converter available to convert from type: java.lang.String to the required
      type: org.apache.camel.language.simple.SimpleTest.Animal with value donkey

        Attachments

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              davsclaus Claus Ibsen
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: