cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Issue with whitespace in Non-XML condition literals (SAP CPI)

r_herrmann
Active Contributor
0 Likes
4,124

Currently I'm struggeling a bit with a Non-XML condition in a SAP CPI router. I try to check if a property "X" contains a specific String.

The expression I like to evaluate looks like:

${property.X} contains 'my token string'

Unfortunately this ends up with the following error:

Invalid format of condition expression value.

When rewriting the condition to the following, the error disappears:

${property.X} contains 'mytokenstring'

So I guess whitespaces aren't allowed in literals. The question is why? Neither in the CPI documentation nor in the Apache Simple documentation I can find a reference which tells that whitespaces aren't allowed?!

p.s.: I'm aware that I could solve the situation with a Groovy script, but I want to understand why the error above is raised.

Accepted Solutions (1)

Accepted Solutions (1)

MortenWittrock
SAP Mentor
SAP Mentor

Hi Raffael

That is indeed odd. Possibly a bug, even?

I guess as a workaround you could store ${property.X.contains("my token string")} or ${property.X.indexOf("my token string")} in a property before the router, and then route on the contents of that property. But elegant it definitely isn't.

Regards,

Morten

r_herrmann
Active Contributor

At the end I wrote a small Groovy Script. Hopefully the bug will be resolved soon.

DisplayName2
Participant
2024 and bug is still alive

Answers (1)

Answers (1)

jsoucek
Explorer
0 Likes

Hi,

2025 and the bug is still there.

You can rewrite the condition using regex thus eliminating all spaces by using "\s" from the second argument, i.e.

${property.X} regex 'my\stoken\sstring'

 Not quite as elegant but it works.

Regards,
Jakub