I am very new to rules engine. The requirement for our project is store and retrieve rules from the database.This makes the rules engine to directly interact with the Database, to do so is there any way that I can use the rules api to set the rules.

For example something like
Creating a rule.
Rule rule = new Rule(name);
Rule.setSaliance(1);

Similarly I don't find any api's to set the conditions and the consequences.
I did extensive googling but couldn't find the right answer..
I would appreaciate if some could help me with this scenario.
Thanks in advance,
Sandeep.