[rules-users] Newbie question on how to use drools with seam

Rex Na rexn at businessabstraction.com
Fri Jan 28 06:55:34 EST 2011


Hi,

I'm new to drools and having troubles in using drools with seam framework.
Specifically speaking,

I have the following tables(namely entities):
User table:
Long id,
String name,
List<AccountPermission> permissions

AccountPermission table:
Long id,
User user,
Account account

Account table:
Long id,
Long name,
Set<Comment> comments

Comment table:
Long id,
Account account

and my drl file:

rule "insertCommentRule"
    no-loop
when
        $check: PermissionCheck(target == "commentHome", action ==
"insertComment")
        Principal($username: name)
     <...........more rules should be put here>
then
       $check.grant();
end

Lastly, I have an action in CommentHome, a seam component with name
"commentHome" and this action is used to insert a comment.

As above, I understand some rules can be put there to control whether the
current user is authorised to insert a comment. However, I have failed in
many different ways.
I looked through seam books and reference as well. Nothing really explained
clearly on how to do a process control with seam components.

All I wanna do is to check whether a user who just log in with valid
credentials have permissions to insert comments. It's really hard for me to
get to that point. So could anybody show me how to do it with seam? I really
appreciate it. Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110128/cf411f94/attachment.html 


More information about the rules-users mailing list