Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Compare String


Level 5

I want to compare strings in a route condition.

I have two strings /process_data/@string1 and /process_data/@string2

I fill the box of the properties route conditions like that :

/process_data/@string1 = /process_data/@string2

I try many other ways but it doesn't work so I think I'm wrong

I use a variable logger in the process with the strings length and the strings :

string1 :

/process_data/@tailleCourrant - java.lang.Integer: 10

/process_data/@nplusunEnCours - String: AALBERTEAU

string2 :

/process_data/@tailleEntree - java.lang.Integer: 10

/process_data/@nplusUnEntree - String: AALBERTEAU

The only difference I see is the blank before the strings but I can't erase them and the length are the same so I think there is no matter of that.

Edit : I try this in condition :

"test" = "test" and It works fine so I suppose my two string are different but I know there are the same and the logger say that. I don't understand the spaces before the string. I try normalize-space but It doesn't work to.

4 Replies


Level 10
I think the issue is with XPath. You will have to explicitly state that they are strings in your XPath statement.


Level 5
I try string(/process_data/@string1) and the same for string2 but I didn't work to. I try to use serialize when I take the string in the xml but It didn't change anything.

But finally It works. The string1 variable is a input variable but I can retrieve this value in the process so I delete it and create an other string but not input this time. And this time it's work without serialise() or string(), I don't understand.


Level 9
Could it be that the order of execution of your routes is the wrong way around, so that it's always executing another route before this one?