[rules-users] New functionality not working?

Edson Tirelli tirelli at post.com
Tue Dec 18 05:59:29 EST 2007


   Correct is either:

Role(name == "christws-admin" || == "site-admin" || ==
"resource-type-admin")

   Or:

Role(name in ( "christws-admin", "site-admin", "resource-type-admin") )

   Where in the docs it says that the syntax you used is correct?

   []s
   Edson

2007/12/18, Andrew Robinson <andrew.rw.robinson at gmail.com>:
>
> I upgraed my jboss seam and got the new drools-core and
> drools-compiler installed. In my maven pom.xml, I am loading 4.0.3 of
> each. My rule is not loading though.
>
> Rule from "entity-rules.drl":
>
> // Resource type (this is line 16)
> rule "Resource type changes"
>   no-loop
>   activation-group "permissions"
> when
>   check: PermissionCheck(name == "com.christws.entities.ResourceType",
> granted == false)
>   (
>     Role(name == "christws-admin" || "site-admin" ||
> "resource-type-admin")
>     or
>     (
>       $rt: ResourceType( )
>       $perm: ResourceTypePermission( accessType != AccessType.READ )
> from $rt.permissions
>       Role(id == $perm.role.id)
>     )
>   )
> then
>   check.grant();
> end;
>
> I am getting parsing errors with the Role line due to the ""||""||""
> syntax and with the $perm line because of the "from". According to
> [1], these should work.
>
> 23:06:49,082 ERROR [RuleBase] errors parsing rules in:
> /META-INF/entity-rules.drl
> 23:06:49,083 ERROR [RuleBase] unknown:23:37 Unexpected token
> '"site-admin"' (/META-INF/entity-rules.drl)
> 23:06:49,083 ERROR [RuleBase] unknown:23:37 Unexpected token
> '"site-admin"' (/META-INF/entity-rules.drl)
> 23:06:49,083 ERROR [RuleBase] unknown:23:53 Unexpected token
> '"resource-type-admin"' (/META-INF/entity-rules.drl)
> 23:06:49,083 ERROR [RuleBase] unknown:27:6 mismatched token:
> [@170,739:743='$perm',<7>,27:6]; expecting type RIGHT_PAREN
> (/META-INF/entity-rules.drl)
> 23:06:49,083 ERROR [RuleBase] unknown:29:4 mismatched token:
> [@205,859:859=')',<12>,29:4]; expecting type THEN
> (/META-INF/entity-rules.drl)
>
> What am I doing wrong? I am trying to see if the user has one of the 3
> admin roles or has a role whose permission is update or delete (not
> read) (ResourceType has List<ResourceTypePermission> getPermissions()
> which has getAccessType() and getRole()).
>
> Thanks,
> Andrew
>
> [1]
> http://downloads.jboss.com/drools/docs/4.0.3.15993.GA/html_single/index.html
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
  Edson Tirelli
  JBoss Drools Core Development
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20071218/30567457/attachment.html 


More information about the rules-users mailing list