Re: [rules-users] Support for dynamic / ad-hoc queries in Drools

2012-06-27 Thread Swindells, Thomas
> -Original Message- > From: rules-users-boun...@lists.jboss.org [mailto:rules-users- > boun...@lists.jboss.org] On Behalf Of Wolfgang Laun > Sent: 27 June 2012 14:47 > To: Rules Users List > Subject: Re: [rules-users] Support for dynamic / ad-hoc queries in Drools > > On 27/06/2012, jpul

Re: [rules-users] Raising event signal from work item handler

2012-03-08 Thread Swindells, Thomas
little bit about your use case? 2012/3/8 Swindells, Thomas mailto:tswinde...@nds.com>> Within a work item, if you need to signal an event how would you do it? >From a rules task you have access to the kcontext but generically this isn't >available.

[rules-users] Raising event signal from work item handler

2012-03-08 Thread Swindells, Thomas
Within a work item, if you need to signal an event how would you do it? >From a rules task you have access to the kcontext but generically this isn't >available. Thanks, Thomas

Re: [rules-users] [rules-user] problem with private members (no getters)

2012-02-10 Thread Swindells, Thomas
the methods with > the rules. > > e.g the key of the switch-case is private, and i dont need and wont a getter > for this [Swindells, Thomas] you need it if you are going to use it in rules in any sensible way, My advice is just to make a public getter and if necessary shove a big DO NOT

Re: [rules-users] Low Date question in drools

2012-02-09 Thread Swindells, Thomas
One way would be to do dateOfBirth.time < nn Where n is (new Date(-1900, 1,1)).getTime() By the way be very very wary of Date objects coming back from the database and check what the actual implementation class type is (and not the variable type). Even though java.sql.Timestamp extends

Re: [rules-users] Drools Debugging

2012-02-09 Thread Swindells, Thomas
Use salience or some other order to control the facts. But I think the key point to remember is that Drools isn't stable, given the same set of rules and the same set of input in the same order there is no guarantee that the rules will execute in the same order unless there is something in the r

Re: [rules-users] How to write rules in two fact's fields?

2012-02-06 Thread Swindells, Thomas
I'd assume the intention was to use the support mvel provides for abbreviating expressions - so it is intended to be interpreted as shorthand for 20 <= price && price < 30. I'm not 100% sure scanning through the docs whether this form is correct or not. Thomas > -Original Message- > Fr

Re: [rules-users] How to use the xls file as decision table?

2012-01-31 Thread Swindells, Thomas
Write a java program that loads and use the spreadsheet - in the same way that you use would do so for a DRL file. The eclipse plugin is just an environment to help development and testing, it doesn't actually run anything - Afterall having rules is just half the picture, you also need to insert

Re: [rules-users] How to enable logging in my application?

2012-01-30 Thread Swindells, Thomas
You need a log4j.properties file on your classpath, if you search for configuring log4j in google you should find advice on how to initialize log4j properly. Thomas > -Original Message- > From: rules-users-boun...@lists.jboss.org [mailto:rules-users- > boun...@lists.jboss.org] On Behalf

Re: [rules-users] Code Coverage

2012-01-23 Thread Swindells, Thomas
rools generates n' them how to instrument it thank you very much four your time and answers cheers Mike 2012/1/23 Swindells, Thomas mailto:tswinde...@nds.com>> There is nothing stopping you taking the output and producing a report in your CI showing lines (Rules) in red and green as to w

Re: [rules-users] Code Coverage

2012-01-23 Thread Swindells, Thomas
n disjunctions. -W On 23/01/2012, mike mailto:mike...@gmail.com>> wrote: > Thank you very much Thomas ... yes, what i need is standard code coverage > ... my company is all over that metric > > cheers > Mike > > 2012/1/23 Swindells, Thomas mailto:tswinde...@nds.com>> > &g

Re: [rules-users] Code Coverage

2012-01-23 Thread Swindells, Thomas
It depends what you are asking for, If you just want to know what proportion of rules you have written have actually activated then that can be simply achieved by having a AgendaEventListener and using it to 'tick' rules off when they have been triggered - the blog entry should have you achieve

Re: [rules-users] Infinit loop in simple example

