[rules-users] RE : Identity Mode?

2013-06-20 Thread Bruno FREUDENSPRUNG
Hi, I think you are talking about the assert behavior: KnowledgeBaseConfiguration configuration = KnowledgeBaseFactory.newKnowledgeBaseConfiguration(); configuration.setOption(AssertBehaviorOption.EQUALITY); But I think you will have to add a condition like... : p1 : Person() Person(this !=

Re: [rules-users] Accumulate / collect

2011-11-16 Thread Bruno Freudensprung
Hi Wolfgang, hi Estaban, Many thanks for your insights! I'll stick to a custom accumulate function since it is more consice than the init/action/result approach. And since I am using Drools 5.1.1, I'll create functions named collectList and collectSet to be future proof :-) Best regards,

Re: [rules-users] Accumulate / collect

2011-11-16 Thread Bruno Freudensprung
Just tested and... you are right (although they are not mentioned in the documentation)! :-). Great! Thanks a lot Esteban! Bruno. Le 16/11/2011 10:50, Esteban Aliverti a écrit : As far as I know, these 2 functions already exist in 5.1.1. Don't they? Best Regards,

[rules-users] Accumulate / collect

2011-11-15 Thread Bruno Freudensprung
Hi all, There is something I can't express using collect or accumulate and I would like to have your opinion. Let's imagine I have the following types : # a country type *declare Country name : String end * # a city type holding a reference to its country *declare

Re: [rules-users] A little suggestion about the 'ResourceFactory', 'DrlParser' API

2011-11-10 Thread Bruno Freudensprung
Maybe there is something I don't understand, but I also have the impression that encoding management is strange in Drools. The lexer = new DRLLexer( new ANTLRInputStream( is ) ); line indeed leads to using the default encoding of the machine. It is the same for the CSV parser (rule

Re: [rules-users] Data Modeling for medical expert system

2011-11-08 Thread Bruno Freudensprung
Hi Dirk, Good to see that I am not the only one fighting with that question :-). I guess the general answer is: it depends on how large your enums might grow. For instance if your application is eventually supposed to help diagnosing (say) all MeSH diseases based on all MeSH symptoms, then an

[rules-users] Bugs in rule templates?

2011-11-03 Thread Bruno Freudensprung
Hi all, I am writing rules using Drools Templates and I noticed strange problems (ocurring when I slightly modify a DRT that works well): 1. the template instanciation depends on the declarations order of the parameters in the template header 2. if the rule template does not contain

Re: [rules-users] Thoughts about rule authoring

2011-09-19 Thread Bruno Freudensprung
On 16 September 2011 16:37, Bruno Freudensprung bruno.freudenspr...@temis.com mailto:bruno.freudenspr...@temis.com wrote: Hi, I have a remark, maybe its just out of scope... however as it is in the perspective of enabling end users to deal with their business domain, leaving

Re: [rules-users] Questions about Drools, Eclipse, Guvnor

2011-09-19 Thread Bruno Freudensprung
; but we have already identified the need: https://issues.jboss.org/browse/GUVNOR-1402 Unfortunately it is on the list and I (we) can't commit to a time-frame in which it'll be fixed... pull requests always welcome :) With kind regards, Mike On 16 September 2011 16:26, Bruno Freudensprung

[rules-users] Questions about Drools, Eclipse, Guvnor

2011-09-16 Thread Bruno Freudensprung
Hi, I've taken an look at the Roadmap in JIRA but, as I haven't found what I'm looking for, here I am :-). Today I read a message of Michael Anstis telling that BRL editor support has been dropped since 5.2, and I have a question: how do you see the future concerning rule authoring within

[rules-users] Thoughts about rule authoring

2011-09-16 Thread Bruno Freudensprung
Hi, I have a remark, maybe its just out of scope... however as it is in the perspective of enabling end users to deal with their business domain, leaving appart the technical aspects (which is one of strong points of Drools), here it is. Drools is great because it enables to express things

Re: [rules-users] Question about custom accumulation functions

2011-09-14 Thread Bruno Freudensprung
Hi Edson, Good news: the problem does not happen, neither with the 5.2.0.Final nor with the latest snapshot. Best regards, Bruno. Le 08/09/2011 17:17, Edson Tirelli a écrit : Bruno, Can you please test it with latest snapshot? If it is still a problem, then please open a JIRA and

