Hi Jayanta,

As you split your file using the tilde separator before to call the content
base router EIP pattern (choice/when), only each token resulting from the
split will be saved under the destination file. Instead of splitting the
content of your file, you should just use the CBR with the expression
(${in.body}
contains 'oprncode=ATM') to route your file to the correct destination
folder.

Regards,

Charles


On Fri, Apr 25, 2014 at 8:07 AM, j_pramanik_ind
<[email protected]>wrote:

> Hello All,
>
> I used following route in XML DSL.
>
> The requirement is to read file content , which is a line of string
> delimited by '~', depending on specific pattern of a token I need to copy
> the file to respective folder with full content. It copies the file but the
> content is found only that token on which it checks the condition.
>
>
> For example:
>
> File content (Full) : userid=1~pass=jayanta~oprncode=ATM~custno=4990000001~
>
> The File that was copied contains only : oprncode=ATM  (But actually I need
> to get the full content)
>
> Following is the XML DSL ::
> -------------------------------------
> <route id="route1">
>          <from uri="file:E:\\bankappfiles\\received?delete=true" />
>         <log message="Title Name [${body}]"/>
>
>         <split stopOnException="true">
>                 <tokenize token="~"/>
>                         <choice>
>                                 <when>
>                                         <simple> ${in.body} ==
> 'oprncode=ATM'</simple>
>                                         <to
> uri="file:E:\\bankappfiles\\atm?noop=true" />
>                                 </when>
>                                 <when>
>                                         <simple>${in.body} ==
> 'oprncode=NEFT'</simple>
>                                         <to
> uri="file:E:\\bankappfiles\\neft?noop=true" />
>                                 </when>
>                        </choice>
>         </split>
> </route>
>
> Please advice how can I get the full content of the source file in the
> copied one?
>
> Thanks in advance,
>
> Jayanta P.
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/File-content-missing-in-Copied-File-using-Camel-XML-DSL-tp5750582.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io

Reply via email to