Sikkandar,
regard a rule-semaphore as a "guard": It's a variable which you use
on left hand side of rules:
rule 1
when Guard g
<other conditions>
then
<RHS>
end
You can set the semaphore in any other rule to control which other
rules you want to disable or enable...
(If you need background on semaphores, have a look in Operating-
Systems literature)
regards,
Gernot
Am 08.11.2007 um 08:40 schrieb Sikkandar Nawabjan:
> 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 <mproctor(a)codehaus.org>
> Subject: Re: [rules-users] RE: How to stop firing rules from dependent
> object
> To: Rules Users List <rules-users(a)lists.jboss.org>
> Message-ID: <47321EA9.7060100(a)codehaus.org>
> 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
> sikkandar.nawabjan(a)ust-global.com <mailto:sikkandar.nawabjan@ust-
> global.com>
> T: +91-471-2335777 Extn: 6802036
> M: +91-9946555330
> F: +91-471-2527276
>
> ________________________________
>
> From: rules-users-bounces(a)lists.jboss.org on behalf of rules-users-
> request(a)lists.jboss.org
> Sent: Thu 11/8/2007 5:21 AM
> To: rules-users(a)lists.jboss.org
> Subject: rules-users Digest, Vol 12, Issue 16
>
>
>
> Send rules-users mailing list submissions to
> rules-users(a)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
> rules-users-request(a)lists.jboss.org
>
> You can reach the person managing the list at
> rules-users-owner(a)lists.jboss.org
>
> 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" <adrian.cowham(a)gmail.com>
> Subject: [rules-users] inconsistency with 'collect' and the '||'
> operator
> To: rules-users(a)lists.jboss.org
> Message-ID:
> <470fffa10711071035o4792e8ebs65c3d16551f10859(a)mail.gmail.com>
> 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"
>