Re: [rules-users] Question about custom accumulation functions

2011-09-08 Thread Bruno Freudensprung
(). We do want to reduce the calls to getResult(), improving performance, but it is not easy to figure out a way, as from an engine perspective, it never knows when the application is done inserting facts and it is time to calculate the final result. Edson 2011/8/24 Bruno Freudensprung

Re: [rules-users] Question about custom accumulation functions

2011-09-08 Thread Bruno Freudensprung
2011/9/8 Bruno Freudensprung bruno.freudenspr...@temis.com mailto:bruno.freudenspr...@temis.com Hi Edson, hi all, To stick to the subject, I have a strange problem (stack trace in PS) with a rule containing two accumulate calls, the result of the first one is re-injected

[rules-users] Decision table empty action cell

2011-09-07 Thread Bruno Freudensprung
Hi, I am implementing a decision table that looks like: *CONDITION* *ACTION* *$p : Person* *name == $1* *retract($p);* *Person name* *Retract the person* Fred N/A Kenny N/A The problem is generated rules have an empty RHS unless I put a string

[rules-users] From in decision table

2011-09-07 Thread Bruno Freudensprung
Hi guys, As you have probably noticed, today is my decision tables day :-). Before telling you what is going wrong, let me show you what kind of rule I try to put in my Drools 5.1 decision table: # for each window $window : Window($elements : elements) from $windows #

Re: [rules-users] Decision table empty action cell

2011-09-07 Thread Bruno Freudensprung
Thanks for your answer. Merging the cells is a good idea! Bruno. Le 07/09/2011 14:09, Swindells, Thomas a écrit : There's no easy option. One solution is to merge the cell across from your condition column -- if someone duplicates a row they'll still have the value merged and it looks

[rules-users] Question about custom accumulation functions

2011-08-24 Thread Bruno Freudensprung
Hi, While testing my custom accumulation function I noticed an unexpected behavior (th'ats of course a personal point of view). It seems that Drools 5.1 calls accumulate(...) and getResult(...) as many times as the number of accumulated facts (accumulate, getResult, accumulate, getResult,

Re: [rules-users] To accumulate or not to accumulate

2011-08-22 Thread Bruno Freudensprung
implementation is very versatile and its performances are comparable to the accumulator solution: 93 ms on 100 sentences, 125 ms on 1000 sentences So thanks again for your suggestion; it was definitely useful :-). Regards, Bruno. Le 19/08/2011 17:25, Wolfgang Laun a écrit : 2011/8/19 Bruno Freudensprung

Re: [rules-users] To accumulate or not to accumulate

2011-08-19 Thread Bruno Freudensprung
O(N*N) pairs and then looking for an overlapping window is much worse than looking at each window, for instance. But it depends on the expected numbers for both. -W 2011/8/19 Bruno Freudensprung bruno.freudenspr...@temis.com mailto:bruno.freudenspr...@temis.com Hello, I am trying

Re: [rules-users] To accumulate or not to accumulate

2011-08-19 Thread Bruno Freudensprung
. If ManualAnnotations have been associated with their containing Sentences up-front, you just need to find Windows with more than 1 ManualAnnotation, adding them in the RHS of rule 2 above. -W 2011/8/19 Bruno Freudensprung bruno.freudenspr...@temis.com mailto:bruno.freudenspr...@temis.com Hi

Re: [rules-users] Question / problem

2011-05-12 Thread Bruno Freudensprung
Hi, In my understanding it is normal. However if you told Drools that your FirstRule modified the $testDrools object, it should no longer be the case: then System.out.println(Set my value to 1); $testDrools.setMyValue(1); update($testDrools); Regards, Bruno. Le

Re: [rules-users] Question / problem

