[rules-users] unsubscribed from the rules-users mailing list

2014-06-23 Thread Wolfgang Laun
Friends, this is to let you know that I have done as the subject says. I'd like to thank all that have contributed for their continuing efforts. As for myself: I think that this is a good moment to retire, with my rapidly diminishing capability of understanding what's going on in Guvnor, Optaplan

Re: [rules-users] Comparing Objects of same class.

2014-06-19 Thread Wolfgang Laun
This is one of the scenarios that can be handled using CEP (Complex Event Processing) - basically rule logic with some extensions to make time based reasoning more convenient. In Drools, you have @event to declare a fact type as an event type, temporal operators to establish temporal relations betw

Re: [rules-users] Noob question: graph searching, query, root node for a given node

2014-06-18 Thread Wolfgang Laun
Terms like "root" and "parent" are used with trees. You might call these nodes "nodes with indegree 0". -W On 18/06/2014, Borris wrote: > Good question. I'm supporting a graph rather than a tree, so theoretically > there could be more than one node that has no parents. But in my particular > use

Re: [rules-users] Comparing Objects of same class.

2014-06-17 Thread Wolfgang Laun
Let S be the (nonempty) set of all students and d the length of the span of days. There exists a student s0 so that s0.doj is the minimum over all S. Then accumulate and count students x over S so that s0.doj <= x.doj and x.doj < s0.doj + d. If this count exceeds the threshold t: display the studen

Re: [rules-users] Comparing Objects of same class.

2014-06-17 Thread Wolfgang Laun
What have you tried so far? And, please, clarify what you mean by "any 5" in "2 days". For instance: If A, B, C, D, E, F join on 5/24, is this a match? And if G, H, J join additionally on 5/25, is this another match? -W On 17/06/2014, naresh.t wrote: > HI Team, > > We came in situation where we

Re: [rules-users] Drools calculation of a date function

2014-06-16 Thread Wolfgang Laun
Simply write a (static) Java function - it can be easily incorporated into DRL code so that you can use it in rules. BTW: This list is not a Programming Service. If you'd like to hire a consultant: there are people on this list that might help you. -W On 16/06/2014, Ravi wrote: > Hi, >> >> I am

Re: [rules-users] Erratic behaviour of Drools

2014-06-15 Thread Wolfgang Laun
that > changed is not relevant to the reasoner) > - In other words, can we sometimes avoid the modify when manipulating facts > to prevent the rules from being re-evaluated uselessly? > > Thanks! > > > On Sun, Jun 15, 2014 at 3:59 PM, Wolfgang Laun > wrote: > >>

Re: [rules-users] Erratic behaviour of Drools

2014-06-15 Thread Wolfgang Laun
ot;exists" constraint > should have been matched. > > Thanks! > > > On Sun, Jun 15, 2014 at 2:06 PM, Wolfgang Laun > wrote: > >> See inline. >> >> On 15/06/2014, Poissy.B wrote: >> > Hello, >> > >> > I am a little bit confused

Re: [rules-users] Erratic behaviour of Drools

2014-06-15 Thread Wolfgang Laun
See inline. On 15/06/2014, Poissy.B wrote: > Hello, > > I am a little bit confused as I don't get what I am doing wrong. Here is my > rule: > > ** > rule "Exchange Pattern" > when > $p2: ProcessAdapter() > $mainProcess: ProcessAdapter( isMainProcess(),

Re: [rules-users] Analysing OutOfMemory, too many RightTuple

