I have 2 arrays.
I am doing a nested loop, then I should search if the 1st array element contains the 2nd array element.
Suppose, the 1st array element is :: “we can not find a solution for this”
the 2nd array element is :: “find a solution”
I should search if “find a solution” is present in “we can not find a solution for this”
To achieve this, I am using a sequence and I am writing the label like:
%errorDetailDoc/Events/ErrorDump% = /%ErrorHandlingProperties/properties/ErrorCategory/NetworkException/NetworkError%/
But this is not working.
Can somebody please help me on this.
Loop over both the array elements first and
Take branch step, and set evaluate labels to true
then, move the sequence ( your code) inside branch as a child sequence.
There are some problems in what you say.
You say that you want to check for containment and yet you test the equality
%errorDetailDoc/Events/ErrorDump% = /%ErrorHandlingProperties/properties/ErrorCategory/NetworkException/NetworkError%/ is not correct
the / characters should be inside the %%
My suggestion is:
- to check the WMPublic services to see if there is a service that checks the containment of a string within another string
- if no such service exists you can make your own java service that can easily test the containment (http://javatutorialhq.com/java/lang/string-class-tutorial/contains-method-example/).
Hope this helped,
Additiionally you can check out the PSUtilities Package available from tech community downloads section.
If you don’t want to use java service, you can just try:
give the first and 2nd string as the parameters.
You can try below Reg Exp statement as it is used for searching a document with specific string .
But in this case you cannot use this in side label property of any service as label works on Boolean functions.
For more details in regular expression you can refer the below documents on page no 1120.
better use pub.string:indexOf built in service or any java Service.
I wrote a java service to check if one string is contained inside another string and it worked.
Thanks a lot everyone for your help.