on ‎2020 Mar 18 12:16 PM
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.
Request clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
At the end I wrote a small Groovy Script. Hopefully the bug will be resolved soon.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 7 | |
| 7 | |
| 7 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.