Iam trying to BRANCH on a variable that variable should contain a number, so if the variable contains a number then in should process one SEQUENCE, if that variable contains other than number it has to process $default:SEQUENCE.
For that iam using the regular expression, in webMethodsDeveloper.pdf it was given for \d Match any digit. Same as [0-9].
Example doc.p[/part \d555-A/].text
I have tried so many possiblities.
What is the REGULAR EXPRESSION for the number (only).
Hi ,
The expression is %char% = /[0-9]/ for comparing whether a char is numeric or not.Also make sure you set Evaluate-Labels property of Branch step to True.
i did the same but its not working.
the error is
com.wm.lang.flow.FlowException: [ISC.0049.9012] Cannot define switch and use label conditions at ‘unlabeled BRANCH’
this error comes when i set Evaluate-Labels property of Branch step to True.
RKK,
Just make sure you dont have anything set in the switch property of Branch.Just select Evaluate labels to ‘true’ over there.Inside the Branch step give the expression as given by Bhaskar in the labels of child steps.Your problem will be solved.
i hope u r putting ‘char’ in Branch step with Lebel=True, which will not work, so do like this,
Branch Evaluate -Label=True,
in Sequence step, mention %char%=/[0-9]/ at Label property.
Do we have any difference between a Java REGULAR EXPRESSION’s and a webMethods REGULAR EXPRESSION’s.
My filename is Date_DBILL_date_time.DAT
I have to find the DBILL in the file name using regular expression and ftp it to the corresponding folder.
How should i give it.
The Developer guide focuses on using regular expressions when using WQL in the pub.xml:queryXMLNode service, thus the doc.p references throughout. In the many examples provided in the doc, you can use the text within and including the slashes. For the example,
doc.p[/\bport\b/].text
you could use the /\bport\b/ within a BRANCH switch label to test if the BRANCH variable has the whole word “port” within it.
As for wM regex compared to Java 5.0/1.5 there are probably differences but in a cursory review, I haven’t seen any that I could point out. Since wM regex predated the Java regex we shouldn’t be surprised if there are a few though. Sun says Java regex is similar to Perl regex ([url=“java.util.regex (Java 2 Platform SE 5.0)”]JDK 19 Documentation - Home).
I use a little regex test service to verify that any of the regex constructs I create do exactly what I need.
Service: RobSandbox:regexTest
Input: input (string)
Output: result (string)
BRANCH on ‘input’
…/DBILL/: MAP (Put your regex in the label here. Map sets result to “hit”)
…$default: MAP (Map sets result to “no hit”)
When the service is run in Developer, you get prompted for input and the output shows whether the regex matches the input or not. This makes it easy to test various input conditions, such as null variable, empty variable, only spaces, “real” content, etc. Once my regex is “debugged” I copy it to the real place in the integration where it is needed.
Hi,
Can you please help me for regular expression. my requirement is if variable contain char then only its execute remaining code otherwise it will go to exit $flow.
Here is the simple logic to check the condition as for your needs:
Service Snippet as an Example:
Create a new service "testChars" → Logic as follows
Map (testChar) - service input and pass some chars)
Branch Evaluate -Label=True,
(under Inside this branch)
Add Sequence step, mention %testChar% ==/[A-Za-z]/ at Label property.
–>If the testChar has chars the step inside this sequence executes else
Add another Sequence step (select $default at Label property)
→ Add EXIT $flow step
Try the above and test the flow and it should work.