Hi,
I want to check if a particular string is existing in a given string list.
example : lets say the string list has 1, 2, 3, 4, 5 and if i pass 3 as a string input, it should return me (yes or no) or (true or false).
do we have something this kind of inbuilt service in our wm developer.
Please let me know.
Java is one way. The same can be done in FLOW as well. And can be debugged using Developer. Here are the steps for a service that accepts a string list name myList and a string to look for name myValue and returns a var name found:
MAP (set found = false)
LOOP over ‘/myList’
…BRANCH (evaluate labels = true)
…%/mylist% == %/myValue%: SEQUENCE
…MAP (set found = true)
…EXIT ‘$loop’ and signal SUCCESS
yes, i did this before. but we want to avoid using loop because we have a string list of various folder names ranging from 2000 to ~. this way loop takes much time
If performance is really a concern, then maybe you should consider different approaches to help speed up the look up, such as using hash tables or sorted lists.