title: Camel: how to set boolean header parameter using simple comparison?
body: <p>I am trying to set a header parameter (<code>param2</code>), using <a href="http://camel.apache.org/simple.html" rel="nofollow">simple expression language</a>:</p>
  
  <pre><code>from("timer://foo?repeatCount=1")
      .setBody(constant("on,off"))
      .split()
      .tokenize(",")
      .setHeader("param1", simple("${body}"))
      .setHeader("param2", simple("${header.param1} == 'on'"))
      .log("param1 = [${header.param1}], param2 = [${header.param2}]");
  </code></pre>
  
  <p>But as result I get a string set instead of a boolean value, the following gets logged:</p>
  
  <pre><code>param1 = [on], param2 = [on == 'on']
  param1 = [off], param2 = [off == 'on']
  </code></pre>
  
  <p>I would expect it log:</p>
  
  <pre><code>param1 = [on], param2 = [true]
  param1 = [off], param2 = [false]
  </code></pre>
  
  <p>Documentation writes, that it is possible to do comparison using <code>simple</code> and I can get it working when doing choices:</p>
  
  <pre><code>from("timer://foo?repeatCount=1")
      .setBody(constant("on,off"))
      .split()
      .tokenize(",")
      .setHeader("param1", simple("${body}"))
      .choice()
          .when(simple("${header.param1} == 'on'"))
              .setHeader("param2", constant(true))
          .otherwise()
              .setHeader("param2", constant(false))
          .end()
      .log("param1 = [${header.param1}], param2 = [${header.param2}]");
  </code></pre>
  
  <p>The output then is:</p>
  
  <pre><code>param1 = [on], param2 = [true]
  param1 = [off], param2 = [false]
  </code></pre>
  
  <p>But why it is not working then in direct assignment? </p>