Re: [rules-users] Memory Leak in 5.4.0 and 5.5.0 [was: Garbage collection and sliding windows (Drools 5.5.0 Final)]

2013-02-18 Thread tai-atari
Thanks for your help on this laune Mark, do you require any additional input? -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-Memory-Leak-in-5-4-0-and-5-5-0-was-Garbage-collection-and-sliding-windows-Drools-5-5-0-F-tp4022353p4022435.html Sent from the Drools: Use

Re: [rules-users] Testing the count of a pattern binding variable

2013-02-18 Thread Wolfgang Laun
What (I think) you are trying to do is not possible. But I wouldn't say that it cannot be done using DSL. What sort of collect/accumulate do you need? -W On 18/02/2013, David R Robison wrote: > I am developing rules using DSL so, from what I understand, I cannot use > collect and accumulate in

Re: [rules-users] Constants?

2013-02-18 Thread Wolfgang Laun
function int slackTicks(){ return 42; } // oops On 19/02/2013, Wolfgang Laun wrote: > Here's another one for your collection of constant workarounds: >function int slackTicks(){ returns 42; } > -W > > On 18/02/2013, Willem van Asperen wrote: >> Hi All, >> >> I have a bunch of rules that ev

Re: [rules-users] Constants?

2013-02-18 Thread Wolfgang Laun
Here's another one for your collection of constant workarounds: function int slackTicks(){ returns 42; } -W On 18/02/2013, Willem van Asperen wrote: > Hi All, > > I have a bunch of rules that evaluate using some constant variable (say > "slackTicks"). Currently, in my rules, I write down the v

Re: [rules-users] ClassCastException after migrating from Drools 4.x to v5.5

2013-02-18 Thread ismaximum
Just to let you know that I've raised an issue: https://issues.jboss.org/browse/DROOLS-44 -- View this message in context: http://drools.46999.n3.nabble.com/ClassCastException-after-migrating-from-Drools-4-x-to-v5-5-tp4022292p4022431.html Sent from the Drools: User forum mailing list archive at

Re: [rules-users] ClassCastException after migrating from Drools 4.x to v5.5

2013-02-18 Thread Mark Proctor
On 18 Feb 2013, at 13:03, Wolfgang Laun wrote: > Here is another quote from "Expert" (4.8.3.3.2., Property access on > Java Beans), which raises some doubt. > > > In a stateful session, care should be taken when using nested > accessors as the Working Memory is not aware of any of the nested >

Re: [rules-users] ClassCastException after migrating from Drools 4.x to v5.5

2013-02-18 Thread Mark Proctor
On 18 Feb 2013, at 09:07, Wolfgang Laun wrote: > Mark, > > On 18/02/2013, Mark Proctor wrote: >> stateless is just a wrapped stateful session - insert, update and delete >> work as normal. > > So let's get this straight, this quote from the "Expert" manual which > does NOT refer to sequential

Re: [rules-users] ClassCastException after migrating from Drools 4.x to v5.5

2013-02-18 Thread ismaximum
Well.. we're using stateless knowledge so just for testing I changed it to stateful knowledge and it's not complaining about that Class cast exception but there are some other issues... First, I got "Unexpected global" error and I just put a try/catch to proceed now it doesn't return the validatio

[rules-users] Testing the count of a pattern binding variable

2013-02-18 Thread David R Robison
I am developing rules using DSL so, from what I understand, I cannot use collect and accumulate in some of my DSL definitions (especially when using clauses that begin with a hyphen). So what I want to do is to test the count of a pattern binding variable, such as when $sensors : Sensor()

Re: [rules-users] Constants?

2013-02-18 Thread Ansgar Konermann
We use dedicated Java classes named after the kind of constant they represent, like Slack in your case or RetirementAge, LegalAgeThreshold. Most of the time, they contain a single property "value". This makes it easy to use Drools patterns to match them, plus we get rather strong type checking dur

[rules-users] KnowledgeAgent: impossible to add a map for a null resource! skiping.

