[rules-users] MultiValueRestriction

2013-06-19 Thread droolster
Hello, I saw the following in the "Design Patterns for PRS system" pdf and could not understand the difference between the two statements (they look the same to me). Please can the community clarify what the difference is: A multiple choice could be written using the same syntactic form, e.g., T

[rules-users] Drools Planner/Optaplanner suitability

2013-06-26 Thread droolster
Hello, Please can the community tell me if Drools Planner/Optaplanner is the best tool to use for the problem described below: 1. For a list of items, I assign a point depending on the value of each item. For different values of an item, I will assign a different point (kind of on a rule basis i.

[rules-users] Elegant way to specify rules for range checks

2013-06-27 Thread droolster
Hello, I would like to code some business rules with the following pattern: if x < 100 then 1 else if x > 100 and x < 200 then 2 else if x > 200 and x < 500 then 3. My initial approach would be to specify a rule for each 'if-then' logic above so ending up with 3 rules which only differ on the co

[rules-users] Getter/Setter Methods for declared types

2013-06-28 Thread droolster
Hello, At compile time, are the getter and setter methods automatically created for a declared type. In the Drools Expert PDF it gives the following example: declare Person name : String dateOfBirth : java.util.Date address : Address end and it states that the following class is gene

[rules-users] Specifying Infinite Limits

2013-06-28 Thread droolster
Hello, I have the following code to do some interval checking: declare Classification low : BigInteger high : BigInteger score : int end rule "classifications" when then insert (new Classification(new BigInteger("-1"),

[rules-users] Specifying Infinite Limits

2013-06-28 Thread droolster
Hello, I have the following code to do some interval checking: declare Classification low : BigInteger high : BigInteger score : int end rule "classifications" when then insert (new Classification(new BigInteger("-10

[rules-users] Drools Planner Version 5.5.0 vs Drools OptaPlanner Version 6.0.0

2013-07-10 Thread droolster
Hello, I searched the PDF documents for Drools Planner and Drools Optaplanner as well as searching the forums but I couldn't find any information on what is new in Version 6 compared to Version 5.5.0. I would be grateful if someone could give me a list of the new versions. The reason is that I now

Re: [rules-users] Drools Planner Version 5.5.0 vs Drools OptaPlanner Version 6.0.0

2013-07-10 Thread droolster
typo: a list of the new versions should read: a list of the new *features* -- View this message in context: http://drools.46999.n3.nabble.com/Drools-Planner-Version-5-5-0-vs-Drools-OptaPlanner-Version-6-0-0-tp4024859p4024860.html Sent from the Drools: User forum mailing list archive at Nabble

[rules-users] ruleflow-group and jBPMN

2013-08-05 Thread droolster
Hello, Please can the community help me. I have setup a Drools JBPMN process and am using it to determine which set of rules to fire under different scenarios. However, when I add the ruleflow-group attribute to the rules in the DRL file, the rules fail to execute. Here is my setup: foo.bpmn2

Re: [rules-users] ruleflow-group and jBPMN

2013-08-06 Thread droolster
Hello, Thank you for your help. Your question pointed me in the right direction to my problem. I was not calling ksession.startProcess before fireAllRules. I was still in the Drools Expert mindset. Thanks again. -- View this message in context: http://drools.46999.n3.nabble.com/ruleflow-grou

[rules-users] WorkingMemoryListener & Declared Types

2013-08-07 Thread droolster
Hello, Please can the community help me. I am attaching a WorkingMemoryListener to a session. In my DRL file, I have a number of declared types for which I want to "watch" when the process is running. How can I implement a "toString()" method in the DRL file for a declared type? I have detailed t

Re: [rules-users] WorkingMemoryListener & Declared Types

2013-08-07 Thread droolster
Hi, I haven't put Foo in my Java code as it is a transient type which I need to the rule processing and not really part of my ontology model. Anything which isn't part of ontology model but which I need to do the rule processing, I put those types in my DRL file. I'll explain what I am trying to

Re: [rules-users] WorkingMemoryListener & Declared Types

2013-08-09 Thread droolster
Thanks! I will use your helper classes. -- View this message in context: http://drools.46999.n3.nabble.com/WorkingMemoryListener-Declared-Types-tp4025391p4025435.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-user

[rules-users] JbpmJunitTestCase - where does it live?

2013-08-12 Thread droolster
Hello, I have imported the jbpm dependency into my project: org.jbpm jbpm-bpmn2 5.4.0.Final However, Eclipse cannot find org.jbpm.JbpmJUnitTestCase i.e. import org.jbpm.JbpmJUnitTestCase; Please can anyone tell me where I can find this class. Thanks in advance for

[rules-users] JUnit Test, Mockito, AgendaEventListener Problem.

2013-08-12 Thread droolster
Hello, Please can the community help me. I am setting up a JUnit test case. I am using Mockito to mock an AgendaEventListener as follows: * AgendaEventListener ael = mock(AgendaEventListener.class); ksession.addEventListener(ael);* However, Eclipse keeps complainin

Re: [rules-users] JUnit Test, Mockito, AgendaEventListener Problem.

2013-08-12 Thread droolster
To add: Eclipse is picking up this method fine for an object for type AgendaEventListener: removeEventListener(AgendaEventListener listener) but not for addEventListener(AgendaEventListener listener) which makes me think that although the addEventListener is specified in the 5.5.0.Final API it

Re: [rules-users] JbpmJunitTestCase - where does it live?

2013-08-12 Thread droolster
Thanks! -- View this message in context: http://drools.46999.n3.nabble.com/JbpmJunitTestCase-where-does-it-live-tp4025466p4025476.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists

Re: [rules-users] JUnit Test, Mockito, AgendaEventListener Problem.

2013-08-12 Thread droolster
Eclipse stops complaing when I cast: AgendaEventListener ael = mock(AgendaEventListener.class); ksession.addEventListener((org.drools.event.rule.AgendaEventListener) ael); But compilation does fail: org.drools.event.AgendaEventListener$$EnhancerByMockitoWithCGL

Re: [rules-users] JUnit Test, Mockito, AgendaEventListener Problem.

2013-08-12 Thread droolster
Yep, it's there alright: package org.drools.event.rule; import java.util.Collection; public interface WorkingMemoryEventManager { /** * Add an event listener. * * @param listener *The listener to add. */ public void addEventListener(WorkingMemoryEve

Re: [rules-users] JUnit Test, Mockito, AgendaEventListener Problem.

2013-08-12 Thread droolster
I created the simple Hello World project using the Drools plugin. Put in the mock listener: AgendaEventListener p = mock(AgendaEventListener.class); ksession.addEventListener(p); And it is fine. Compiles and runs fine. So it must be a problem with the my original proj

Re: [rules-users] JUnit Test, Mockito, AgendaEventListener Problem.

2013-08-12 Thread droolster
Hi, Could you try the following to see if you get the same problem please? I modified the following class which is generated by default when creating a Drools Project in eclipse: ( I highlighted in bold the lines of code I have added) Then I tried to compile the class, including all the necessa

Re: [rules-users] JUnit Test, Mockito, AgendaEventListener Problem.

2013-08-12 Thread droolster
Hi Davide, I also tried with Intellij and it complained about the same issue. It won't compile. Can you show me what you did? Many thanks. -- View this message in context: http://drools.46999.n3.nabble.com/JUnit-Test-Mockito-AgendaEventListener-Problem-tp4025470p4025493.html Sent from the Dr

[rules-users] CLOSED - JUnit Test, Mockito, AgendaEventListener Problem.

2013-08-13 Thread droolster
Issue is fixed. -- View this message in context: http://drools.46999.n3.nabble.com/JUnit-Test-Mockito-AgendaEventListener-Problem-tp4025470p4025501.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list

[rules-users] AgendaListener, Mockito not capturing arguments

2013-08-15 Thread droolster
Hello, Please can the community help me. I am mocking an AgendaListener on my working memory session using Mockito. However, Mockito's ArgumentCaptor is not picking up the event. Please can you tell me where I am going wrong (code below): Code: // Set up knowledge base and sessions etc Age

Re: [rules-users] AgendaListener, Mockito not capturing arguments

2013-08-15 Thread droolster
Doh! I forgot to add the *times() * verify(ael, *times(2)*).afterActivationFired(aafe.capture()); -- View this message in context: http://drools.46999.n3.nabble.com/AgendaListener-Mockito-not-capturing-arguments-tp4025557p4025558.html Sent from the Drools: User forum mailing li

[rules-users] How to use type-safe enums in rule condition

2013-11-12 Thread droolster
Hello, I would like to use type-safe enums in my rules. At the moment I have situation like this: public class Country { private String name; // getter/setters } rule "Country" when Country ( name == "USA" ) then DO SOMETHING end I would like to have something

Re: [rules-users] How to use type-safe enums in rule condition

2013-11-12 Thread droolster
Thanks Steve for the advice and code! Awesome. -- View this message in context: http://drools.46999.n3.nabble.com/How-to-use-type-safe-enums-in-rule-condition-tp4026739p4026745.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___

[rules-users] Asynchronous Rule Evaluation

2014-02-17 Thread droolster
I have situation where the set of rules I am writing will be invoked via a REST service in an asynchronous manner via JMS message queues. Essentially what is happening is that from the GUI, a ticket is raised which has a unique ticket id value. For this ticket, a particular rule evaluation has to b

[rules-users] "in" syntax breaking the Rete Tree

2014-02-17 Thread droolster
When I use the "in" operator, it breaks the Rete diagram e.g, if I do Class X { private into foo; //setter & getter for foo } rule "ABC" when X ( foo in (2,3) ) then System.out.println ("Hello"); end it breaks the Rete Tree with a java.lang.NullPointerException:null. Why does it do that?

Re: [rules-users] "in" syntax breaking the Rete Tree

2014-02-18 Thread droolster
It's created in the normal way. X x_obj = new X(); kSession.insert(x_obj); I am using drools 6.0.1.Final. I do not get a stack trace from Eclipse. But the null pointer exception is displayed on screen when I click on the Rete Tree tab. -- View this message in context: http://drools.46999.n

Re: [rules-users] "in" syntax breaking the Rete Tree

2014-02-18 Thread droolster
This even occurs in 5.6.0 - I went back to the old version thinking it maybe the plugin for 6.0.0.Final. It's not, it's the same problem. Both these rule definitions cause a problem in the Rete Tree viewer tab: rule "ABC" when A ( $p : p ) B ( c < $p, c ==

Re: [rules-users] "in" syntax breaking the Rete Tree

2014-02-18 Thread droolster
I can't give you my exact code as it is company-sensitive code. But you can test this against any POJO with a few int and Integer fields. I'm trying to promote Drools Expert in my organisation so I would appreciate your help. It's not causing a problem with rule evaluation. That is working fine. B

Re: [rules-users] "in" syntax breaking the Rete Tree

2014-02-18 Thread droolster
Also, when I add this condition: rule "ABC" when A ( $p : p ) B ( c < $p, c in (3,4), c > d ) then System.out.println ("Hello"); end The Rete Tree looks like this: (is that correct?)

Re: [rules-users] "in" syntax breaking the Rete Tree

2014-02-19 Thread droolster
@laune, were you able to reproduce this? -- View this message in context: http://drools.46999.n3.nabble.com/in-operator-breaking-the-Rete-Tree-tp4028148p4028184.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users

Re: [rules-users] "in" syntax breaking the Rete Tree

2014-02-19 Thread droolster
@laune, it is the same problem in version 6.0.0.Final. please try with that version if you have it already. Thanks -- View this message in context: http://drools.46999.n3.nabble.com/in-operator-breaking-the-Rete-Tree-tp4028148p4028188.html Sent from the Drools: User forum mailing list archiv

Re: [rules-users] "in" syntax breaking the Rete Tree

2014-02-20 Thread droolster
@laune, any update? Should I post to Stackoverflow as you are active there. Is this forum dead? -- View this message in context: http://drools.46999.n3.nabble.com/in-operator-breaking-the-Rete-Tree-tp4028148p4028204.html Sent from the Drools: User forum mailing list archive at Nabble.com. _

Re: [rules-users] "in" syntax breaking the Rete Tree

2014-02-21 Thread droolster
@Mark, "We saw this message..." - then why wasn't the advice given to raise a bug earlier? Why did it take 8 posts to eventually get to that point? It's a waste of time and effort, and a lack of appreciation for people who are trying to promote your product in their industry and workplace. Your o

Re: [rules-users] "in" syntax breaking the Rete Tree

2014-02-21 Thread droolster
@laune, I don't want to make this thread longer than it already is but... 1. If you don't trust the Drools Rete Viewer, why is it there in the plugin and why are Rete graphs displayed in the documentation? If it is not trustworthy, then it's misleading. (I'm assuming you are on the Drools dev. te

Re: [rules-users] "in" syntax breaking the Rete Tree

2014-02-24 Thread droolster
@Mark, Thank you for your rant. When you get off your 'high-horse', you may want to consider the point which I was trying to make all along which is: All you or one of your team members had to do was to reply to my original post with four words only: "This is a bug". This would have saved a lot

Re: [rules-users] "in" syntax breaking the Rete Tree

2014-02-24 Thread droolster
@Mark, like I said in my previous post, "when you get off your high-horse"... you may see things differently. -- View this message in context: http://drools.46999.n3.nabble.com/in-operator-breaking-the-Rete-Tree-tp4028148p4028271.html Sent from the Drools: User forum mailing list archive at Na

Re: [rules-users] "in" syntax breaking the Rete Tree

2014-02-24 Thread droolster
@Mark, There is no need to take posts out of context and make misconstrued inferences. I have made my points crystal clear. I also now understand your attitude perfectly clear. If I have offended you and your team, please accept my sincere apologies. In future, I will post to Stack Exchange, and