2014-06-12 Thread Wolfgang Laun
On 12/06/2014, bvoisin wrote: > I did not quite understand your last paragraph on a "representative". Do > you have an example I could study ? Given a set of facts that match some constraints, and you want to accumulate them in some way, this approach appears to achieve it: Foo( $bar: bar =

Re: [rules-users] Analysing OutOfMemory, too many RightTuple

2014-06-12 Thread Wolfgang Laun
Before I say something, I should know: * If an EvemetierCalculDHF "accompanies" an EvemetierData object: is this a 1:1 relationship or are there several EvemetierData objects tied to a single EvemetierCalculDHF? * Is EvemetierCalculDHF.evemetier a Collection? (Probably "yes" if the answer to the

Re: [rules-users] Analysing OutOfMemory, too many RightTuple

2014-06-11 Thread Wolfgang Laun
Most of the time, a look on a (representative) sample of the rules is enough for some watchers of this list to drop a few pointers. There are some Best Practices, but people tend to come up with new counter-examples ;-) -W On 11/06/2014, bvoisin wrote: > Hi all, > > With my set of rules and da

Re: [rules-users] Adding eval on rule cause it to run in infinite loop

2014-06-11 Thread Wolfgang Laun
On 11/06/2014, brachi wrote: > example of rule that doesn't work without eval: > > /*rule "1" > salience -1 > agenda-group "agenda1" > when > $conclusion: supportFT() Where's the eval? > then > if($conclusion.getValue()==null){ > m

Re: [rules-users] Adding eval on rule cause it to run in infinite loop

2014-06-11 Thread Wolfgang Laun
On 11/06/2014, Chidambaran Subramanian wrote: > What is the issue in using the no-loop directive? Expert manual, Subsection "Fine grained property change listeners" -W > > Regards > Chiddu > > > On Wed, Jun 11, 2014 at 5:09 PM, Davide Sottara wrote: > >> Could you please show the conditions fo

Re: [rules-users] Adding eval on rule cause it to run in infinite loop

2014-06-11 Thread Wolfgang Laun
Wrapping a constraint into "eval" (for which there's absolutely no need) hides the visibility of the attribute condIsNUMERIC to the "observer" that would avoid the reactivation. -W On 11/06/2014, brachi wrote: > for this Drools Fact Type: > > /* > declare DvFacts0 > @propertyReactive > I

Re: [rules-users] How can we make the 'over window:time' parameter being configurable?

2014-06-11 Thread Wolfgang Laun
It requires a little work (and the timestamp should be an event attribute) to write rules to select facts being in a dynamic window, but it can be done. -W On 11/06/2014, Matteo Mortari wrote: > Hi, > I'm quite intrigued by this question also myself, I would like to know more > about what you m

Re: [rules-users] Are there second-rate fact types?

2014-06-10 Thread Wolfgang Laun
haviour by permitting a fall-back, to >> type unsafe evaluation where all constraints are generated as MVEL >> constraints and executed dynamically. This can be important when dealing >> with collections that do not have any generics or mixed type collections. >> >> >

Re: [rules-users] Are there second-rate fact types?

2014-06-10 Thread Wolfgang Laun
pe collections. > > > Mark > > > On 10 Jun 2014, at 13:45, Davide Sottara wrote: > >> java.util.Collections (and descendants) are not @typesafe by default, >> I'll check the reason for that. >> More generally, if a fact is declared as not @typesafe, the

Re: [rules-users] Are there second-rate fact types?

2014-06-10 Thread Wolfgang Laun
(according to you) java.util.Collections is *not* @typesafe, and this runtime failure cannot be called "graceful". Can a java.util.X be declared as @typesafe? If so, how? Is any of this documented anywhere? -W > Davide > > On 06/10/2014 01:26 PM, Wolfgang Laun wrote: >> Consider: >> &g

[rules-users] Are there second-rate fact types?

2014-06-10 Thread Wolfgang Laun
Consider: class Foo { /*...*/ } rule checkFoo when Foo( noSuchField > 0 ) then ... end DRL compilation reports an error (Error: unable to resolve method ...) and identifies rule, line and column, which is fine. Now let's look at: import java.util.ArrayList; rule checkAr

Re: [rules-users] Grouping of rule and range check

2014-06-06 Thread Wolfgang Laun
Are these seven (or eight) different objects of class Person? -W On 06/06/2014, Chaturvedi Dewashish wrote: > Hi, > > I have a requirement which is as > 1. There are three rules lets say rule1, rule2 and rule3 > 2. rule1 says there is a person > Age < 40 > Age >= 20 >

Re: [rules-users] Drools slowness in first calls

2014-06-05 Thread Wolfgang Laun
Google: JIT Java -W On 05/06/2014, Gael wrote: > Hi, > > We are using Drools for a heavy process and we notice some slowness during > the first calls to kbases (containing about 1500 rules each) using > StatefulKnowledgeSession. > Even if the kbase is "loaded", we need to make some "fictive" cal

Re: [rules-users] Monitoring applications using Drools

2014-06-05 Thread Wolfgang Laun
Goyal > wrote: > > > > Thanks for your quick > response. > I am using 5.3.0 Final version of Drools. Attached are the > necessary files (DRL, fact, test class) required to reproduce the effect. > Please let me know if any further details are required. > > Than

Re: [rules-users] Help write rule drools

2014-06-04 Thread Wolfgang Laun
To remove all redundant Link objects and assuming that class Link is declared as class Link { Node source; Node target; } (and not as given in the original post), the rule: rule "kill redundant links" when $l1: Link( $s: source, $t: target ) $l2: Link( this

Re: [rules-users] Monitoring applications using Drools

2014-06-04 Thread Wolfgang Laun
Your code does: insert 1st event delay 1 minute insert 2nd event delay 1 minute insert 3rd event delay 1 minute delay (1 or) 2 minutes fire all rules In the second case, 5 minutes have elapsed since the 1st insert. I don't think that this means "that [the 1st insert] falls well wit

Re: [rules-users] Grouping of rule and range check

2014-06-04 Thread Wolfgang Laun
On 04/06/2014, Chaturvedi Dewashish wrote: > Hi, > > I have a requirement which is as > 1. There are three rules lets say rule1, rule2 and rule3 > 2. rule1 says there is a person > Age < 40 > Age >= 20 > Then do something > 3. rule2 says there is a person >

Re: [rules-users] Fusion, Insert Events with timestamp in the past.

2014-06-04 Thread Wolfgang Laun
A @timestamp is just an increasing sequence of values - it has no other implications. Cloud vs. stream mode determines how these values should be ordered on insertion. -W On 04/06/2014, SebastianStehle wrote: > Yes, t(measurment) < t(insert). The sensors communicate with the server > with > 3g,

Re: [rules-users] Fusion, Insert Events with timestamp in the past.

2014-06-04 Thread Wolfgang Laun
On 04/06/2014, SebastianStehle wrote: > We made another test with the pseudclock where we advanced the time after > each measurement. > > Lets say we have the two measurements, the first at 10am and the second at > 11am. Based on the rule before, you would expect that the rule fires at > 10:10am b

Re: [rules-users] Fusion, Insert Events with timestamp in the past.

2014-06-04 Thread Wolfgang Laun
On 04/06/2014, SebastianStehle wrote: > I see that the update process is not optimal, but can you tell me if my > simple example should work or not? > > We get measurements from sensors. Because of network delay and other > intermediate processes the timestamp of the measurements can be some > sec

Re: [rules-users] Help write rule drools

2014-06-04 Thread Wolfgang Laun
On 04/06/2014, nill wrote: > One for each pair of connected nodes. One what? Where? With what content? -W > > > > -- > View this message in context: > http://drools.46999.n3.nabble.com/Help-write-rule-drools-tp4029841p4029848.html > Sent from the Drools: User forum mailing list archive at Nabbl

Re: [rules-users] Fusion, Insert Events with timestamp in the past.

2014-06-04 Thread Wolfgang Laun
On 4 June 2014 11:32, SebastianStehle wrote: > I have forgotten to mention that the drools version is 5.5.0.Final, the test > is running in stream mode with a realtime clock. That's just the point. In real time, the past is past. For re-living the past with a different set of rules, you should co

Re: [rules-users] Help write rule drools

2014-06-04 Thread Wolfgang Laun
How do you want the result? Printed lines on standard output? One for each pair of connected nodes, as you have shown it below "result"? Or collected in another fact? -W On 4 June 2014 10:09, nill wrote: > My structure is composed of 2 classes (Node, Link) > class Node { > List out; > List in;

Re: [rules-users] Abstraction between rules and data model?

2014-06-02 Thread Wolfgang Laun
t; aliasing fields to something else; e.g. calculating values for the >>> purpose >>> of rule processing or extracting a value from a more complex object tree >>> etc. Citing the example -- GoldenCustomer( fields[ "age" ] > 18 ) -- >>> being &

Re: [rules-users] Question about Fusion pseudoclock

2014-06-01 Thread Wolfgang Laun
This is code that can be used to manipulate the pseudo-clock which is just a pretty face without any works: SessionPseudoClock clock; private void advance( Date eventDate ){ long currentTime = clock.getCurrentTime(); long eventTime = eventDate.getTime(); clock.adva

Re: [rules-users] Syntax Question on an or condition

2014-05-28 Thread Wolfgang Laun
On 28/05/2014, Chidambaran Subramanian wrote: > rule "Test" > dialect "mvel" > when > ( Customer( age == 50 ) or Deal( amount == 30 ) ) > then > Customer.setAge( "40" ); > update( Customer ); > Customer.setPlace( "Test" ); > update( Customer ); > > end The rule uses inva

Re: [rules-users] Slf4j Log4j logger not working with Drools drl while using as a global variable.

2014-05-27 Thread Wolfgang Laun
@Geoffrey: did you see the java.lang.ArrayIndexOutOfBoundsException? Doesn't look like a null pointer causing an exception. The upstairs exception might add the basic exceptions's message to its message. @Soumya: Which Drools version are you using? Basically, this situation is handled correctly by

Re: [rules-users] Excel Syntax in Decision Tables

2014-05-26 Thread Wolfgang Laun
Oops, sorry: The constraint goes into the leftmost pair of parentheses. Simply exchance to order of the patterns: Classification(); $f: FATCA(); -W On 26/05/2014, crosbis2 wrote: > It's guvnor-5.5.0.Final-jboss-as-7.0 > > Yes i copied your syntax > >

Re: [rules-users] Nested Collect probably

2014-05-26 Thread Wolfgang Laun
It's not possible to use the conditional element "or" inside an accumulate. (Reading up on the "or" CE should give you an idea why.) And that's why I used a boolean expression as a constraint within the third pattern. -W On 26/05/2014, Chris B wrote: > Actually it is a event from an application

Re: [rules-users] Excel Syntax in Decision Tables

2014-05-26 Thread Wolfgang Laun
Which Drools version are you using? The upper case 'T' in "Type == 3" is *very* unlikely. And did you copy this exactly as I posted? Especially the final "()" is essential in the second row. -W On 26/05/2014, crosbis2 wrote: > Hi Laune, > > I tried what you prescribed but get the following in

Re: [rules-users] Abstraction between rules and data model?

2014-05-26 Thread Wolfgang Laun
luations in run time (e.g if > "foo.bars" is used in an expression, we could return "foo.barList") ? By > injecting some custom code, we could make the necessary decisions and > extract the proper value from an object. Unfortunately these parts of > Drools are pretty m

Re: [rules-users] Abstraction between rules and data model?

2014-05-26 Thread Wolfgang Laun
What you describe can be done with /bin/sed. Notice that the DSL processor doesn't require you to translate entire patterns; there is a mechanism for translating "keywords", which is just arbitrary tokens to whatever replacement text. If a "bar" must be translated to a "barList" in the context of

Re: [rules-users] Excel Syntax in Decision Tables

2014-05-26 Thread Wolfgang Laun
As the documentation tries to explain, there are four rows in the heading of acondition column. 1 The first contains CONDITION (or condition). 2 The second defines the class for a Pattern. 3 The third one contains a constraint. 4 The fourth is for a comment. So, use fatca: FATCA(); Classificat

Re: [rules-users] Nested Collect probably

2014-05-26 Thread Wolfgang Laun
Due to imprecise wording, this may or may not be what you want. The rule fires, if there are 5 or more Employees, each of them with the property that - the employee has visited CCNA in year X - the employee has visited CCNP in year X - the employee has visited CCIE or J5SE in 2000 OR

Re: [rules-users] Suspicious behaviour when using a bound variable as a constraint in a pattern bound to the same var

2014-05-22 Thread Wolfgang Laun
1. The constraints are equivalent. $foo is bound to the Foo object, and the getter does what the getter is supposed to do, and it's (probably) visible - so why shouldn't it compile. Version 5.3 or maybe even 5.2 has introduced general boolean expressions - are you using an older version? I don't k

Re: [rules-users] Suspicious behaviour when using a bound variable as a constraint in a pattern bound to the same var

2014-05-22 Thread Wolfgang Laun
Please don't write any more posts like this. You aren't asking a question, as far as I can see - so why do you post? You write, darkly, about suspicions of wrong or unexpected results (which, to be sure, isn't the same thing). This is a big help. -W On 22/05/2014, dec wrote: > Due to a bug w

Re: [rules-users] Drools and GPU

2014-05-19 Thread Wolfgang Laun
19/05/2014, jonathan MERCIER wrote: > About rule structure and / or, i thought that builded graph was in > conjunctive normal form to avoid this problem!? > Should we use conjunctive normal form as is recommended into tho old > CLIPS ? > > > > Le lundi 19 mai 2014 à 19:3

Re: [rules-users] Drools and GPU

2014-05-19 Thread Wolfgang Laun
Graphics Processing Unit??? Gosudarstvennoe Politicheskoe Upravlenie?? So as not to appear too derogative, let me ask how this "resource hunger" exhibits itself. Very frequently, some misconception w.r.t. rule structure and/or data model results in an inadequate resource consumptation that mig

Re: [rules-users] Newbie: is my data model suitable for drools ?

2014-05-17 Thread Wolfgang Laun
In order to judge the quality of a data model for Drools you should have a fairly conclusive idea about the rules you are going to write. (This isn't different from other applications: Storing the data in some organisation may work fine, but fitness for access is a different matter.) The Lists may

Re: [rules-users] Map and modify() can't be together

2014-05-16 Thread Wolfgang Laun
This also works: Map a = new HashMap<>(); More ways to run into an error Map a; a = new HashMap(); etc. Using 6.0.0-Final -W On 17/05/2014, rjh wrote: > Hi, > > I got a weird problem. A Java List/Map with generics can be used together > with modify() in the same rule. For example

Re: [rules-users] forall with nested collections

2014-05-14 Thread Wolfgang Laun
The hierarchical data model is rather unwieldy. A relational model would have the following entities: Person( personId,... ) Vehicle( vehicleId, make,... ) Ownership( personId, vehicleId, year ) and it would be quite easy to handle such questions: Person( $pid: persondId) Ownership

Re: [rules-users] Excel Syntax in Decision Tables

2014-05-13 Thread Wolfgang Laun
That's weird, and it looks like a bug in the build process to me: Java literals are the same for byte, short and int. (CC-ing dev for possible follow-up: You may be asked to furnish a minimal test case.) As a workaround, use this in the Action column: ...; TaskTemplate1.setId( (short)$param );.

Re: [rules-users] Wildcard or list directory in changeset?

2014-05-13 Thread Wolfgang Laun
Expert manual, search for "change-set", there you'd find: "It is also possible to specify a directory, to add the contents of that directory. It is expected that all the files are of the specified type, since type is not yet inferred from the file name extensions." ...and even an example! -W O

Re: [rules-users] Excel Syntax in Decision Tables

2014-05-12 Thread Wolfgang Laun
On 12/05/2014, crosbis2 wrote: > Thanks for the quick replies!! > > So am i naive in thinking if i get the source code of my imported decision > table to match that of a predefined rule that the excel based rule will > work? > > Thats what i have now: > Example 1 is a validated working rule. > Exa

Re: [rules-users] Excel Syntax in Decision Tables

2014-05-12 Thread Wolfgang Laun
On 12/05/2014, crosbis2 wrote: > > > i'm still quite new to this i'm afriad. > I've been able to get every line except 7 and 9 to import and look the > exact same in "view source". > > I don't understand "prefix the empty pattern to an

Re: [rules-users] Excel Syntax in Decision Tables

2014-05-12 Thread Wolfgang Laun
Concerning line 7: You can prefix the empty pattern to another pattern: taskTemplates : TaskTemplates( ) RuleSet( r... ) Lines 9, 10, 11: You can't write this using the "pattern/constraint approach", it's Java statements. See the documentation. -W On 12/05/2014, crosbis2 wrote: > Hi, > > I

Re: [rules-users] Rules don't execute using MVEL syntax in RHS - Possible Bug

2014-05-12 Thread Wolfgang Laun
On 12/05/2014, jlprat wrote: > Hi, > I also thing there is something buggy with salience and the planner. > However, what puzzles me is that this behavior is changed when using the > getter instead of the direct access to the property. > > Do you know if there is already a reported bug like this?

Re: [rules-users] Rules don't execute using MVEL syntax in RHS - Possible Bug

2014-05-12 Thread Wolfgang Laun
Repeated executions show varying results: sometimes it's OK, sometimes it isn't. I don't think it's a race condition in your code (although proper syncing on the map would be the "clean" way to go). I think that salience doesn't work properly )(6.0.0, OP used 6.0.1.), if a fact is matched uncondi

Re: [rules-users] Rules don't execute using MVEL syntax in RHS - Possible Bug

2014-05-09 Thread Wolfgang Laun
You are using a class called KnowledgeBuilder. With Drools 6, it is KieBuilder. Here is some simple code, good for testing (as I used it), although more sophisticated build procedures are recommended using maven and what not. - Both DRL versions (getAbxDef and abcDef) appear to work with 6.0.0 Fina

Re: [rules-users] Rules don't execute using MVEL syntax in RHS - Possible Bug

2014-05-09 Thread Wolfgang Laun
MVEL has nothing to do with the possibility of using abcXyz in a constraint instead of the more cumbersome getAbcXyz(). Actually, abcXyz is the "native" way of accessing a fact's attribute from within DRL patterns. So, if getAbcXyz() works, but abcXyz does not, I suspect that something else is ami

Re: [rules-users] Restrict size/resource usage of drools session

2014-05-08 Thread Wolfgang Laun
If you can set a limit for activations following one insert, an AgendaEventListener registering Before/AfterMatchFired is the natural choice. You might also limit secondary insertions (WorkingMemoryEventListener: ObjectInsertedEvent) or fact updates (ObjectUpdatedEvent). All of this is highly depe

Re: [rules-users] Restrict size/resource usage of drools session

2014-05-08 Thread Wolfgang Laun
There are options to restrict the size of the JVM memory allocation pool. Loops can go over two or more rules, so take care. Catching such loops is possible, up to a limit. -W On 08/05/2014, kurrent93 wrote: > Hi > > We have an application where users write their own rules via a UI, and > these

Re: [rules-users] Question about length windows

2014-05-01 Thread Wolfgang Laun
A window:length is filled depending on the constraints but independent of how old the participating facts are. What you want to achieve can be done without windows: t2_1 : Tick( value < 102.352 ) t1_1 : Tick( this before t2_1 , value >= 102.352 ) not Tick( this before t2_1 && after t1_1

Re: [rules-users] Is there a better way to write this rule?

2014-04-23 Thread Wolfgang Laun
On 23/04/2014, Bharadwaj N wrote: > rule "Discount Egypt" > salience 0 > when > $T : TripRequest ( destination == "Egypt" ) > $dest: DiscountResult() This is wrong: the rule will not fire unless there is a DiscountResult fact in working memory. > then > $d

Re: [rules-users] (Hot?) rules production deployment

2014-04-22 Thread Wolfgang Laun
Another technique to prevent non-programmers to wreak havoc is to put them on the leash of a domain specific language (DSL). But developing a non-trivial DSL is hard work, and you might find that you just spend your money in a different way. Moreover, anything that's not too restrictive must, by de

Re: [rules-users] Drools Fusion Dropping Actions to Events?

2014-04-22 Thread Wolfgang Laun
On 22/04/2014, Chandra Sekhar Divi wrote: > Thanks a lot for the information. > Adding 'Thread.sleep(1);' after every insert reduces the problem intensity, > but sometimes even this solution also does not perform all the expected > actions (May be some events are dropped due to race condition). >

Re: [rules-users] Drools Fusion Dropping Actions to Events?

2014-04-21 Thread Wolfgang Laun
This seems to be a race condition, the KIE session not being thread-safe: if events are inserted in a tight loop, about 50% simply evaporate. Using Thread.sleep(1) after each insert avoids all losses, but that's hardly a feasible workaround, since this doesn't guarantee that the thread running the

Re: [rules-users] Unit testing a Single rule from a large set of DRL and DSL files.

2014-04-21 Thread Wolfgang Laun
If you do that, you won't be unit-testing the rule as it operates in cahoots with all other rules :-) You could put that rule on a DRL file of its own and compile, create the KB and run the session. There should be a way to manipulate a Knowledge Package, handle rules one by one. But that's not a

Re: [rules-users] Unit testing a Single rule from a large set of DRL and DSL files.

2014-04-21 Thread Wolfgang Laun
You don't lose anything when you use a stateful session, most certainly not for unit-testing a rule. -W On 21/04/2014, alanvarghese wrote: > Thank you that was a big help. > But I see that I cannot use a StatelessKieSession to do that. > > I have to use a Stateful Session. > Is there anyway I ca

Re: [rules-users] Collect all occurrences of resulting data.

2014-04-21 Thread Wolfgang Laun
Just an additional hint: it's possible to switch between agenda groups (sorry for using the wrong term, but I didn't confuse you, did I?) from within rules as well. -W On 21/04/2014, Ephemeris Lappis wrote: > Hello again. > > It seems clear that too many salience levels would make it all worse !

Re: [rules-users] Unit testing a Single rule from a large set of DRL and DSL files.

2014-04-21 Thread Wolfgang Laun
Implement the interface org.kie.api.runtime.rule.AgendaFilter and pass it in with fireAllRules. -W On 21/04/2014, alanvarghese wrote: > Hi There, > > I want to unit test a single rule from a set of multiple rules within > multiple DRL files. > Is there a way to do that? > I am using > > Drools 6

Re: [rules-users] Collect all occurrences of resulting data.

2014-04-21 Thread Wolfgang Laun
I recommend at most 3 levels of salience, and only if you have a very limited scenario of insert / fire. Alternatively, you can use agenda groups. If I understand you correctly, you have some rules that execute "Before" and others that should execute "After". In your .drl, activation-group "Befo

Re: [rules-users] Collect all occurrences of resulting data.

2014-04-21 Thread Wolfgang Laun
This is one of the (rare) cases where I'd advocate salience. rule "Collect results when complete" salience -99 when $all : List from collect(Result()) then ...do something with $all... end -W On 21/04/2014, Ephemeris Lappis wrote: > Hello. > > I'm lookin

Re: [rules-users] Drools causes switch(enum e) to break?

2014-04-14 Thread Wolfgang Laun
This would mean that setting a project as "Drools project" has an impact on the compilation of plain old Java code? That would be an evil bug in some Drools plugin. Posting all the details might interest the Drools developer group. -W On 14/04/2014, Leonard93 wrote: > The enum is called RuleType

Re: [rules-users] Drools causes switch(enum e) to break?

2014-04-14 Thread Wolfgang Laun
RuleType*s* or RuleType? Also, you are posting Java code. How is this related to Drools? Above all, post error messages in full, stating when and due to which command they are emitted. -W On 14/04/2014, Leonard93 wrote: > So I have a really weird problem and I think it could be relate-able to

Re: [rules-users] Problem with Collection

2014-04-12 Thread Wolfgang Laun
Making the rules more complicated in order to achieve control over sending messages to some other application does not strike me as the best option. As an alternative, processed facts could be collected on the interface between Drools and your application A. -W On 13 April 2014 05:26, mohanm

Re: [rules-users] Problem with Collection

2014-04-12 Thread Wolfgang Laun
On 12 April 2014 12:57, mohanm wrote: > Hi laune, > > Number of facts inserted into the working memory will be high at times. > Events are facts for us. After first fact matching condition in the working > memory, we want to wait for few seconds to collect similar facts and do an > action on tha

Re: [rules-users] Problem with Collection

2014-04-11 Thread Wolfgang Laun
If there is no cogent reason for collecting a List and acting on it you should match a single Alarm and update it on the rule's right hand side: rule "Rule [Alarm Collection]" when $alarm: Alarm ( justInserted == true ) then modify( $alarm ){ setJustInserted( false ) }

Re: [rules-users] Identical Facts over rules, results being cached?

2014-04-09 Thread Wolfgang Laun
If it's general enough, it is not something to be shrugged off as "not that hard". You'll have to keep the fact and memorize all rules it fires, and create a mechanism that'll let you call right hand sides when the duplicate fact arrives and with all variables bound to the same values. Huh! -W O

Re: [rules-users] Identical Facts over rules, results being cached?

2014-04-09 Thread Wolfgang Laun
OMG, if it would do *that*, its memory consumption would be enormous, and it wouldn't be much faster, given all the overhead this would create, and with more GC effort, and the bugs it would introduce (evil me ;-) ) -W On 09/04/2014, Leonard93 wrote: > Let's say I have 10 rules and I fire the sam

Re: [rules-users] processing a database with many to many Relationships

2014-04-08 Thread Wolfgang Laun
It depends on the rules you're going to have. Usually the relational (normalized) form lends itself well to writing rules. OTOH, Drools provides "from" for unravelling List attributes, and you can use "collect" to create a Collection from separate facts. But, before refactoring the data you have,

Re: [rules-users] KIE API for Decision Tables Templates

2014-04-07 Thread Wolfgang Laun
You'll find the classes for dsecision table parsing and DRL building in and below org/drools/decisiontable/... Sources are in the jar drools-decisiontables-6.X.X.Final-sources.jar -W On 07/04/2014, Andrei Ermicioi wrote: > Hi there! > > I was looking on web to find if KIE provide any API for re

Re: [rules-users] Random rule fire

2014-04-03 Thread Wolfgang Laun
Second thoughts: it might be easier to add code to the right hand side to achieve this random firing. On 3 April 2014 09:04, Wolfgang Laun wrote: > You can insert a fact containing the random number and add a pattern with > the constraint. Where is the problem? > > > On 2 A

Re: [rules-users] Random rule fire

2014-04-03 Thread Wolfgang Laun
You can insert a fact containing the random number and add a pattern with the constraint. Where is the problem? On 2 April 2014 23:45, vvicky72 wrote: > We have a unique situation. Using guided decision tables, we want a > particular rule to fire randomly even when all the conditions on the "wh

Re: [rules-users] Resource scanning happens mpre than configured interval

2014-03-31 Thread Wolfgang Laun
The time stamps have an interesting property: alternate groups of 4 lines are exactly one hour apart. Is it quite inconceivable that you have two scanners running concurrently? -W On 31 March 2014 17:19, san_hegde wrote: > Hi, > > > > I have configured Resource Scanner to scan at the interva

Re: [rules-users] Activation-group and salience

2014-03-29 Thread Wolfgang Laun
The full reason why the second one fires, although it is in the same activation group: . insert Transaction with amount < 100 . there are activations for both rules . rule 1 fires, cancelling the actication for rule 2 (due to AG "Group1" . rule 1 updates the matched transaction, causing another ac

Re: [rules-users] How to do word match in drools?

2014-03-27 Thread Wolfgang Laun
the backslash, as in Java. If the same borderline case should hold for pizza and others, you could use brandName matches "(?i).*\\b(cyber|internet|pizza|restaurant|sushi)\\b.*" All of this is untested, but it shouldn't be very far off the mark. -W > > Best > &g

Re: [rules-users] How to do word match in drools?

2014-03-27 Thread Wolfgang Laun
You can use == to compare strings. For a more comprehensive answer, ask a more detailed question. -W On 26/03/2014, Yuan, Stacy [DBA] wrote: > For example, word sushi > I do not want sushie show up and shsushi show up when we do drools match. > > Thanks > Stacy > __

[rules-users] 5.6.0 Final - Weird bug with double multiplication

2014-03-26 Thread Wolfgang Laun
See this: http://stackoverflow.com/questions/22610325/double-value-getting-set-to-0 Looks very much like a nasty bug, x*y resulting in 0 when x!=0 && y!=0. -W ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/lis

Re: [rules-users] Drools Fusion inconsistencies at increasing event throughputs

2014-03-25 Thread Wolfgang Laun
A rule with timer will only continue firing if its first true state remains constant. This means that you can't do what you want to do this way. (You might set up a rule with a repeating or cron timer that inserts a Trigger fact that triggers the accumulate and is retracted, or do some similar haqu

Re: [rules-users] Performance of rules in Drools

2014-03-23 Thread Wolfgang Laun
For efficiency at runtime (in term of response time), we want to know if > "code only one rule (with the parameter as a fact in when clause) and > *not *generate > different rules for different parameters" will be more efficient or not ? > > Regards > Sébastien > >

Re: [rules-users] Performance of rules in Drools

2014-03-21 Thread Wolfgang Laun
"More efficient" w.r.t. runtime, maintenance, development effort,...? Writing individual rules is quick, bad for maintenance, and probably best, if a session has only a few inputs as it starts fast from a precompiled rule base. Parameter facts take a little time for development, are very good for

Re: [rules-users] Not able to detect how to correct ERR 102

2014-03-21 Thread Wolfgang Laun
The corrected version of dsl and dslr works fine. --- [condition][]There is a Customer with first name {name}= $customer : Customer(firstName == {name}) [consequence][]Greet Customer= System.out.println("Hello " + $customer.getFirstName()); --- pa

Re: [rules-users] How to allow non-programmers/non-Drools programmers to define rules

2014-03-21 Thread Wolfgang Laun
Here is a demo for a DSL development: Chapter 5 in http://members.inode.at/w.laun/drools/DomainSpecificLanguages/DomainSpecificLanguages.pdf -W On 21/03/2014, Stephen Masters wrote: > DSL is essentially just templates which map phrases (which may look a bit > like natural language) to DRL. >

Re: [rules-users] Needs advice to help Drools on a big problem (and avoid GC overhead)

2014-03-20 Thread Wolfgang Laun
I may fail to understand the fundamentals of this problem, but it seems to me that it doesn't have the dynamic requirements that would warrant a full "blow up" of all Resources and Operations at the same time. We have the 300 rules, and I'm assuming that the pattern is the one shown in OP's mail:

Re: [rules-users] Sliding window "full" length question

2014-03-20 Thread Wolfgang Laun
I'd start a one-shot timer on the arrival of the first Event, to fire after 60 seconds and insert an auxiliary fact "OneMinute" and make those rules depend on the presence of this fact. (Hint: Use extends) -W On 20/03/2014, GrantWang wrote: > Hi, I found the following statements in Drools docume

Re: [rules-users] Confirm the usage of agenda-groups

2014-03-19 Thread Wolfgang Laun
Seems OK to me. -W On 19/03/2014, djb wrote: > Hi all, > > Sorry if it seems like this is an old question, but it's hard finding a > simple unambiguous example. It's a stack, right? So I push them on > 'backwards'. > > I've got 5 groups of rules, and I want the groups to fire in the order I've

Re: [rules-users] Drools Case Based Reasoning

2014-03-18 Thread Wolfgang Laun
On 18/03/2014, gboro54 wrote: > That is correct and that is my thought. My company I feel likes to over > complicate things at times. My thought would be to use drools queries to > handle the searching of previous cases for the solution. Does that seem > like > a reasonable approach? I'd have to

Re: [rules-users] Drools Case Based Reasoning

2014-03-18 Thread Wolfgang Laun
CBR as in http://en.wikipedia.org/wiki/Case-based_reasoning? If the number of identical variables, added with weights, is the target function, a simple search strategy should be sufficient for finding the best past case. -W On 18/03/2014, gboro54 wrote: > This sounds like something that could

Re: [rules-users] problem in sliding window

2014-03-17 Thread Wolfgang Laun
On 17/03/2014, Sandhya Sree wrote: > declare window Ticks > Event() > over window:time(1m ) > end Is there any documentation snippet that says you can declare a fact (not even an event) like this, restricting its existence? If not, why does this not cause an compilation error? -W _

Re: [rules-users] (no subject)

2014-03-17 Thread Wolfgang Laun
Above all, realize that only facts *insert*-ed into Working Memory can be taken into account by rules. So, first thing, insert the Event in rule "size". Then you can, basically, write a rule like this: rule "size" when $p: RuleContext($size: getOldContext().getParent().getUsableSpace() > (30*10

  1   2   3   4   5   6   7   8   9   10   >