2013-02-18 Thread anikulin
Hi I've configurated KnowledgeAgent like this and it was working with PKG files from guvnor, but when i changed path and type of recources to DRL when i trying to run it on server i have such warning in logs and KnowledgeBase is empty and no rules are fired: KnowledgeAgent: impossible to add a m

[rules-users] Constants?

2013-02-18 Thread Willem van Asperen
Hi All, I have a bunch of rules that evaluate using some constant variable (say "slackTicks"). Currently, in my rules, I write down the value of this "slack" each and every time I use it, for example: |TransferSchedule( tick > currentTick - 10d )| where 10 is the slack. A solution would be to i

[rules-users] Effective Dating of Rules

2013-02-18 Thread MaverickDrools
Is there a way to effective date a rule through a program? Requirement: without using the Guvnor UI to write the rules, trying to upload a .drl file using REST APIs which already has rules specified "without" the date-effective/date-expire attributes. Is there a way to maintain versions that could

Re: [rules-users] Comparing 2 Lists [Planner]

2013-02-18 Thread André Fróes
I found (i guess) a way to iterate over list, but it is not comparing and assigning the workorder now. I tried this way: - rule "requiredSkill" when There is an unassigned workorder and the workorder has a requiredSkill other than null and there is an engine

[rules-users] incremental modification of dataset based on accumulate

2013-02-18 Thread dharapvj
I would like to use drools in following scenario. Say, I have a goal of producing 200 vehicles (each vehicle also has a random priority). My factory can only produce 50 vehicles a day.. Thus, with this constraint.. my 200 vehicles will get produced over next 4 days. I would like to notify people a

[rules-users] how to get the pkg from guvnor by KnowledgeAgent?

