Re: [rules-users] Disable rules at runtime to make sure they get executed only once

2010-02-19 Thread Pavel Tavoda
Of course it doesn't matter which object you use. Use something natural to your project. Mechanism is same. Pavel On Sat, Feb 20, 2010 at 7:58 AM, Malinda Kaushalye wrote: > Many thank Pavel. > But I dont think I followed RuleXor in your reply. But I tried to insert an > event with a key value

[rules-users] Log messages are in not in the expected order

2010-02-19 Thread Malinda Kaushalye
Hi All, Im writing an event driven application where I need to log 1. When a particular event get triggered. 2. When a particular event pattern (condition) is matched. Events are fired both in the Java code as well as within the drools rule RHS. Event patterns are matched in the drools LHS. Th

Re: [rules-users] Retrieve the rule name from the LHS of a rule

2010-02-19 Thread Wolfgang Laun
This is impossible to have in a Rete based RBS, because identical LHS patterns typically result in a single node in the network. Hence, there is, in general, no generic way of obtaining anything related to "source code location" for any LHS expression. -W On Sat, Feb 20, 2010 at 8:11 AM, Malinda K

[rules-users] Retrieve the rule name from the LHS of a rule

2010-02-19 Thread Malinda Kaushalye
Hi All, How do I access the rule name from the LHS of a rule. drools.getRule().getName() works only in RHS. This issue has been raised earlier but there was no answer. http://www.mail-archive.com/u...@drools.codehaus.org/msg01720.html Also I'd like to know the Cheers, Malinda _

Re: [rules-users] Can I do a Collection contains Collection?

2010-02-19 Thread Greg Barton
Absolutely you can use eval. --- On Fri, 2/19/10, EdenAEL20 wrote: > From: EdenAEL20 > Subject: Re: [rules-users] Can I do a Collection contains Collection? > To: rules-users@lists.jboss.org > Date: Friday, February 19, 2010, 10:31 AM > > I have considered doing a custom operator contains al

Re: [rules-users] Rule in decision table

2010-02-19 Thread Wolfgang Laun
Do not use an expression to the left of the comparison operators <, >=, etc. Instead of weight * area > ($param * 453.5924)) use the equivalent weight > ($param * 453.5924)/area -W 2010/2/19 Jeffrey Schneller : > I am trying to write a condition for a decision table and can’t seem to > fi

Re: [rules-users] Disable rules at runtime to make sure they get executed only once

2010-02-19 Thread Malinda Kaushalye
Many thank Pavel. But I dont think I followed RuleXor in your reply. But I tried to insert an event with a key value in the RHS. The same value I used in LHS with other business logic to avoid repeated execution. e.g. when not EventR(Id="KEY") //Other logic then //Other executions in

Re: [rules-users] Authorizing the binary package URL - Drools Guvnor

2010-02-19 Thread Jervisliu
Sartaj Shaik wrote: > Hi, > > I am new to drools guvnor and I have a question regarding the authorization > of binary package. > > To use the rule agent, we have to call it something like.. > > RuleAgent agent = RuleAgent.newRuleAgent("/MyRules.properties"); > RuleBase rb = agent.getRuleBase(); >

Re: [rules-users] Handling listeners when KnowledgeAgent builds new KnowledgeBase

2010-02-19 Thread Esteban Aliverti
I don't know if it is a bug... maybe an enhancement. On Fri, Feb 19, 2010 at 6:11 PM, ljnelson wrote: > > I notice that at line 372 in KnowledgeAgentImpl that a new KnowledgeBase is > built in place of the old one. This is fine, but the listeners and other > objects that are added to the old

Re: [rules-users] Application based rule management

2010-02-19 Thread Esteban Aliverti
Did you try with KnowledgeAgent? Used along with Resource Change Notification and Resource Change Scanner you can poll an entire directory: http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/drools-expert/html_single/index.html#d0e819

Re: [rules-users] Drools Flow: Variable Persistence Strategies

2010-02-19 Thread Salaboy
Yes that's a common practice! Sorry for the delay in my answer. I will try to test and your contribution asap! Greetings! - Ing. Mauricio Salatino - On Feb 19, 2010, at 15:59, Dale Wyttenbach wrote: Here's another idea to bounce off of you: Given StringVariablePersister, you can easily