2011-05-12 Thread Bruno Freudensprung
for the help. (Sorry for such a poor English writing :( ) Le 12/05/2011 11:12, Bruno Freudensprung a écrit : Hi, In my understanding it is normal. However if you told Drools that your FirstRule modified the $testDrools object, it should no longer be the case: then System.out.println(Set my

Re: [rules-users] Unable to find implementation for BusinessRuleProvider

2011-03-14 Thread Bruno Freudensprung
Hi, If it is not the case already, could you try adding the drools-ide-common jar (along with its dependencies) to the classpath of your project? Best regards, Bruno. John Peterson a écrit : Hi, I've been experimenting with the Guided Rule Editor plug-in in Eclipse. I've built a

Re: [rules-users] JUnit Test failure when Eclipse library present on classpath

2011-02-23 Thread Bruno Freudensprung
Hi, Unfortunately I have no answer to your question. However I actually run JUnit 4 tests calling drools 5.1.1 in Eclipse 3.5 and it works with the following classpath. Please note that it contains jars that are not Drools-specific (my project-specific jars): +-

Re: [rules-users] Eclipse IDE not validating .drl files

2011-02-18 Thread Bruno Freudensprung
Hi, Did you try to add the Drools nature to your project? I mean something like : right-click on the project | configure | Convert to Drools project Bruno. StormeHawke a écrit : StormeHawke wrote: Travis Smith wrote: I'm assuming you're using Seam here (which is a variation on

Re: [rules-users] How to write a rule that fires when it matches against specific facts in working memory.

2011-01-27 Thread Bruno Freudensprung
Hi, I finally noticed a forall keyword that might be useful (see section 5.1.4.1. Syntax of templates). Maybe can you try something like: [forall(){Option(code == $)}] Bruno. Bruno Freudensprung a écrit : Hi Gurvinder, I've just taken a look at chapter 5.1 of Drools Expert about decision

Re: [rules-users] looping over list

2011-01-26 Thread Bruno Freudensprung
Hi, Maybe can you try the collect keyword? According to what I see in the documentation (4.8.3.9. Conditional Element collect) it seems to fit your needs. I'll probably give this a try: rule Select Officer ruleflow-group select_officer no-loop true salience 20 when

Re: [rules-users] Doubt in converting .brl to .drl format in java

2011-01-26 Thread Bruno Freudensprung
Hi, Don't know if it may help but I've just had a similar error (java.lang.RuntimeException: com.thoughtworks.xstream.mapper.CannotResolveClassException: definitions : definitions) when adding a bpmn2 rule flow file (an XML file) as a BRL resource in a KnowledgeBuilder (no comment... :-)).

Re: [rules-users] Decision table rework, progress

2011-01-25 Thread Bruno Freudensprung
Indeed! The decision table was something pretty obscure to me. Now it is much clearer! Do you know if that UI will be available in the Drools Eclipse plugin? In any case thanks for sharing that with us! Bruno. plugtreelabs a écrit : Awesome work Mike.

Re: [rules-users] How to write a rule that fires when it matches against specific facts in working memory.

2011-01-24 Thread Bruno Freudensprung
Hi Gurvinder, I've just taken a look at chapter 5.1 of Drools Expert about decision tables but I've been unable to find out how to do that. If you find a solution, could you please post it here? I'm pretty sure I will need that as well ;-). Best regards, Bruno. groovenarula a écrit : Thanks

Re: [rules-users] Get maximum

2011-01-24 Thread Bruno Freudensprung
Hi, It might be a naive approach (assuming Person objects are facts), but did you try something like: when $oldest : Person($age : age) not Person(age $age) then System.out.println(Oldest person is + $oldest.getName()); Best regards, Bruno. nemo a écrit : Hi all,

Re: [rules-users] Problem implementing dynamic regular expression

2011-01-24 Thread Bruno Freudensprung
Hi, Can you give a try with the eval keyword? Here is a code fragment from Drools Expert documentation (Example 4.53), I have the impression (I am a Drools beginner) that it can be adapted to your needs: Person( girlAge : age, sex = F ) Person( eval( age == girlAge + 2 ), sex = 'M' )

Re: [rules-users] Problem implementing dynamic regular expression

2011-01-24 Thread Bruno Freudensprung
blah))) Best regards, Bruno. Wolfgang Laun a écrit : 2011/1/24 Bruno Freudensprung bruno.freudenspr...@temis.com MyEvent(prop1 matches eval(This event is for+getPropName()+ and is sent to blah blah blah)) You cannot use eval() like this. It is a conditional element. If getPropName

Re: [rules-users] XML to DRL

2011-01-12 Thread Bruno Freudensprung
Hi, I don't know if it is related but it reminds me a problem I had with the changet-set XML. Drools 5.1 documentation mentions (example 3.8): change-set xmlns='http://drools.org/drools-5.0/change-set' xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'