2012-01-20 Thread Swindells, Thomas
The simplist solution is just to change your condition to be $a : Applicant(age < 18, valid != false) Thomas From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Esteban Aliverti Sent: 20 January 2012 14:20 To: Rules Users List Subject: Re: [rules-

Re: [rules-users] Rules Evaluation based on agenda

2012-01-20 Thread Swindells, Thomas
The best solution is to only insert the rulse you actually want into the knowledge base. Another option may be not to use agenda groups (or just agenda groups) but have a control fact as the first condition of all your rules eg when UseCase(name =="abc") ... Then Thomas >

Re: [rules-users] Can we set a default value for emlpty cells in Drools templates

2012-01-20 Thread Swindells, Thomas
There isn't a nice way to do this unfortunately. One hack around it is to have two columns with the object merged across them The first column would have the condition $a : Company(this != $param), every cell in the column is then given the value 'null'. This would then always ensure that $a will

Re: [rules-users] Groovy classes as fact classes in drool

2012-01-19 Thread Swindells, Thomas
It can't find the class groovy.lang.GroovyObject, looks like you need to deploy the groovy jars into guvnor/tomcat so that they are available. Thomas > -Original Message- > From: rules-users-boun...@lists.jboss.org [mailto:rules-users- > boun...@lists.jboss.org] On Behalf Of kavita > Sen

Re: [rules-users] For loop inside a modify block problem

2012-01-11 Thread Swindells, Thomas
is wrong there. Item is not a collection so your for loop is repeating the same action over and over again for the same data. [Swindells, Thomas] It does look like that but it depends what the action is. Perhaps it is integrating with a rubbish stock system which can only remove one item at a

Re: [rules-users] For loop inside a modify block problem

2012-01-11 Thread Swindells, Thomas
You could try assigning $item to a local variable and then using that within the for loop? Thomas From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Martin A Sent: 11 January 2012 10:02 To: Rules Users List Subject: Re: [rules-users] For loop ins

Re: [rules-users] NullPointerException when load file rules

2012-01-10 Thread Swindells, Thomas
Looking at the stack trace, if you are on the same version as drools as me it looks like it is this line this.rule.setDialect( getDialect().getId() ); The most likely reason is your DRL isn't valid - perhaps where you are specifying the dialect, or it could be your Dependencies aren't right or s

Re: [rules-users] Resource Change Scanner Service modified date error

2012-01-06 Thread Swindells, Thomas
As well as the message not making sense the exception should also really be UnsupportedOperationException, of course the preference is for someone to implement it and make it supported! Thomas From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of E

Re: [rules-users] Inserting rules from guvnor into database

2012-01-04 Thread Swindells, Thomas
What is your actual requirement? Guvnor already stores the rules in a database - derby by default, but you could probably configure postgres/mysql as the backend if you want. This page seems to have some details on that http://www.integratingstuff.com/2011/01/28/setting-up-drools-guvnor/ Thomas

Re: [rules-users] Removing Special Characters

2012-01-03 Thread Swindells, Thomas
: Rules Users List Subject: Re: [rules-users] Removing Special Characters On 3 January 2012 14:49, Swindells, Thomas mailto:tswinde...@nds.com>> wrote: It will work Not the way it was posted. At least, StringBuffer.setCharAt() needs a second argument of type char, and this would be a strang

Re: [rules-users] Removing Special Characters

2012-01-03 Thread Swindells, Thomas
It will work but it isn't at all declarative but instead very procedural - it is effectively the same as retrieving all the rows from the database and then filtering them yourself. You've also failed to inform drools that you have updated the CustomerInfo object. Assuming customerName is a strin

Re: [rules-users] Decision table multiple sheets...

2011-12-21 Thread Swindells, Thomas
We have the following code to load multiple sheets from a single xls - it's more involved than I would like and I'd agree with the sentiment that drools should load all the sheets not just the first one. It's brutely pulled from out codebase so I'll leave it as an exercise to the reader to tidy

Re: [rules-users] [rules-dev] Drools 5.4.0.Beta1 released

2011-12-21 Thread Swindells, Thomas
The link http://blog.athico.com/2011/12/new-feature-spotlight-traits-part-1.html in the release notes actually points back to the release notes not to the url it is meant to. The rest of

Re: [rules-users] Problems with Domain Specific Language in eclipse

2011-12-13 Thread Swindells, Thomas
> Personally - I would rather get an error when I make a mistake (e.g. do not > write the DSL correctly) than get get an error for writing perfectly valid > code. [Swindells, Thomas] But it isn't valid DSL code. DSL is normally written by business users who don't know anything

Re: [rules-users] Can Drools supply large Knowledge Base?

2011-12-12 Thread Swindells, Thomas
That's not a big rule, that is a tiny rule. So I'm still not sure what you are actually worrying about and why you think you may have an issue. Thomas From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of WangRamon Sent: 12 December 2011 09:44 To: r

Re: [rules-users] Can Drools supply large Knowledge Base?

2011-12-12 Thread Swindells, Thomas
There's not that much to say - and if you do a search you should find more information. Basically only have the information that you need in memory. If you need to make calculations of previous state, rather than keeping the previous state all loaded up just have facts which record the state - p

Re: [rules-users] Can Drools supply large Knowledge Base?

2011-12-12 Thread Swindells, Thomas
I think you are mixing up terms which doesn't help. I think you mean you may have 100GB of facts that will be in your distributed database. Unless you are planning to do some odd automatic rule generation you will have to write the rules by hand and so will only have a relatively small number of

Re: [rules-users] Tell me to RTFM

2011-12-09 Thread Swindells, Thomas
Its arbitrary but we tend to go for package.name. Thomas > -Original Message- > From: rules-users-boun...@lists.jboss.org [mailto:rules-users- > boun...@lists.jboss.org] On Behalf Of ronalbury > Sent: 09 December 2011 14:44 > To: rules-users@lists.jboss.org > Subject: Re: [rules-users] Te

Re: [rules-users] Tell me to RTFM

2011-12-09 Thread Swindells, Thomas
In order to invoke another RF file you use the "Reusable Sub-Process". To select the process to invoke you specify a processId. This must match the processId defined for the process in the RF file. For this to work you obviously have to have loaded both RF files into the knowledge base. Hope tha

Re: [rules-users] This (ordered) record validation approach is working

2011-12-08 Thread Swindells, Thomas
Is this presentation available anywhere? > -Original Message- > From: rules-users-boun...@lists.jboss.org [mailto:rules-users- > boun...@lists.jboss.org] On Behalf Of Wolfgang Laun > Sent: 08 December 2011 07:13 > To: Rules Users List > Subject: Re: [rules-users] This (ordered) record vali

Re: [rules-users] Salience & activation-group

2011-12-06 Thread Swindells, Thomas
return null if the number isn't valid - at least if you are just doing in comparisons. How do I use inheritance in Drools ? ____ From: "Swindells, Thomas" mailto:tswinde...@nds.com>> To: Rules Users List mailto:rules-users@lists.jboss.org>>

Re: [rules-users] Salience & activation-group

2011-12-06 Thread Swindells, Thomas
> Thanks for your quick response, but I am still confused. > > An activation-group assures that only one rule in the group will fire (an XOR > group) > > Salience controls the order of evaluation No salience controls the order of the activations firing. There is no ordering of evaluating rules bec

[rules-users] Memory leak in Drools InputMarshaller - JBRULES-3303

2011-12-01 Thread Swindells, Thomas
We've identified a memory leak in Drools when using JPAKnowledgeService.loadStatefulKnowledgeSession. We've raised the issue here https://issues.jboss.org/browse/JBRULES-3303?focusedCommentId=12647082#comment-12647082 The problem is that the InputMarshaller ends up registering a listener on the

Re: [rules-users] How to define static constant variable

2011-11-22 Thread Swindells, Thomas
If you always have it as the first condition in your rule then Drools will only create a single node in the tree to do the match and the cost would be negligible. Thomas > -Original Message- > From: rules-users-boun...@lists.jboss.org [mailto:rules-users- > boun...@lists.jboss.org] On B

Re: [rules-users] does drools support Class type parameter? myService(Class objectType)

2011-11-17 Thread Swindells, Thomas
you have to wrap it within an eval - we have to do this in a number of places. Thomas > -Original Message- > From: rules-users-boun...@lists.jboss.org [mailto:rules-users- > boun...@lists.jboss.org] On Behalf Of kapokfly > Sent: 17 November 2011 13:15 > To: rules-users@lists.jboss.org > S

Re: [rules-users] How to use a temp variable accorss multiple rules?

2011-11-15 Thread Swindells, Thomas
It's up to you, wherever is most convenient. For primitives you would have to wrap it in an object though. Thomas > -Original Message- > From: rules-users-boun...@lists.jboss.org [mailto:rules-users- > boun...@lists.jboss.org] On Behalf Of Zhao Yi > Sent: 15 November 2011 14:21 > To: rule

Re: [rules-users] Using Drools with JSP application.

2011-11-14 Thread Swindells, Thomas
Drools is just a java library implementing some logic. The question you are asking is basically how do I write a JSP web application that uses some none JSP specific logic. It's not really any different to how you would write a JSP web app to read some records from a database, do some processing

Re: [rules-users] jbpm 3.2.x verssion .....

2011-11-11 Thread Swindells, Thomas
It's java. As long as you have a compatible JVM then it should run. Have you encountered any problems using it? Thomas > -Original Message- > From: rules-users-boun...@lists.jboss.org [mailto:rules-users- > boun...@lists.jboss.org] On Behalf Of Sumeet Karawal > Sent: 11 November 2011 09:1

Re: [rules-users] ClassLoader parameter and Init function of RuleBaseConfiguration

2011-11-11 Thread Swindells, Thomas
No such method errors and the like when playing around with classloaders normally means that somewhere you have the same jar in the classpath with different versions, you may well then be loading the classes from different jars depending on which classloader you are using. Make sure that you de

Re: [rules-users] Security test cases for Drools

2011-11-10 Thread Swindells, Thomas
If you are allowing customers to define their own rules then you are effectively allowing them to execute any arbitrary java statements. You either need to have someone review and check all their rules before they are applied, restrict what they can do to the UI to such a level you are sure they

Re: [rules-users] Rule Flow: Diverge/Converge Issue with one-to-many paths being exected

2011-11-09 Thread Swindells, Thomas
Can you split it into two separate diverges? Diverge to B first and always follow the other path which then does the A & C, Similarly at the other end wait for A &C and then a second wait to add in the condition for B. Thomas > -Original Message- > From: rules-users-boun...@lists.jboss.o

Re: [rules-users] Using Drools Flow with Multiple Fact Types

2011-11-08 Thread Swindells, Thomas
Yes, you can use "or" split nodes with appropriate conditions. Thomas > -Original Message- > From: rules-users-boun...@lists.jboss.org [mailto:rules-users- > boun...@lists.jboss.org] On Behalf Of Jason > Sent: 08 November 2011 13:33 > To: rules-users@lists.jboss.org > Subject: Re: [rules-

Re: [rules-users] Writing complicated rules - consecutive number problem

2011-11-07 Thread Swindells, Thomas
Something like this may work? p : Person() //for any person exists( Person(age < p.age)) //who has someone younger than them not (Person(age == p.age-1)) //there must be someone 1 year younger than them. then //there is a gap end if you only want it to fire once then you may need an extra exists

Re: [rules-users] WorkingMemoryLogger + statelessSessions = memory leak?

2011-10-25 Thread Swindells, Thomas
Anybody? From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Swindells, Thomas Sent: 21 October 2011 14:49 To: Rules Users List (rules-users@lists.jboss.org) Subject: [rules-users] WorkingMemoryLogger + statelessSessions = memory leak? Hi everyone

[rules-users] WorkingMemoryLogger + statelessSessions = memory leak?

2011-10-21 Thread Swindells, Thomas
Hi everyone, I believe that there is a memory leak when using WorkingMemoryLoggers with statelessSessions. This was raised against 5.1.1 but I think it will still exist in the latest as well. Our code basically has the following pattern: KnowledgeBase kb ==; while(nextEvent()) {

Re: [rules-users] StatefulKnowledgeSession.dispose()

2011-10-21 Thread Swindells, Thomas
It's probably because dispose unregisters from various listeners and clears up some housekeeping resources, timers etc. It's possible your rules are simple enough that they don't need any of this and so not calling the listeners saves a significant amount of time - particularly if your test case

Re: [rules-users] StatefulKnowledgeSession.dispose()

2011-10-21 Thread Swindells, Thomas
You only need to dispose of the session when you no longer want the session. It's perfectly valid to keep reusing the session as long as you want, inserting, removing and calling fire all rules as many times as you want. If you do reuse the session you just need to be careful that previous iteratio

Re: [rules-users] Help! Activations firing out of salience order

2011-10-19 Thread Swindells, Thomas
g out of salience order This was a duplicate of https://issues.jboss.org/browse/JBRULES-3111 that was fixed last week. It will be released in 5.3.0.final. Edson 2011/10/18 Swindells, Thomas mailto:tswinde...@nds.com>> Ouch looks like we and anybody on 5.1.1 needs to desperately

Re: [rules-users] Help! Activations firing out of salience order

2011-10-18 Thread Swindells, Thomas
here used to be a subtle bug in the PriorityHeapQueue containing the activations. See https://issues.jboss.org/browse/JBRULES-3044 -W 2011/10/18 Swindells, Thomas mailto:tswinde...@nds.com>> In our project we have been experiencing a large number of intermittent unit test failures when we

[rules-users] Help! Activations firing out of salience order

2011-10-18 Thread Swindells, Thomas
In our project we have been experiencing a large number of intermittent unit test failures when we are testing our rules (on drools 5.1.1). After a lot of debugging, examining our rules for logic errors, experimenting and generally scratching our head trying to work out what is wrong, we have no

Re: [rules-users] Expected release date for 5.3.0.Final and 5.2.1.Final?

2011-10-14 Thread Swindells, Thomas
Any day now- a couple of days ago they said the end of this week. Thomas > -Original Message- > From: rules-users-boun...@lists.jboss.org [mailto:rules-users- > boun...@lists.jboss.org] On Behalf Of itchupe > Sent: 14 October 2011 14:59 > To: rules-users@lists.jboss.org > Subject: [rules-

Re: [rules-users] Regession in 5.3.0-CR1: .drl file ending in a single line comment w/o EOL not accepted

2011-10-14 Thread Swindells, Thomas
Do you want a new Jira issue raised for this? From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Swindells, Thomas Sent: 12 October 2011 11:09 To: Rules Users List (rules-users@lists.jboss.org) Subject: [rules-users] Regession in 5.3.0-CR1: .drl

[rules-users] Regession in 5.3.0-CR1: .drl file ending in a single line comment w/o EOL not accepted

2011-10-12 Thread Swindells, Thomas
While in the process of upgrading to the latest version of drools I've just been hit by a regression where .drl file ending in a single line comment w/o EOL not accepted (https://issues.jboss.org/browse/JBRULES-2041) This was fixed and works in 5.1.1 but appears to be broken again :( The origina

Re: [rules-users] StatefulKnowledgeSession construction executes sequentially (no multithread)

2011-10-11 Thread Swindells, Thomas
The problem is your test isn't calling fire all rules. You are testing just the creation of the sessions, this is expected to be fast and low cost and requires some synchronization for safety*. The process that is expected to take a significant amount of time is the inserting of the facts, firi

Re: [rules-users] rule limit

2011-10-06 Thread Swindells, Thomas
For an even less technical solution you could have a person with a big stick standing behind the users... I think what we are all wondering is why you want to limit the number of rules! Thomas > -Original Message- > From: rules-users-boun...@lists.jboss.org [mailto:rules-users- > boun...

Re: [rules-users] Compilation errors with 5.3.0.CR1

2011-10-05 Thread Swindells, Thomas
Why do you need the and in the rule? Have you tried > rule "enabled paramId: 1, id: 0" > salience 50 > when def0: EmParamDefinition(paramName == "p2", listIndex == -1) EmParamValue(paramDefinitionId == def0, requiredValue == 1) $param : EmParamValue(id == 1, enabled == false)

Re: [rules-users] Using object.getter in Decision table

2011-10-04 Thread Swindells, Thomas
The best place to start is the drools documentation http://www.jboss.org/drools/documentation particularly the expert guide. This shows both drl and spreadsheet syntax and examples. You are getting the exception because the first line of the condition should just be an object restriction eg fact1

Re: [rules-users] Is it possible to retrieve the collection of Conditions from DecisionTable?

2011-10-04 Thread Swindells, Thomas
Looking at the SpreadsheetCompiler class you can do something like the following /** * Generates DRL from the input stream containing the spreadsheet. * * @param xlsStream *The stream to the spreadsheet. Uses the first worksheet found *for the d

Re: [rules-users] 5.3.0 CR1 has broken existing rules/flows

2011-10-04 Thread Swindells, Thomas
That looks really useful, I didn't know that you could do that! Any chance you could submit it as a patch to get the default version enhanced to do that! Thanks, Thomas From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun Sent: 04 Oc

Re: [rules-users] Using object.getter in Decision table

2011-10-04 Thread Swindells, Thomas
Why are you using an extra data object -its far easier if your facts are actually facts in the working memory. What you have written as your rules is totally incorrect - you seem to be trying to write java method calls not rule statements. My advice is to a) try writing the same rule as a drl fi

Re: [rules-users] Partial Unification / Derivation of Facts?

2011-09-27 Thread Swindells, Thomas
> > It's almost as if I need to specify a "partial derivation" or "partial > unification" > of the Fact type, which is only asserted once a rule indicates that it is > providing the "unbound" portion of the derivation. I understand queries can > be used for some sort of partial unification, but I

Re: [rules-users] Getting Exception while running rules continuously on the Event Streams from Mule Component.

2011-09-27 Thread Swindells, Thomas
It may be worth you trying a later version of drools to see whether the issue still exists - there have been quite a few bug fixes since then! In theory it shouldn't be too much work to change - check the release notes for maven group/project id changes, but there are some subtle differences in

[rules-users] Regression with Drools 5.3.0-CR1

2011-09-26 Thread Swindells, Thomas
I've just tried upgrading from Drools 5.3.0-CR1 from the beta and I've hit a regression. JBoss seems to have been down for most of today so I haven't been able to raise a Jira for it. In our model we have Facts which contain fields of java.lang.class, we then have a rule which checks that they

Re: [rules-users] Drools all lhs execute before all the rhs, i want to run sequentially

2011-09-26 Thread Swindells, Thomas
As I said, try reading the expert doc, there's some examples in there which you can base your code on. Once you've done that or if you have any questions about the samples/what the documentation means then post them and we'd be pleased to help, but the first step is to structure your code correc

Re: [rules-users] Drools all lhs execute before all the rhs, i want to run sequentially

2011-09-26 Thread Swindells, Thomas
Have you read the expert guide? http://docs.jboss.org/drools/release/5.2.0.Final/drools-expert-docs/html_single/index.html - At least up to the end of chapter 4. Why are you using static fields and methods? You are changing the value of objects in the when condition which is really really really

Re: [rules-users] Drools all lhs execute before all the rhs, i want to run sequentially

2011-09-26 Thread Swindells, Thomas
You missed the second part of the instructions - once a rule has matched you need to make sure the other rules don't match. This can be achieved in multiple ways: Call the engines halt method - just stop evaluation. Retract the facts - then nothing else can match it. Update the facts to stop the c

Re: [rules-users] Drools all lhs execute before all the rhs, i want to run sequentially

2011-09-26 Thread Swindells, Thomas
This isn't an if statement evaluated left to right with an && between each part. Drools uses the rete algorithm to make execution more efficient. Put very simply (and probably inaccurately) Rete creates an evaluation tree where inputs are put in the top and activations come out the end. In this ca

Re: [rules-users] Issue using global 'variable' with Drools 5.2 in DRL

2011-09-23 Thread Swindells, Thomas
If it a java.util.Date then drools supports comparing them out of the box so you can just do subObjcet.dateField >= now. Just make sure you don't mix up instances of java.util.Date and java.sql.Timestamp (eg if you have jpa code fetching object from the db) as sun in their wisdom made it that y

Re: [rules-users] (no subject)

2011-09-16 Thread Swindells, Thomas
To do that shouldn't you just be doing something like the following? You should be using the knowledge* apis rather than the old rules* apis. KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); kbuilder.add(ResourceFactory.newReaderResource(new File(fileReader)), ResourceT

Re: [rules-users] Log4j in the rules?

2011-09-16 Thread Swindells, Thomas
"Then" part not "when" part .. really must wake up before posting > -Original Message- > From: rules-users-boun...@lists.jboss.org [mailto:rules-users- > boun...@lists.jboss.org] On Behalf Of Swindells, Thomas > Sent: 16 September 2011 09:07 > To: Rul

Re: [rules-users] Log4j in the rules?

2011-09-16 Thread Swindells, Thomas
Just add the logger in as a global and call it from the when part. > -Original Message- > From: rules-users-boun...@lists.jboss.org [mailto:rules-users- > boun...@lists.jboss.org] On Behalf Of nick_fun7921 > Sent: 15 September 2011 18:09 > To: rules-users@lists.jboss.org > Subject: Re: [ru

Re: [rules-users] Memory leak in 5.2/5.3

2011-09-14 Thread Swindells, Thomas
This probably isn't very optimal but it should work: Collection factHandles = session.getFactHandles(); for(FactHandle f : factHandles) { session.retract(f); } Thomas > -Original Message- > From: rules-users-boun...@lists.jboss.org [mailto:rules-users- > boun...@lists.jboss.org] O

Re: [rules-users] Spreadsheet: Rule Compilation error (xxx) cannot be resolved: Keeping running total

2011-09-12 Thread Swindells, Thomas
If you dump out the xml it converts the spreadsheet to you can see what the resulting DRL is. Mantis is right in what the output is – if you don’t merge the condition column you’ll get a drl as below (If there exists a Condition (c1) such that its payment > $param(1) AND there exists a Condition

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

2011-09-07 Thread Swindells, Thomas
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 nicer than having a column of N/A The other approach I tend to use is just to set the column heading to be "must be N/A" rath

Re: [rules-users] encounter NullPointerException when adding ruleflow

2011-09-06 Thread Swindells, Thomas
Are you sure that basicFlow.rf is in your classpath correctly? From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of James Yu Sent: 06 September 2011 10:08 To: rules-users@lists.jboss.org Subject: [rules-users] encounter NullPointerException when addi

Re: [rules-users] Trapping runaway rules

2011-08-31 Thread Swindells, Thomas
> Swindells, Thomas wrote: > > I've found no-loop to be pretty much completely useless. > > It only stops the rule from triggering itself, but it doesn't stop > > loops where multiple rules > > Correct. I suggested "no-loop" exactly from preventin

Re: [rules-users] Trapping runaway rules

2011-08-31 Thread Swindells, Thomas
I've found no-loop to be pretty much completely useless. It only stops the rule from triggering itself, but it doesn't stop loops where multiple rules constantly trigger each other. Eg when they both depend on and modify the same fact. Individually with no-loop they would both work fine, but comb

Re: [rules-users] Rule one-by-one comparison

2011-08-26 Thread Swindells, Thomas
ally. Further down the road, I will also need to extract the whole LHS to perform the comparison. I'm afraid this would take too long, but I might be wrong. Thanks again, _ miguel, PT 2011/8/26 Swindells, Thomas mailto:tswinde...@nds.com>> Wouldn't it be easier to analyze t

Re: [rules-users] Rule one-by-one comparison

2011-08-26 Thread Swindells, Thomas
reading. Any help is greatly appreciated. _ miguel, PT 2011/8/26 Swindells, Thomas mailto:tswinde...@nds.com>> Can you share what you actual requirement is and why you need to do it? Can you perhaps change the problem into one that is simpler to solve? Ie rather than comparing knowledge

Re: [rules-users] Rule one-by-one comparison

2011-08-26 Thread Swindells, Thomas
Can you share what you actual requirement is and why you need to do it? Can you perhaps change the problem into one that is simpler to solve? Ie rather than comparing knowledge bases can you get the input to these knowledgebases? Can you control what that input is, if it is a DSL or a spreadsheet

Re: [rules-users] Drools 5.2 performance building KnowledgeBase

2011-08-25 Thread Swindells, Thomas
512mb isn't that big a number, I found that it's the MaxPermSize that was actually more important to increase with the compilation as a lot of time the usage was bouncing just underneath the default limit on my system (80mb). Giving it more headroom reduced the amount of effort the garbage collect

Re: [rules-users] Stateless vs Stateful

2011-08-25 Thread Swindells, Thomas
There's technically no real difference between them, a stateless session just has a thin wrapper around it to call dispose automatically. That said I'd recommend going for the stateful session, that way you can split up your operations easier, inserting the data, firing the rules, and then using

Re: [rules-users] Memory leak in 5.2/5.3

2011-08-24 Thread Swindells, Thomas
> Swindells, Thomas píše v St 24. 08. 2011 v 09:14 +0100: > > I’ve simplified my code into the following test case which on my > > machine after about 600 or so iterations gives an Out of memory > > exception: > > Have you tried removing jBPM jar files? If it fixes the

[rules-users] Inconsistent syntax behaviour

2011-08-24 Thread Swindells, Thomas
Continuing trying to upgrade from drools 5.1 I've been finding some strange funnies in rules behavior. Currently I'm using 5.3.0.Beta1 5.1.0.Final 2.1.Beta6 In our model we've got some lists (Yuck I know) and we want to test whether they are not empty, there are thre

Re: [rules-users] Drools 5.2 performance building KnowledgeBase

2011-08-24 Thread Swindells, Thomas
Cheers, thanks for the info, that does greatly improve compilation time - I take it it is your maxpermsize that you had to increase in jboss? Thomas > -Original Message- > From: rules-users-boun...@lists.jboss.org [mailto:rules-users- > boun...@lists.jboss.org] On Behalf Of darktyco > Se

[rules-users] Memory leak in 5.2/5.3

2011-08-24 Thread Swindells, Thomas
I'm in the middle of trying to upgrade our application to Drools 5.2 from 5.1 however I keep facing out of memory issues (I've also tried on the current 5.3 beta). I've simplified my code into the following test case which on my machine after about 600 or so iterations gives an Out of memory exc

[rules-users] Regression 5.1->5.2 with conflicting ClassNames

2011-08-19 Thread Swindells, Thomas
I'm in the progress of updating from Drools 5.1 to 5.2 in the hope of solving problems we are having with intermittent mysteriously missing activations. I've found a regression with the compiler which I don't know whether anybody else has noticed before. In our application we've got two Content

Re: [rules-users] Detecting what fact/event properties have changed.

2011-08-19 Thread Swindells, Thomas
Drools doesn't know what has changed, the changes are all done in java code and it only knows something has been done to them when you call update, not what has been done (it could be nothing). There are three ways you could achieve this affect: 1. Keep an original copy of the data, when you get

Re: [rules-users] best way to write this rule?

2011-08-11 Thread Swindells, Thomas
You are thinking too procedurally. You shouldn't be using lists, or collections within the rules, instead generally the thing within the list should be inserted into the working memory. Rather than having the function you can then right something like the following: //person has earned the badge p

Re: [rules-users] RuleAgent - loading rules help ?

2011-08-08 Thread Swindells, Thomas
Have you tried just using a file url? From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Ivan Peshev ( M-Tel ) Sent: 08 August 2011 11:04 To: rules-users@lists.jboss.org Subject: [rules-users] RuleAgent - loading rules help ? Hello, Is there a wa

Re: [rules-users] Java 1.4 Application

2011-08-04 Thread Swindells, Thomas
a 1.4 and there > haven't been any major changes in the code, currently business logic is > managed through Java code only. But now we are trying to have a rule > engine for the purpose. There will be a migration to Java 6 but not in the > near > future. > > Regards, >

Re: [rules-users] running multiple instance of rule engine

2011-08-02 Thread Swindells, Thomas
have you looked at drools grid ? I haven’t used it, but appears to solve a similar problem that you are trying to – distributed computing. -abhay ____ From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Swindells, Th

Re: [rules-users] running multiple instance of rule engine

2011-08-02 Thread Swindells, Thomas
I’m not sure I understand the question. You have two totally independent rule engine on two different servers running with separate JVMs and sessions. You happen to share data between the two sessions by updating a database but drools has no knowledge of that (they are just java objects which hap

Re: [rules-users] Java 1.4 Application

2011-08-01 Thread Swindells, Thomas
Any reason why you are still on java 1.4? You are using a java version that is now 3 major versions out of date and that hasn't been supported by sun/oracle for the last 3 years! It's the equivalent of still using windows 98! Thomas > -Original Message- > From: rules-users-boun...@lists.j

Re: [rules-users] Dynamic facts

2011-07-22 Thread Swindells, Thomas
My advice for designing datamodels and working with drools is to think of it as a database and follow standard database normalization procedures. Essentially drools in an in memory database which has a custom query and trigger syntax implemented in a very efficient manner! Each Object type is a

Re: [rules-users] How to reuse a result of a rule in an other rule

2011-07-22 Thread Swindells, Thomas
The latter approach is particularly powerful we have a very simple but amazingly flexible class called Affirmation which just have 3 fields - String name, Object subject, Object value. This however gives most flexibility that you need Eg rule "Hungry" when $person : Person(hoursSince

Re: [rules-users] Global variable in LHS

2011-07-18 Thread Swindells, Thomas
Don't use a global, instead create a new fact type "Global" having a single field globalVariable (type object will probably do), then you can pretty much write what you have below (once you add the missing bracket). Alternatively you may be able to do something like eval(Arrays.asList("X", "Y").

Re: [rules-users] Drools and serialize

2011-07-12 Thread Swindells, Thomas
You don't need the object output stream below - and it's very bad code to give access to the same output stream to two parents (the marshaller and the OOS in this case) as you can end up just writing garbage if they interleave their writes - you don't know the buffering policy that each parent i

  1   2   3   4   >