Re: [rules-users] How many KnowledgeBases?

2010-02-19 Thread Pavel Tavoda
I will show you our approach. We have rules in rule base like: rule "start calculate" when RULE TO START CALCULATION than insert(new CalculateFee("firstFee,secondFee".split(","))) end rule "END calculate" salience -100 when RULE TO START CALCULATION $fee:CalculateFee() than CALCU

Re: [rules-users] How many KnowledgeBases?

2010-02-19 Thread Greg Barton
Agenda groups seems to fit. They are used to specify what mode of processing you're in and what rules fit that mode. The "{handwave handwave}" in that case is not arcane, it's a setFocus() call on the agenda. :) And there's only two ways the system can know what mode it must be in: 1) There's

[rules-users] Rule in decision table

2010-02-19 Thread Jeffrey Schneller
I am trying to write a condition for a decision table and can't seem to figure out how to do it. I have a global variable called area. This is in sq. ft. I have a fact called Item which has an attribute called weight. This is in grams / sq. ft. The Item comes from the attribute calle

[rules-users] Handling listeners when KnowledgeAgent builds new KnowledgeBase

2010-02-19 Thread ljnelson
I notice that at line 372 in KnowledgeAgentImpl that a new KnowledgeBase is built in place of the old one. This is fine, but the listeners and other objects that are added to the old one are not carried over, or explicitly removed. Nor is there a notification (other than a debug message) that su

Re: [rules-users] What is the Best practice of using "Drools Fusion" in a Load balancing environment (ie temporal reasoning between 2 working memories)??

2010-02-19 Thread Amit Kumar
Currently we work off a database to share events for load balancing and issues related to restarts But that takes a hit on performance. It will also be good to have "event type/event content" based expiry times so that we can reduce the size of heap. -Amit 2010/2/19 Chetan Mahadev > > Hi > > Can

[rules-users] What is the Best practice of using "Drools Fusion" in a Load balancing environment (ie temporal reasoning between 2 working memories)??

2010-02-19 Thread Chetan Mahadev
Hi Can anyone tell me how to Implement temporal based event correlation using drools fusion in a load balancing environment. What is the best practice in a situation like this?? Use case : To correlate events which comes into the system with in a time window. Scenario1: Single System Scenario:

[rules-users] How many KnowledgeBases?

2010-02-19 Thread Laird Nelson
Forgive me for what I suspect is an elementary question. That said, I did not see it explained in newcomer-friendly language in the documentation, if at all. And I'm a newcomer! I'm working on a system for--among other things--pricing things. Drools Expert is a great fit for this. The system a

Re: [rules-users] Drools Flow: Variable Persistence Strategies

2010-02-19 Thread Dale Wyttenbach
Here's another idea to bounce off of you: Given StringVariablePersister, you can easily persist things other than Strings, so long as you can construct them from a String. (Boolean, Integer, etc). In the attached patch, I abstracted your StringVariablePersister and created a BooleanVariablePersis

Re: [rules-users] Can I do a Collection contains Collection?

2010-02-19 Thread Ansgar Konermann
EdenAEL20 schrieb: > when I replace Zipcode with type "int" as that is my type drools throws me an > error saying it doesn't recognize the class. Is there some special way to > declare primitive types? > Use the wrapper classes, i. e. Integer instead of int. Since java does autoboxing/unboxing,

Re: [rules-users] Application based rule management

2010-02-19 Thread H.C.
>From the Guvnor manual: 1.3.1.1. Modules There are 2 modules: drools-repository (back end) and drools-guvnor (front end and rules integration). The drools-guvnor module depends on the drools-repository module... I think drools-repository is the component you are looking for here. Is this link

[rules-users] Application based rule management

2010-02-19 Thread Luiz Eduardo Guida Valmont
Hi all, >From what I could grasp after looking at the Guvnor documentation, it provides no API. Since it would be a (very) bad idea to re-develop such (complex) simple feature, I'm wondering whether there is an API to manage a set of rules, poll it for changes and update it accordingly. I cannot

