I am totally new to IBM ODM and I have been given a set of rules to be designed in the IBM ODM rule designer. Simple If else and conditional rules I managed to write but I am struck how to write regular expression related rules in the IBM ODM. Can someone please help. I have Member variable of my XOM class which is a String and I need to validate if it contains only Numbers and having 8 characters as length.
As a long-time user of ODM/JRules, it's my opinion that this is not a high-value use of business rules and that in the long run these rules will not be worthwhile.
Having said that, it should be easy enough to write a couple BOM or XOM methods to do what you want.
boolean containsOnlyNumbers(String string) {} Verbalization: "{0} contains only numbers"
int length(String string, int length) {} Verbalization: "{0} is {1} characters long"
Define these methods as static, on any class you want, perhaps a Utility class created just for them. Fill in the body of the methods with Java code to do the obvious things. Then verbalize them so your rule reads nicely:
If X contains only numbers and X is 8 characters long then