Re: [rules-users] KnowledgeAgent, change-set and BRL

2010-12-29 Thread Bruno Freudensprung
Hi Esteban, Thank you for your fast answer! I am planning to integrate the Drools Eclipse plugin into an RCP application (that will be used to create rules, but not only). Maybe I am wrong but I would like to avoid using Guvnor that seems to be complicated from a deployment point of view

Re: [rules-users] activation-group issue

2010-12-16 Thread Bruno Freudensprung
Hi, I don't know if it is the best solution since I am very new to Drools but you could use a logical insert of a Skip fact. Something like: rule A1 salience 100 ruleflow-group A activation-group A when xxx1 then yyy1 * insertLogical(new Skip()); *end rule A2 salience 90

[rules-users] Identity, equality, hashing and indexing

2010-12-08 Thread Bruno Freudensprung
Hi, I have some existential questions about Drools Expert's magic :-). When reading the documentation it is clear that, by default, facts are stored in an IdentityHashMap. If I understand things correctly it means that the objects I put in the working memory don't have to implement the

Re: [rules-users] Identity, equality, hashing and indexing

2010-12-08 Thread Bruno Freudensprung
the checking of equality. Thomas -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users- boun...@lists.jboss.org] On Behalf Of Bruno Freudensprung Sent: 08 December 2010 14:00 To: Rules Users List Subject: [rules-users] Identity, equality, hashing

[rules-users] Insert new facts in WorkingMemory event handler

2010-12-06 Thread Bruno Freudensprung
Hi everyone, Do you know if it is possible to insert/modify/retract facts in a working memory event handler? Here is my use case actually: I want my users to be able to write rules like When ... Then retract X without having to bother with the consequences of retracting X on the other

Re: [rules-users] Insert new facts in WorkingMemory event handler

2010-12-06 Thread Bruno Freudensprung
December 2010 09:32, Bruno Freudensprung bruno.freudenspr...@temis.com mailto:bruno.freudenspr...@temis.com wrote: Hi everyone, Do you know if it is possible to insert/modify/retract facts in a working memory event handler? Here is my use case actually: I want my users

Re: [rules-users] Insert new facts in WorkingMemory event handler

2010-12-06 Thread Bruno Freudensprung
Hi, Yes, I see what you mean! That's why, before starting, I wanted to make sure that I was not completly mistaken ;-). Please find my answers below. Bruno. Gabor Szokoli a écrit : That looks like a drools retelling of the chicken and egg problem to me: how do you intend to insert new

Re: [rules-users] Insert new facts in WorkingMemory event handler

2010-12-06 Thread Bruno Freudensprung
Hi Wolfgang, Thank you for your advice! Indeed, this logic is part of my application domain. Best regards, Bruno. Wolfgang Laun a écrit : The initially posted rules 1 and 2 are best practice. You are using a Production Rule Engine, and these rules are what they are made for. Doing it in

[rules-users] WorkingMemoryEventListener and Stateless sessions in sequential mode

2010-12-06 Thread Bruno Freudensprung
Hi, I am using Drools 5.1.1 and I have the impression that the WorkingMemoryEventListener is not called when using a StatelessKnowledgeSession configured in Sequential mode. Does anyone have experienced such a behavior? When using the SequentialOption.NO option, the little program below (in

Re: [rules-users] Building a rule base from the content of a directory

2010-11-22 Thread Bruno Freudensprung
reagrds, Bruno. Toni Rikkola a écrit : Can't remember what the issue was with BRL back then. I can take a second look at the TODO next week. Toni Rikkola On Nov 19, 2010, at 2:26 PM, Bruno Freudensprung wrote: Hi, Many thanks for you answer! Are you talking about DroolsCompilerAntTask

Re: [rules-users] Building a rule base from the content of a directory

2010-11-19 Thread Bruno Freudensprung
Hi, Many thanks for you answer! Are you talking about DroolsCompilerAntTask and DroolsVerifierAntTask Ant tasks (that I discovered after having read you email)? I've taken a look at the code of the DroolsCompiler task (Drools 5.1.1) and it also concatenates (into a single string) the package

Re: [rules-users] accessing a drools variable

2010-11-04 Thread Bruno Freudensprung
Hi, I've never tried this but there is a getGlobals() method on the StatelessKnowledgeSession and on the StatefulKnowledgeSession (actually on KnowledgeRuntime). Maybe worth giving a try :-). Best regards, Bruno. rajivharris a écrit : Hi, I am setting a String variable as global. And

[rules-users] Building a rule base from the content of a directory

2010-11-03 Thread Bruno Freudensprung
Hello, I plan to use the Drools Eclipse plugin in order to create rules with both the Guided rule editor and the Rule resource editor, and I would like to write a rather generic piece of code (using a KnowledgeBuilder) in order to setup a KnowledgeBase from the rule files contained in a

[rules-users] Building a rule base from the content of a directory

2010-11-03 Thread Bruno Freudensprung
Hello, Sorry for the duplicate post, the previous one got inserted into another thread (also sorry for that). So here it is... in its own thread :-). I plan to use the Drools Eclipse plugin in order to create rules with both the Guided rule editor and the Rule resource editor, and I would

