title: Apache Camel: can I put multiple statements in the when part of the conditional choice statement?
body: <p>I would like to obtain the following kind of routing:</p>
  
  <ol>
  <li>HTTP POST message with XML body enters CAMEL</li>
  <li>I store some of the parameters of the XML body</li>
  <li>The message is routed to an external endpoint</li>
  <li>The external endpoint (external server) replies</li>
  </ol>
  
  <p>-> at this moment, I would like to check whether the reply from the external endpoint is a HTTP 200 OK containing a XML parameter  equal to SUCCESS.
  -> if so, then I would like to use some of the stored parameters to construct a new HTTP message (method = PUT this time) and send it out to an external endpoint</p>
  
  <p>Problem that I am currently having, is the following:</p>
  
  <pre><code>.choice()
   .when(simple("${in.headers.CamelHttpResponseCode} == 200"))
     // now I want do a few things, eg: check also the XML body via xpath
     // and change the message to be sent out (change Method to PUT, ...)
      .to("http://myserver.com")
   .otherwise()
     // if no 200 OK, I want the route to be stopped ... not sure how ?
  .end()
  </code></pre>
  
  <p>Question: any idea how to add those extra statements in case the HTTP response code was 200 OK ? It looks like the when does not allow me to add extra statements ...
  (I got an error in my Eclipse IDE).</p>
  
  <p>Thanks in advance.</p>
  
  <p>Note: could it be that I have to route the message in case the 200 OK matches to a 'new endpoint' and then create a new from route with this new endpoint ?
  Eg:</p>
  
  <pre><code>.choice()
       .when(simple("${in.headers.CamelHttpResponseCode} == 200"))
          .to("mynewendpoint")
       .otherwise()
         // if no 200 OK, I want the route to be stopped ... not sure how ?
      .end();
  
   from("mynewendpoint").
    .setHeader(etc etc)
    .to("http://myserver.com")
  </code></pre>
  
  <p>In this latter case, how exactly should I define this 'newendpoint' ?</p>