This content has been marked as final.
Show 3 replies
-
1. Re: How can i @In Seam componet to drl?
thejavafreak Sep 13, 2008 2:47 PM (in response to baobaotuo)What you can do is expose your dao to drl from your Seam component.
-
2. Re: How can i @In Seam componet to drl?
baobaotuo Sep 13, 2008 6:20 PM (in response to baobaotuo)What do you mean "expose"?
If I hava a DAO "UserDAO" which is a seam compnent that is annotated with "@Name("userDAO")",
@Name("userDAO")
public class UserDAO{
@In
EntityManager entityManger;
public User find(Long id){
return entityManager.createQuery("SELECT user FROM User user WHERE user.id = :id").setParameter("id",id).getSingleResult();
}
}
I can just use it in drl as below?
rule "test"
no-loop;
when
c: PermissionCheck(name == "User",action=="manage");
admin : UserDAO.find(1);
Member(memberId : id -> id.equals(admin.id));
then
System.out.println("You are admin!");
c.grant();
end;
Above code iss just a simple show case.
I am new to drool.
Thank for your help,Joshua Partogi. -
3. Re: How can i @In Seam componet to drl?
thejavafreak Sep 14, 2008 8:16 AM (in response to baobaotuo)You can not do that liu lei. You have to expose the variable/object to drools instead.