2013-02-18 Thread ethan
Dear all, I want to deploy pkg from guvnor by KnowledgeAgent. The code like below: KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent( "MyAgent" ); kagent.applyChangeSet( ResourceFactory.newUrlResource("http://localhost:8080/guvnor/org.drools.guvnor.Guvnor/package/test

Re: [rules-users] When - Then In DSL Rule

2013-02-18 Thread Stephen Masters
A simple tip when creating DSLs: Write an example rule as DRL first! :) Then, if it's working DRL code (get familiar with unit testing rules) use DSL to map 'plain English' phrases to the DRL code you just wrote. It's then also worth writing a simple unit test around a hand-cranked DSR

Re: [rules-users] Evaluate rules for multiple facts of the same type within a StateuflSession

2013-02-18 Thread Wolfgang Laun
On 18/02/2013, pdario wrote: > laune wrote >> There is always just one fit; it just seems that there are multiple >> fits - when you define your individual cases sloppily. > > Well, this is an assumption to get a completely disjointed classification, > but this is not my case. > > I have a first l

Re: [rules-users] Easy mistake... - drools operator precedence

2013-02-18 Thread Geoffrey De Smet
Op 18-02-13 16:34, Willem van Asperen schreef: On 02/18/2013 02:35 PM, Geoffrey De Smet wrote: Op 18-02-13 14:00, Willem van Asperen schreef: On 02/18/2013 11:11 AM, Willem van Asperen wrote: Hi All, Just wanted to share with you an easy mistake. This is done running Drools 5.5.0.Final.

[rules-users] Comparing 2 Lists [Planner]

2013-02-18 Thread André Fróes
Hello everyone! How can I compare 2 lists with a rule? I upgraded my basic model to a more complex one now, but now I hit a wall. My WorkOrder have a List of skills, and my Engineer also have a list of Skills and I have to compare one with another. Example: Engineer A have skill ABC 1 Engineer B

Re: [rules-users] Evaluate rules for multiple facts of the same type within a StateuflSession

2013-02-18 Thread pdario
laune wrote > There is always just one fit; it just seems that there are multiple > fits - when you define your individual cases sloppily. Well, this is an assumption to get a completely disjointed classification, but this is not my case. I have a first level discount if you pay online and a seco

Re: [rules-users] When - Then In DSL Rule

2013-02-18 Thread IPatel
Thank you for your response. Here is the another option i used. Instead of using variable $item. I used the fact itself as following: [then] Charge a fee = Transcation.setChargeFee( true) when i used this i am getting "There was an error executing the consequence of rule"... Any idea how can i f

Re: [rules-users] When - Then In DSL Rule

2013-02-18 Thread Esteban Aliverti
Yes you can. The problem you are having is because "Charge a fee" is using $item variable and that variable is not bound in "When the loan application is submitted". Best Regards, Esteban Aliverti - Blog @ http://ilesteban.wordpress.com On Mon, Feb 18,

[rules-users] When - Then In DSL Rule

2013-02-18 Thread IPatel
A basic question about writing DSL rules. I am not sure if i am using correct terminology to ask the following question. I have the following in my DSL Configuration: [when] When the transcation is credit= $item:Item(CDIndicator == "Credit") [then] Charge a fee = $item.setChargeFee (true) [when]

Re: [rules-users] Easy mistake... - drools operator precedence

2013-02-18 Thread Willem van Asperen
On 02/18/2013 02:35 PM, Geoffrey De Smet wrote: > > Op 18-02-13 14:00, Willem van Asperen schreef: >> On 02/18/2013 11:11 AM, Willem van Asperen wrote: >>> Hi All, >>> >>> Just wanted to share with you an easy mistake. This is done running >>> Drools 5.5.0.Final. >>> >>> Imagine a fact >>> >>> |Che

Re: [rules-users] [rules-dev] [Bug] 5.5.0 Correctly compiled DRL runs into run time error: "incompatible types"

2013-02-18 Thread Mario Fusco
Hi Wolfgang, thanks for having reported this. I fixed it in mvel and as usual the fix will be available with the next mvel release. Cheers, Mario On Sun, Feb 17, 2013 at 5:32 PM, Wolfgang Laun wrote: > Below is a fully self-contained DRL that compiles correctly but runs > into a runtime error w

Re: [rules-users] Easy mistake... - drools operator precedence

2013-02-18 Thread Geoffrey De Smet
Op 18-02-13 15:09, Wolfgang Laun schreef: > On 18/02/2013, Geoffrey De Smet wrote: >> I think so too. >> It looks like the : operator has a higher precedence then + (and >> therefor >= too), which is a bit surprising indeed. >> Personally, I never mix the : operator with other operators, to avoid

Re: [rules-users] GC Overhead Limit Exceeded and 1B JoinLeftNode Objects

2013-02-18 Thread Julian Klein
Unfortunately the server I was using locked up last night and I cannot get access. I'll have to find an interim system where I can run tests and profile the heap. In the meantime, I switched to a Sequential Stateless Session. I don't know the internals of Drools, but since this seems to turn

Re: [rules-users] Easy mistake... - drools operator precedence

2013-02-18 Thread Wolfgang Laun
On 18/02/2013, Geoffrey De Smet wrote: > I think so too. > It looks like the : operator has a higher precedence then + (and > therefor >= too), which is a bit surprising indeed. > Personally, I never mix the : operator with other operators, to avoid > having to worry about the precendence. Is it

Re: [rules-users] POJO.jar Format for upload a fact model (basic question)

2013-02-18 Thread Stephen Masters
You need to be careful that none of the classes in your jar have dependencies that are not also in the jar or on the server classpath. They can be messed up through the use of a JPA or Spring annotation for instance. I tend to create a separate Maven project for my fact model, purely to ensure

Re: [rules-users] planner environmentMode - no reproducibility

2013-02-18 Thread Geoffrey De Smet
Op 18-02-13 13:26, Michiel Vermandel schreef: >With HashSet/Map, that order changes because Object.hashCode() returns different ints, placing elements in different HashSet buckets, which results into a different order.

Re: [rules-users] Easy mistake... - drools operator precedence

2013-02-18 Thread Geoffrey De Smet
Op 18-02-13 14:00, Willem van Asperen schreef: On 02/18/2013 11:11 AM, Willem van Asperen wrote: Hi All, Just wanted to share with you an easy mistake. This is done running Drools 5.5.0.Final. Imagine a fact |Cheese (|| ||creationTick : double|| ||preservationTicks : double|| ||)|

Re: [rules-users] POJO.jar Format for upload a fact model (basic question)

2013-02-18 Thread Michael Anstis
The JAR must be a regular Java JAR file. There were issues on older versions of Guvnor that meant that once a JAR had been uploaded you needed to restart the web-server, but I believe this has been resolved. Building the package should give you all validation errors. The warning icon, I assume be

Re: [rules-users] ClassCastException after migrating from Drools 4.x to v5.5

2013-02-18 Thread Wolfgang Laun
Here is another quote from "Expert" (4.8.3.3.2., Property access on Java Beans), which raises some doubt. In a stateful session, care should be taken when using nested accessors as the Working Memory is not aware of any of the nested values, and does not know when they change. So, I don't have

Re: [rules-users] Easy mistake...

2013-02-18 Thread Willem van Asperen
On 02/18/2013 11:11 AM, Willem van Asperen wrote: > Hi All, > > Just wanted to share with you an easy mistake. This is done running > Drools 5.5.0.Final. > > Imagine a fact > > |Cheese (|| > ||creationTick : double|| > ||preservationTicks : double|| > ||)| > > Then the following does not do

Re: [rules-users] planner environmentMode - no reproducibility

2013-02-18 Thread Michiel Vermandel
>With HashSet/Map, that order changes because Object.hashCode() returns >different ints, placing elements in different HashSet buckets, which results >into a different order. Does this mean that in an implementation without "Combination of Simulated Annealing with time spend termination", maps

[rules-users] POJO.jar Format for upload a fact model (basic question)

2013-02-18 Thread oresch
Sorry to ask this basic question. What does the pojo.jar contain? Is there a required format for the class. Is there an example? I tried to pack the .java and the .class in various formats, but even though the upload is working there is a warning sign next to the asset and I can not use the conte

[rules-users] Easy mistake...

2013-02-18 Thread Willem van Asperen
Hi All, Just wanted to share with you an easy mistake. This is done running Drools 5.5.0.Final. Imagine a fact |Cheese (|| ||creationTick : double|| ||preservationTicks : double|| ||)| Then the following does not do what you expect: |rule "dump old cheese"|| ||when|| ||$c :

Re: [rules-users] ClassCastException after migrating from Drools 4.x to v5.5

2013-02-18 Thread Wolfgang Laun
I'll insert a sentence stating that all the RHS operations insert/modify/delete are still possible. The strong negative in the quoted sentence needs to be balanced. -W On 18/02/2013, Wolfgang Laun wrote: > Mark, > > On 18/02/2013, Mark Proctor wrote: >> stateless is just a wrapped stateful sessi

Re: [rules-users] Evaluate rules for multiple facts of the same type within a StateuflSession

2013-02-18 Thread Wolfgang Laun
On 18/02/2013, pdario wrote: > Hello, the "tinting" example from the whitepaper assumes each Tint fits > exactly one Param, right? > This is not my case, as a Cart can match different discounts and we want to > assign the highest possible. There is always just one fit; it just seems that there ar

Re: [rules-users] ClassCastException after migrating from Drools 4.x to v5.5

2013-02-18 Thread Wolfgang Laun
Mark, On 18/02/2013, Mark Proctor wrote: > stateless is just a wrapped stateful session - insert, update and delete > work as normal. So let's get this straight, this quote from the "Expert" manual which does NOT refer to sequential mode!!) is wrong and should be removed: Stateless sessions do

Re: [rules-users] Evaluate rules for multiple facts of the same type within a StateuflSession

2013-02-18 Thread pdario
Hello, the "tinting" example from the whitepaper assumes each Tint fits exactly one Param, right? This is not my case, as a Cart can match different discounts and we want to assign the highest possible. Is the pattern still suitable? Another thing I see is Param is evaluating plain attributes fro