[
https://issues.apache.org/jira/browse/CAMEL-5680?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-5680.
--------------------------------
Resolution: Won't Fix
Closing old tickets
> Create a set/assign DSL where the target is determined by an expression
> -----------------------------------------------------------------------
>
> Key: CAMEL-5680
> URL: https://issues.apache.org/jira/browse/CAMEL-5680
> Project: Camel
> Issue Type: New Feature
> Components: camel-core
> Reporter: Raúl Kripalani
> Assignee: Raúl Kripalani
> Priority: Major
>
> Right now we have three setXYZ DSLs: {{setBody}}, {{setHeader}},
> {{setProperty}}. We could create a generic {{<set />}} DSL where the target
> of the assignment is determined by an expression.
> Imagine you had a POJO in your payload, and you want to invoke a setter with
> the value of a header. You could write something like:
> {code}
> <set>
> <from>
> <header>abc</header>
> </from>
> <to>
> <ognl>body.setName($value)</ognl>
> </to>
> </set>
> {code}
> Kind of like BPEL's <assign />.
> If you had a HashMap as the body, you could do ad-hoc setting of entries (now
> using the assign variant):
> {code}
> <assign>
> <from>
> <xpath headerName="myHeader">/my/expression</xpath>
> </from>
> <to>
> <ognl>body.put('key', $value)</ognl>
> </to>
> </assign>
> {code}
> And if we could support XPath to XPath mapping, like BPEL's assign, that
> would be excellent.
> {code}
> <assign>
> <from>
> <xpath headerName="foo">/my/expression</xpath>
> </from>
> <to>
> <xpath>body.put('key', $value)</xpath>
> </to>
> </assign>
> {code}
> But the latter is much more complex because the XPath standard by itself
> doesn't encompass setting of elements for obvious reasons. However, XProc
> does (p:insert).
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)