-
1. Re: Right way to create set of rules per user/role & maintain pool of KnowledgeAgent per user ?
laoma036912 Oct 23, 2012 8:49 AM (in response to kunal_ransing)Hi,
What do you want? Different user/role calls different rules ? Add a user/role have to add a KnowledgeAgent, this seems to be too much trouble.
Why don't you do this? The User and Rule as a Fact object added to the Session. It fires the rules.
as follows:
rule "1"
when
User(name=="tom")
Role(name=="developer")
then
System.out.println("tom's rules");
end
rule "2"
when
User(name=="mark")
Role(name=="manager")
then
System.out.println("mark's rules");
end
Code is :
User user=new User("tom");
Role role=new Role("developer");
session.insert(user);
session.insert(role);
Result : It fires the rule "1".
So it needs only one package and KnowledgeAgent.
Hope these just what you need.