[rules-users] How to use Drools 5 TimeMachine for controlling effective dates?

2010-02-19 Thread H.C.
Hey, I have a use case where we need to retroactively process data using rules, but with the rules that were effective at the time the data was created (maybe a year ago), not at the time the data is run through the engine (today). We are setting effective and expiration dates on our rules to acc

Re: [rules-users] Can I do a Collection contains Collection?

2010-02-19 Thread Wolfgang Laun
The line Set() from RefData.getConstantValues() seems to imply that ConstantValues is a Collection>, but this seems strange. Assuming that ConstantValues is a plain Set, the rule might be written as rule "ex1" when Example( $zips : zips ) $zip : ZipCode() from $zips RefData( constant

Re: [rules-users] Can I do a Collection contains Collection?

2010-02-19 Thread EdenAEL20
I have considered doing a custom operator contains all too. Can't I use the eval for this though like the example below? I haven't tried it yet. class SampleObject{ List IDs; } rule "test" no loop when $h3: Set() from RefData.getIDs() r1: SampleObject() eval ( $h

Re: [rules-users] Can I do a Collection contains Collection?

2010-02-19 Thread EdenAEL20
when I replace Zipcode with type "int" as that is my type drools throws me an error saying it doesn't recognize the class. Is there some special way to declare primitive types? -- View this message in context: http://n3.nabble.com/Can-I-do-a-Collection-contains-Collection-tp217546p217636.html Se

Re: [rules-users] Can I do a Collection contains Collection?

2010-02-19 Thread Greg Barton
Another approach (that I haven't tried, but should work) is to write a custom operator "contains_all" which checks that all members of one Collection are in another. It should be fairly simple to write, as it would use use java.util.Collection.containsAll(Collection) internally. --- On Fri, 2/

Re: [rules-users] Can I do a Collection contains Collection?

2010-02-19 Thread Ansgar Konermann
Hi, untested guess (replace ZipCode by actual type name of your ZIP code data): rule "example" when $validZipCodes: Set() from RefData.getValidZipCodes() Example( $actualZips: zips ) exists( ZipCode( this not memberof $validZipCodes ) from $actualZips ) then error() end

[rules-users] Can I do a Collection contains Collection?

2010-02-19 Thread EdenAEL20
I have an object coming in which contains a collection of id's. I want to verify these id's are in another collection. I'm looking for something like collection is a subset of another collection. any ideas?? zips below is a collection, i want to verify that each zip is in $e1. rule "example"

Re: [rules-users] Disable rules at runtime to make sure they get executed only once

2010-02-19 Thread Pavel Tavoda
Maybe here is some complex support for this but if you use ruleflows than it's complicated however what about (noob idea): rule "first - only once" when not RuleXor( name == "first") ... than insert (new RuleXor("first")); end On Fri, Feb 19, 2010 at 2:01 PM, Malinda Kaus

[rules-users] Disable rules at runtime to make sure they get executed only once

2010-02-19 Thread Malinda Kaushalye
Hi All, I need to write a set of rules that each get executed only ONCE. However, the conditions are met at different stage of execution as events are coming thru a stream. Therefore I need to disable each rule at different stages. I was looking for some mechanism to disable a rule after it gets

Re: [rules-users] Drools

2010-02-19 Thread Wolfgang Laun
Although very far from being an experienced web administrator, I know that you can protect things on a server using a username and a password, which is, in RFC 1738, included in the definition of the URL syntax. -W 2010/2/19 Nilima R > > Hi All , > > > How to prevent the below important URL info

[rules-users] Sending value to decision table ?

2010-02-19 Thread mklaric
What if i want to send some value insted of object in the decision table, how will i write it RuleTable(Integer i) or ?? -- View this message in context: http://n3.nabble.com/Sending-value-to-decision-table-tp217042p217042.html Sent from the Drools - User mailing list archive at Nabble.com. ___

[rules-users] Drools

2010-02-19 Thread Nilima R
Hi All , How to prevent the below important URL information available while building rule packages from unauthorized access. URL for package source: http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/test/LATEST.drl URL for package binary: http://localhost: