We work with messages that are text-based (no XML). Our goal is to validate the messages, a message is valid if the content is correct. We developed our own language defined in XML to express rules on the message. We need to add more complex rules and we think that it’s now time to look at other alternative and use real rules engine. We support these types of rules:
- name in a list of values or a regular expression ex {SMITH, MOORE, A*}
- name is present in the message-
- name is not present in the message
- if condition then name = John else name = Jane Note that the condition is simple and does not contain any logical operators.
We need to support these types of rules:
- if then else but the condition contains logical operators
- for ... loop :
- For all the customers in the message we want at least one from the USA and at least one from France
- For all the customers in the message we want at least five that are from the USA and are buying more than $1000 a year
- For any customer with name John, the last name must be Doe
- Total customers with name John < 15
- The name of the company is equal to the name of the company in another location in the message
The rules will depend on the type of messages we process. So we were investigating several existing solutions like:
- JESS
- OWL (Consistency checking)
- Schematron (by transforming the message in XML)
What would be the best alternatives considering that we develop in Java? Another thing to consider is that we should be able to do error reporting like error description, error location (line and column number).