Re: [rules-users] Reuse statless session

2010-10-27 Thread Bruno Freudensprung
and update or retract and reinsert as needed. Cheers, Pat On Tue, Oct 26, 2010 at 3:50 PM, Bruno Freudensprung bruno.freudenspr...@temis.com mailto:bruno.freudenspr...@temis.com wrote: Hi, According to what I've read so far, you can reuse Stateless sessions. In particlar I've seen

Re: [rules-users] Reuse statless session

2010-10-27 Thread Bruno Freudensprung
You are right; so far (still haven't finished reading the book) it is unclear whether the stateless session really implements some kind of optimization. Bruno. Wolfgang Laun a écrit : Ha! I've been trying to find out about exactly this reputed distinction between stateful and stateless

Re: [rules-users] Custom operator

2010-10-26 Thread Bruno Freudensprung
Many thanks for your answers Edson! Bruno. Edson Tirelli a écrit : That is a mistake as one will override the other. Since they are the same, no harm done though It should suffice to use the configuration file. I am not familiar with eclipse/guvnor code, so can't really help you

Re: [rules-users] Reuse statless session

2010-10-26 Thread Bruno Freudensprung
Hi, According to what I've read so far, you can reuse Stateless sessions. In particlar I've seen unit tests creating a Stateless session in a @BeforeClass method, then this session was re-used across multiple tests methods pushing different data-sets into that unique session instance using

Re: [rules-users] Less than greater than operator

2010-10-25 Thread Bruno Freudensprung
Hi, From what I see in the code (org.drools.base.evaluators.ComparableEvaluatorsDefinition class), comparison operators have different implementations depending on the type of the arguments. For Integer, it uses the intValue() and the operator. There a many pre-defined type but, in the

Re: [rules-users] Custom operator

2010-10-25 Thread Bruno Freudensprung
implementations and it should be fine. Edson 2010/10/25 Bruno Freudensprung bruno.freudenspr...@temis.com: Hello, It seems that the logic behind the operator drop-down list comes from the org.drools.ide.common.client.modeldriven.SuggestionCompletionEngine

Re: [rules-users] Drools examples don't run

2010-10-20 Thread Bruno Freudensprung
Hello, I think you have to add the xstream jar to your classpath. Here is the Maven dependency : dependency groupIdcom.thoughtworks.xstream/groupId artifactIdxstream/artifactId version1.3.1/version /dependency Best regards, Bruno. ??? a écrit : Hello, I checked out

[rules-users] DrlParser problem with soundslike and matches

2010-10-18 Thread Bruno Freudensprung
Hi, I am using Drools 5.1.1 (but also tried with 5.2.0.SNAPSHOT) to achieve the following scenario: 1 - use the Drools' Eclipse graphical rule editor to create a BRL file 2 - convert the BRL to DRL using the org.drools.ide.common.server.util.BRXMLPersistence and

Re: [rules-users] DrlParser problem with soundslike and matches

2010-10-18 Thread Bruno Freudensprung
EvaluatorRegistry.. See org/drools/base/evaluators/EvaluatorRegistry,java and org/drools/compiler/PackageBuilderConfiguration.java. Best -W On 18 October 2010 11:05, Bruno Freudensprung bruno.freudenspr...@temis.com wrote: Hi, I am using Drools 5.1.1 (but also tried with 5.2.0.SNAPSHOT