OPSJ is a language for building rule engines in Java with the Rete II rule engine.OPSJ has:
- Rete II: OPSJ uses Rete II, which makes it the fastest Java rule engine. (For detailed benchmarks, see: blogs.illation.com)
- Pure Java: The OPSJ engine is written entirely in Java; no native code is used. This means that a rule base developed using OPSJ can be run in standard Java and the OPSJ file can call methods from any available library.
- Thread Safe Knowledge Sources: In OPSJ, rules are grouped into units called "Knowledge Sources." An OPSJ program may contain one knowledge source, or many. OPSJ Knowledge Sources are thread-safe. So, for example, if you had a Knowledge Source running in one thread, and a user interface in another thread, you could add incoming data to the Knowledge Source at any time without worry.
How it works
OPSJ has two parts:
- A compiler for the .opsj files that translates the rules; generating Java code.
- A run-time library which includes the Rete II engine.
There are also two parts to any program that uses OPSJ:
- The .opsj file or files. These files hold classes that hold the rule sets. A rule set is a set of methods with an if-then structure. These methods are called by their condition rather than by name.
- The KnowledgeSource class. All interaction with OPSJ is done through this class. The client creates an instance of this class and loads the rule sets to it.