Client API is used to communicate with rule engines. API interfaces and classes are located in com.hammurapi.reasoning package.
The diagram above shows typical steps in working with a forward reasoning session:
Obtain a reference to a reasoning session factory. This step is implementation specific and is not covered by the specification. For example, in J2EE environment it can be JNDI lookup and in a standalone application it can be instantiation of a factory class with new.
Create a reasoning session.
Put facts to the session.
Execute rules.
Retrieve conclusions from the session.
Close the session.
This is a typical backward reasoning scenario:
Obtain a reference to a reasoning session factory. This step is implementation specific and is not covered by the specification. For example, in J2EE environment it can be JNDI lookup and in a standalone application it can be instantiation of a factory class with new.
Create a reasoning session providing an array of input fact sources. These sources can be database queries, files, other backward reasoning sessions, …
Retrieve conclusions of desired type from the session. This operation can be performed multiple times for different or same conclusion types.
Close the session.