I want to check whether a certain variable CONTAINS some set of strings or not using IF condition in WebMethods.io. Based on the values, I want to execute my steps. Is this possible? If yes, please share the code snippet.
Ex:- Whether string1 starts with “ABC” or “DEF” or “GHI”. Based on this, I want to execute 3 different flow steps in my flow service. string1 contains alphanumeric values.
webMethods.io Integration FlowServices do not yet support regular expressions.
As an alternate solution you could use the Substring utility to extract the first three characters from the string, and then use IF statements to determine if the substring value is equal.
Obviously the begin and end index used in the Substring can be whatever you need (e.g. make these dynamic).
In the first step, the Substring is checking String1, using a beginindex of 0 and endIndex of 3.
The subStringValue is the first three characters of the string.
The rest of the code uses regular IF statements to check if subStringValue equals to the compare value (e.g. ABC, DEF, or GHI).
In the on-premise Flow Services world you can use regular expressions.
Do you always want to check which characters are at the beginning? Of course you can make the begin index and end index used in the Substring dynamic using parameters.
Anyway, this is a quick and dirty way. I am checking with our R&D team about when wM.io Integration FlowServices will support regular expressons.
Thanks for providing the workaround. I would like to add some point, if I may. I don’t see much flexibility in terms of options available in WebMethods.io with Flow Services like we used to have with on-premise IS. Also, built in services are very less (to say the least).