I've flow like this and my problem is that I'm getting the wrong value on the second header:
<when>
<xpath>//kred:assigment_GetRq/nrb</xpath>
<setHeader headerName="nrbPE">
<xpath resultType="java.lang.String">//kred:assigment_GetRq/nrb/text()</xpath>
</setHeader>
<setHeader headerName="subNrbPE">
<xpath resultType="java.lang.String">substring(${headers.nrbPE}, 3, 6)</xpath>
</setHeader>
<setHeader headerName="kod">
<simple>${properties:apiEsb.assigment.bpCode}</simple>
</setHeader>
<log loggingLevel="INFO" message="header nrb: ${headers.nrbPE}"/>
<log loggingLevel="INFO" message="header subNrb: ${headers.subNrbPE}"/>
<log loggingLevel="INFO" message="Property: ${headers.kod}"/>
<choice>
<when>
<xpath>${headers.subNrbPE} = ${headers.kod}</xpath>
<process ref="createDetailSectionProc" />
</when>
<otherwise>
<log loggingLevel="INFO" message="otherwise"/>
</otherwise>
</choice>
</when>
Logs:
08:26:47,067 | INFO | Esb| Assigment_Get | | 68 - org.apache.camel.camel-core - 2.6.0.fuse-03-01 | header nrb: 99999999
08:26:47,067 | INFO | Esb| Assigfment_Get | | 68 - org.apache.camel.camel-core - 2.6.0.fuse-03-01 | header subNrb: ass ja
I don't understand what is wrong with syntax cause the second value should be 9999, but I see that substring is making on (class java...) Could you tell me where I made a mistake? I need to compare this substring value with property value in some logic statement in Camel.