[rules-users] APIs to create rules

bobbi_80 guruprasad_bobbi at infosys.com
Mon Jan 16 04:43:09 EST 2012


public static class CpuTracker{ 
        private String machinename; 
        private String averageCPU; 
}

Consider the following rule :

rule first_rule
@ID(“1”)
	when
		averageCPU > 80
	then
		syso("do something");
end
			

I have the following requirements to let the user change the rules.

1)	Create an app that will accept user input for rule Name, LHS , RHS of
rule.
2)	Add/remove rules from the knowledge base at runtime.
3)	Display all compiled rules . 

For task(1) I am unable to figure out the exact APIs to programmatically
create rules . Have gone through number of posts in user forums and docs but
got nothing conclusive.
For Task(3)  I could get rule name and any other meta data information but
not LHS,RHS info. Does that mean that rules will have to be persisted and
there are no APIs to fetch LHS/RHS at run time?

What are my options here?

Many Thanks,
Dumb programmer!



--
View this message in context: http://drools.46999.n3.nabble.com/APIs-to-create-rules-tp3662689p3662689.html
Sent from the Drools: User forum mailing list archive at Nabble.com.




More information about the rules-users mailing list