I need to ask a problem on the operator "choice when" in Apache Camel route. In the following example, if I have two soap-env:Order elements which have 1, 2 value, then I want to create two xml file named output_1.xml and output_2.xml. However, the code can only create one file output_1.xml. Can anyone give me any ideas or hints? Thanks for any help.
public void configure() {
...
from("direct:a")
.choice()
.when(ns.xpath("//soap-env:Envelope//soap-env:Order='1'"))
.to("file://data?fileName=output_1.xml")
.when(ns.xpath("//soap-env:Envelope//soap-env:Order='2'"))
.to("file://data?fileName=output_2.xml")
.when(ns.xpath("//soap-env:Envelope//soap-env:Order='3'"))
.to("file://data?fileName=output_3.xml")
}