am sorry i understand partially. i don't know to use semaphores to control rule. can you give some example Message: 4 Date: Wed, 07 Nov 2007 20:23:05 +0000 From: Mark Proctor <[EMAIL PROTECTED]> Subject: Re: [rules-users] RE: How to stop firing rules from dependent object To: Rules Users List <rules-users@lists.jboss.org> Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="iso-8859-1"
you'll have to setup rules that detect the state of the working memory that then uses semaphores to control which rules can fire. Mark Sikkandar Nawabjan wrote: > Hi, > > I have 2 Objects and its corresponding drl/dsls to validate the rule > > ObjectA - A.drl,A.dsl > > ObjectB - B.drl,B.dsl > > when i insert ObjectA i want the rules in A.drl to be fired. > > when i insert ObjectB along with ObjectA i want to fire rules only from B.drl > > There are some rule in B.drl requires ObjectA.so i need to insert always > ObjectA with ObjectB. At the same time i don't want the rule from A.drl > > How to do that? > > Thanks and Regs, > > Basha > Sikkandar Basha Tech Lead WPEPDS UST Global<http://intranet.ustri.com/email/UST-logo.jpg> B5N 144, Bhavani Technopark, Trivandrum, India [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> T: +91-471-2335777 Extn: 6802036 M: +91-9946555330 F: +91-471-2527276 ________________________________ From: [EMAIL PROTECTED] on behalf of [EMAIL PROTECTED] Sent: Thu 11/8/2007 5:21 AM To: rules-users@lists.jboss.org Subject: rules-users Digest, Vol 12, Issue 16 Send rules-users mailing list submissions to rules-users@lists.jboss.org To subscribe or unsubscribe via the World Wide Web, visit https://lists.jboss.org/mailman/listinfo/rules-users or, via email, send a message with subject or body 'help' to [EMAIL PROTECTED] You can reach the person managing the list at [EMAIL PROTECTED] When replying, please edit your Subject line so it is more specific than "Re: Contents of rules-users digest..." Today's Topics: 1. inconsistency with 'collect' and the '||' operator (Adrian Cowham) 2. Re: inconsistency with 'collect' and the '||' operator (Adrian) 3. RE: Combine DSL and Java Code? (Raj, Govinda (Mohan)) 4. Re: RE: How to stop firing rules from dependent object (Mark Proctor) 5. Re: inconsistency with 'collect' and the '||' operator (Mike D) 6. Re: Combine DSL and Java Code? (Edson Tirelli) ---------------------------------------------------------------------- Message: 1 Date: Wed, 7 Nov 2007 10:35:17 -0800 From: "Adrian Cowham" <[EMAIL PROTECTED]> Subject: [rules-users] inconsistency with 'collect' and the '||' operator To: rules-users@lists.jboss.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="iso-8859-1" I'm running into an issue where the || operator embedded in a collect CE isn't working as expected. The rule I have is rule Grant Access" when $request : AccessRequest($name : username, $ID : sessionID, $loc : accessLocation, $day : dayOfAccess) $user : NetworkUser(username == $name) $group : UserGroup(users contains $user) $locationRules : ArrayList(size > 0) from collect (AccessRule((allowedLocation == "ANY" || allowedLocation == $loc), allowAccess == "false") from $group.getRules()) then # access granted end The issue I'm having is with AccessRule((allowedLocation == "ANY" || allowedLocation == $loc), allowAccess == "false"), this translate to "all access rules that have the allowed location set to ANY or set to the location the user is logging in from". I created a UserGroup named " super.users" that contains a user named "root" and a single rule that allows access from ANY location. However, when I simulate a login with "root" -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/rules-users/attachments/20071107/451e832f/attachment-0001.html ------------------------------ Message: 2 Date: Wed, 7 Nov 2007 19:53:36 +0000 (UTC) From: Adrian <[EMAIL PROTECTED]> Subject: [rules-users] Re: inconsistency with 'collect' and the '||' operator To: rules-users@lists.jboss.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=us-ascii Adrian Cowham <adrian.cowham <at> gmail.com> writes: > > I'm running into an issue where the || operator embedded in a collect CE isn't working as expected. The rule I have is rule Grant Access" > when > $request : AccessRequest($name : username, $ID : sessionID, $loc : accessLocation, $day : dayOfAccess) > $user : NetworkUser(username == $name) > $group : UserGroup(users contains $user) > $locationRules : ArrayList(size > 0) from > collect (AccessRule((allowedLocation == "ANY" || allowedLocation == $loc), allowAccess == "false") > from $group.getRules()) > then > # access grantedendThe issue I'm having is with AccessRule((allowedLocation == "ANY" || allowedLocation == $loc), allowAccess == "false"), this translate to "all access rules that have the allowed location set to ANY or set to the location the user is logging in from". I created a UserGroup named " > super.users" that contains a user named "root" and a single rule that allows access from ANY location. However, when I simulate a login with "root" > > _______________________________________________ > rules-users mailing list > rules-users <at> lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users > Please ignore this email, I sent this one by accident pre-maturely. I sent my final draft shortly after. Sorry. a ------------------------------ Message: 3 Date: Wed, 7 Nov 2007 17:46:46 -0000 From: "Raj, Govinda (Mohan)" <[EMAIL PROTECTED]> Subject: RE: [rules-users] Combine DSL and Java Code? To: "Rules Users List" <rules-users@lists.jboss.org> Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="utf-8" Try changing DSL from [consequence][]write "{value}" to stdout=System.out.println("{value}"); To [consequence][]write {value} to stdout=System.out.println( {value} ); And see if it works. --Mohan -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Markus Helbig Sent: Wednesday, November 07, 2007 8:09 AM To: rules-users@lists.jboss.org Subject: [rules-users] Combine DSL and Java Code? Hi, following example: Item Class: public class MyItem { public MyItem() {} public String getMessage() { return "Hello World!"; } } DSL: [condition][]is of type MyItem=MyItem() [consequence][]write "{value}" to stdout=System.out.println("{value}"); DSRL File: rule when $item: is of type MyItem then write $item.getMessage() to stdout end Is this "write $item.getMessage() to stdout" possible in any way? Currently i'm not able to get it to work ... Cheers Markus _______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 4786 bytes Desc: not available Url : http://lists.jboss.org/pipermail/rules-users/attachments/20071107/7f583b3a/smime-0001.bin ------------------------------ Message: 4 Date: Wed, 07 Nov 2007 20:23:05 +0000 From: Mark Proctor <[EMAIL PROTECTED]> Subject: Re: [rules-users] RE: How to stop firing rules from dependent object To: Rules Users List <rules-users@lists.jboss.org> Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="iso-8859-1" you'll have to setup rules that detect the state of the working memory that then uses semaphores to control which rules can fire. Mark Sikkandar Nawabjan wrote: > Hi, > > I have 2 Objects and its corresponding drl/dsls to validate the rule > > ObjectA - A.drl,A.dsl > > ObjectB - B.drl,B.dsl > > when i insert ObjectA i want the rules in A.drl to be fired. > > when i insert ObjectB along with ObjectA i want to fire rules only from B.drl > > There are some rule in B.drl requires ObjectA.so i need to insert always > ObjectA with ObjectB. At the same time i don't want the rule from A.drl > > How to do that? > > Thanks and Regs, > > Basha > > > ------------------------------------------------------------------------ > > _______________________________________________ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/rules-users/attachments/20071107/04f8801f/attachment-0001.html ------------------------------ Message: 5 Date: Wed, 7 Nov 2007 13:36:33 -0800 (PST) From: Mike D <[EMAIL PROTECTED]> Subject: Re: [rules-users] inconsistency with 'collect' and the '||' operator To: rules-users@lists.jboss.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=us-ascii did you try AccessRule((allowedLocation in ("ANY", $loc)? Adrian Cowham wrote: > > I'm running into an issue where the || operator embedded in a collect CE > isn't working as expected. The rule I have is > > rule Grant Access" > when > $request : AccessRequest($name : username, $ID : sessionID, $loc : > accessLocation, $day : dayOfAccess) > $user : NetworkUser(username == $name) > $group : UserGroup(users contains $user) > $locationRules : ArrayList(size > 0) from > collect (AccessRule((allowedLocation == "ANY" || > allowedLocation > == $loc), allowAccess == "false") > from $group.getRules()) > then > # access granted > > end > > > The issue I'm having is with AccessRule((allowedLocation == "ANY" || > allowedLocation == $loc), allowAccess == "false"), this translate to "all > access rules that have the allowed location set to ANY or set to the > location the user is logging in from". I created a UserGroup named " > super.users" that contains a user named "root" and a single rule that > allows > access from ANY location. However, when I simulate a login with "root" > > _______________________________________________ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users > > -- View this message in context: http://www.nabble.com/inconsistency-with-%27collect%27-and-the-%27%7C%7C%27-operator-tf4766961.html#a13636646 Sent from the drools - user mailing list archive at Nabble.com. ------------------------------ Message: 6 Date: Wed, 7 Nov 2007 14:50:36 -0200 From: "Edson Tirelli" <[EMAIL PROTECTED]> Subject: Re: [rules-users] Combine DSL and Java Code? To: "Rules Users List" <rules-users@lists.jboss.org> Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="iso-8859-1" Markus, did you tried: [consequence][]write {value} to stdout=System.out.println({value}); With the line: write $item.getMessage() to stdout []s Edson 2007/11/7, Markus Helbig <[EMAIL PROTECTED]>: > > Hi, > > following example: > > Item Class: > > public class MyItem { > > public MyItem() {} > > public String getMessage() > { > return "Hello World!"; > } > > } > > DSL: > > [condition][]is of type MyItem=MyItem() > [consequence][]write "{value}" to stdout=System.out.println("{value}"); > > DSRL File: > > rule > when > $item: is of type MyItem > then > write $item.getMessage() to stdout > end > > Is this "write $item.getMessage() to stdout" possible in any way? > Currently i'm not able to get it to work ... > > Cheers > > Markus > _______________________________________________ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users > -- Edson Tirelli Software Engineer - JBoss Rules Core Developer 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/20071107/fb33c17d/attachment.html ------------------------------ _______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users End of rules-users Digest, Vol 12, Issue 16 *******************************************
<<winmail.dat>>
_______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users