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

Claus Ibsen commented on CAMEL-22882:
-------------------------------------

[#camel > Simple Language with init 
block|https://camel.zulipchat.com/#narrow/channel/257298-camel/topic/Simple.20Language.20with.20init.20block/with/569253586]

> camel-core - Local assignment for temporary variables in simple expressions
> ---------------------------------------------------------------------------
>
>                 Key: CAMEL-22882
>                 URL: https://issues.apache.org/jira/browse/CAMEL-22882
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Major
>
> If you use simple for mapping or something a little bit more complex, then 
> you may want to be able to assign local temporary variables with calculations 
> or other expressions to make it easier to build up the result.
> {code:java}
> ${localVariables(
>   $foo = ${sum(1,2,3)}
>   $len = ${body.length}
>   $zip = ${body.zip.code}
>   $priority = $foo > 999 ? true : false
> )}
> id: ${body.id}
> postal: ${variable.zip}
> quick: ${priority} ? 'high' : 'normal'{code}
> So if we can make $\{localVariable(..) some kind of pre calculations that has 
> no affect on the result of the expression and that it does not add up as 
> empty lines etc.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to