<br> Thanks,<br><br> Fixed the docs.<br><br> []s<br> Edson<br><br><div><span class="gmail_quote">2007/12/18, Andrew Robinson <<a href="mailto:andrew.rw.robinson@gmail.com">andrew.rw.robinson@gmail.com</a>>:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Quote from the site:<br><br>Disjunctive field constraints connectives could also be used and would
<br>not result in multiple rule generation.<br> Person( eyeColour == "blue"||"green" )<br><br>Any idea on why the "from" is not correct?<br> $rt: ResourceType( )<br> $perm: ResourceTypePermission( accessType !=
AccessType.READ )<br>from $rt.permissions<br> Role(id == $perm.role.id)<br><br>>From syntax in the docs:<br><a href="http://downloads.jboss.com/drools/docs/4.0.3.15993.GA/html_single/index.html#d0e3867">http://downloads.jboss.com/drools/docs/4.0.3.15993.GA/html_single/index.html#d0e3867
</a><br><br>On Dec 18, 2007 3:59 AM, Edson Tirelli <<a href="mailto:tirelli@post.com">tirelli@post.com</a>> wrote:<br>><br>> Correct is either:<br>><br>><br>> Role(name == "christws-admin" || == "site-admin" || ==
<br>> "resource-type-admin")<br>><br>> Or:<br>><br>> Role(name in ( "christws-admin", "site-admin", "resource-type-admin") )<br>><br>> Where in the docs it says that the syntax you used is correct?
<br>><br>> []s<br>> Edson<br>><br>> 2007/12/18, Andrew Robinson <<a href="mailto:andrew.rw.robinson@gmail.com">andrew.rw.robinson@gmail.com</a> >:<br>> ><br>> ><br>> ><br>> > I upgraed my jboss seam and got the new drools-core and
<br>> > drools-compiler installed. In my maven pom.xml, I am loading 4.0.3 of<br>> > each. My rule is not loading though.<br>> ><br>> > Rule from "entity-rules.drl":<br>> ><br>> > // Resource type (this is line 16)
<br>> > rule "Resource type changes"<br>> > no-loop<br>> > activation-group "permissions"<br>> > when<br>> > check: PermissionCheck(name == "com.christws.entities.ResourceType
",<br>> > granted == false)<br>> > (<br>> > Role(name == "christws-admin" || "site-admin" ||<br>> "resource-type-admin")<br>> > or<br>> > (
<br>> > $rt: ResourceType( )<br>> > $perm: ResourceTypePermission( accessType != AccessType.READ )<br>> > from $rt.permissions<br>> > Role(id == $perm.role.id)<br>> > )<br>
> > )<br>> > then<br>> > check.grant ();<br>> > end;<br>> ><br>> > I am getting parsing errors with the Role line due to the ""||""||""<br>> > syntax and with the $perm line because of the "from". According to
<br>> > [1], these should work.<br>> ><br>> > 23:06:49,082 ERROR [RuleBase] errors parsing rules in:<br>> > /META-INF/entity-rules.drl<br>> > 23:06:49,083 ERROR [RuleBase] unknown:23:37 Unexpected token
<br>> > '"site-admin"' (/META-INF/entity-rules.drl)<br>> > 23:06:49,083 ERROR [RuleBase] unknown:23:37 Unexpected token<br>> > '"site-admin"' (/META-INF/entity-rules.drl
)<br>> > 23:06:49,083 ERROR [RuleBase] unknown:23:53 Unexpected token<br>> > '"resource-type-admin"' (/META-INF/entity- rules.drl)<br>> > 23:06:49,083 ERROR [RuleBase] unknown:27:6 mismatched token:
<br>> > [@170,739:743='$perm',<7>,27:6]; expecting type RIGHT_PAREN<br>> > (/META-INF/entity-rules.drl)<br>> > 23:06:49,083 ERROR [RuleBase] unknown:29:4 mismatched token:<br>> > [@205,859:859=')',<12>,29:4]; expecting type THEN
<br>> > (/META-INF/entity-rules.drl)<br>> ><br>> > What am I doing wrong? I am trying to see if the user has one of the 3<br>> > admin roles or has a role whose permission is update or delete (not<br>
> > read) (ResourceType has List<ResourceTypePermission> getPermissions()<br>> > which has getAccessType() and getRole()).<br>> ><br>> > Thanks,<br>> > Andrew<br>> ><br>> > [1]
<br>> <a href="http://downloads.jboss.com/drools/docs/4.0.3.15993.GA/html_single/index.html">http://downloads.jboss.com/drools/docs/4.0.3.15993.GA/html_single/index.html</a><br>> > _______________________________________________
<br>> > rules-users mailing list<br>> > <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>> > <a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users
</a><br>> ><br>><br>><br>><br>> --<br>> Edson Tirelli<br>> JBoss Drools Core Development<br>> Office: +55 11 3529-6000<br>> Mobile: +55 11 9287-5646<br>> JBoss, a division of Red Hat @
<a href="http://www.jboss.com">www.jboss.com</a><br>> _______________________________________________<br>> rules-users mailing list<br>> <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<br>> <a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>><br>><br>_______________________________________________<br>rules-users mailing list
<br><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div>
<br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com
</a>