[rules-users] Common Practices for warning or debug rules/messages

2011-06-29 Thread wendy
Hi,
   I'm working on a system that has a large number of rules and we are
getting to the point where we think it would be useful to have some 'debug'
or 'warning' type rules (for lack of a better word).The warning rules
would be rules that would signal to us that something is wrong with the
underlying data and would require someone to go in and fix something.  I was
wondering if there are some standard practice as to how to write, maintain,
format... these rules.  I can think of a couple of ways to do this but I
would like the communities opinion. We would also like the ability to turn
on/off these debug or warning rules easily while the rest of the system
keeps on processing.

Thank you,
Wendy



--
View this message in context: 
http://drools.46999.n3.nabble.com/Common-Practices-for-warning-or-debug-rules-messages-tp3124178p3124178.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] drools - packaging creates a full snapshot...why?

2011-06-29 Thread jcrowe
I have been using drools for almost a year now and build several packages a
day.  Things are starting to slow down a bit and I've started to wonder if
it is because of all the workspace copies and the jcr overhead of them.  I
have implemented a deletion of old workspace copies but this made me wonder
why drools is doing (in RulesRepository):
this.session.getWorkspace().copy( source, newName );

its not like i need a copy, once the package is built, it doesn't seem to
'rebuild it' from this snapshot.  I have no way of "recovering to" this
snapshot.

Anyone can help me with the reason behind the copy (perhaps why I shouldn't
just delete this copy? I'm sure there are side-effects of this I'm not
thinking of, etc., etc.,)

Any feedback is appreciated.

--
View this message in context: 
http://drools.46999.n3.nabble.com/drools-packaging-creates-a-full-snapshot-why-tp3124126p3124126.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] activation dependent of rule order in drl file in 5.2.0.Final?

2011-06-29 Thread Florian Beckmann
On Wednesday 29 June 2011 11:42:28 Wolfgang Laun wrote:
> Hi Florian,
Hi Wolfgang,

Modified the rules accordingly. Works! Thank you.


Florian
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools 5.0 -> 5.2 Migration Issue

2011-06-29 Thread Wolfgang Laun
Steven,

2011/6/29 Steven Waldren 

> Wolfgang,
>
> The ActorType definition is here:
> https://github.com/openhealthdata/CCR-Validator/blob/drools5.0/src/main/java/org/astm/ccr/ActorType.java
>
>
> The
> point of this rule (and the other rules in this package) is to "walk"
> through a very complex object graph and insert the objects into working
> memory.
>

Should this this single file ActorType.drl be doing all of these insertions?
Then I don't think this is going to work (but not related to the NPE).

Does the problem occur if you use just this file?

-W

>
> I do not use the rule attribute "dialect".  The drl in question is here:
> https://github.com/openhealthdata/CCR-Validator/blob/drools5.0/src/main/resources/rules/core/ActorType.drl
>
>
> I
> tried to create a simple project that caused the same error, but I create a
> Class with inner classes similar to ActorType and write a rule like the one
> in question, but it does not cause the error.
>
> Thanks,
> Steven
> --
> Steven E. Waldren, MD MS
> Co-founder, Open Health Data
>
>
>
> On Jun 29, 2011, at 2:49 AM, rules-users-requ...@lists.jboss.org wrote:
>
> Date: Wed, 29 Jun 2011 09:49:10 +0200
> From: Wolfgang Laun 
> Subject: Re: [rules-users] Drools 5.0 -> 5.2 Migration Issue
> To: Rules Users List 
> Message-ID: 
> Content-Type: text/plain; charset="iso-8859-1"
>
>
> Please provide the type declaration for ActorType.Person, field gender and
> typicial examples how gender fields are used in other rules. Ideally, if
> you
> could reduce your rule set to this simple rule and one other rule, still
> causeing the same problem.
>
> Also, do you use "dialect 'mvel'"?
>
> -W
>
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Range operator in Excel Decision Table

2011-06-29 Thread GrooV
It actually even seems to fail when I add a 2nd column with age < 65 and age
> 18 in the first

Generated rules:
package rule_table;
#generated from Decision Table
import com.test.Person;
#From row number: 11
rule "_11"

when
person : Person(age > 18, age < 65)
then
person.setScore(100);
System.out.println(person.getName());
end

--
View this message in context: 
http://drools.46999.n3.nabble.com/Range-operator-in-Excel-Decision-Table-tp3120750p3121249.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools 5.0 -> 5.2 Migration Issue

2011-06-29 Thread Steven Waldren
Wolfgang,

The ActorType definition is here:  
https://github.com/openhealthdata/CCR-Validator/blob/drools5.0/src/main/java/org/astm/ccr/ActorType.java

The point of this rule (and the other rules in this package) is to "walk" 
through a very complex object graph and insert the objects into working memory.

I do not use the rule attribute "dialect".  The drl in question is here: 
https://github.com/openhealthdata/CCR-Validator/blob/drools5.0/src/main/resources/rules/core/ActorType.drl

I tried to create a simple project that caused the same error, but I create a 
Class with inner classes similar to ActorType and write a rule like the one in 
question, but it does not cause the error.

Thanks,
Steven
--
Steven E. Waldren, MD MS
Co-founder, Open Health Data



On Jun 29, 2011, at 2:49 AM, rules-users-requ...@lists.jboss.org wrote:

> Date: Wed, 29 Jun 2011 09:49:10 +0200
> From: Wolfgang Laun 
> Subject: Re: [rules-users] Drools 5.0 -> 5.2 Migration Issue
> To: Rules Users List 
> Message-ID: 
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Please provide the type declaration for ActorType.Person, field gender and
> typicial examples how gender fields are used in other rules. Ideally, if you
> could reduce your rule set to this simple rule and one other rule, still
> causeing the same problem.
> 
> Also, do you use "dialect 'mvel'"?
> 
> -W

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Range operator in Excel Decision Table

2011-06-29 Thread GrooV
That syntax error probably slipped in when I copied the files, it should be
age instead of agepe.

I fixed the local/member object problem and added the constraint like you
said but the rule still doesn't match (the constraint age >= 0 does match
but not the age range)

It is something with the range, because if I do age > $1 it works perfectly
but when I add age > $1 && age < $2 it doesn't.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Range-operator-in-Excel-Decision-Table-tp3120750p3121175.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] NullPointerException in RightTupleIndexHashTable.remove()

2011-06-29 Thread Weiss, Wolfgang
FYI: I tested my application with the latest Drools release 5.2.0.Final and I 
couldn't reproduce the problem described below. It seems that it is solved.

Best regards,
Wolfgang


Von: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] Im Auftrag von Weiss, Wolfgang
Gesendet: Dienstag, 21. Juni 2011 10:19
An: rules-users@lists.jboss.org
Betreff: [rules-users] NullPointerException in RightTupleIndexHashTable.remove()

Hi all!

I encountered that null pointer exceptions occur when retracting an object from 
the working memory. Sometimes the problem occurs sooner sometimes later but it 
certainly happens. I think it also depends on the workload on the machine. 
Sometimes the NPE is thrown in 'LeftTupleIndexHashTable' but mainly in 
'RightTupleIndexHashTable'. After the exception is thrown, the object to 
retract is still in the working memory. When I remove the line 'retract($obj)' 
in my rule, I don't get an exception.

The problem occurs mainly in this rule, but also in other rules:
rule "remove a cross talk"
  agenda-group "evaluation"
  activation-group "ag-crossTalk"
  lock-on-active true
  salience 40

  when
$ctf  : CrossTalkFact($persID : uniquePersonID, $ctfTimestamp : timestamp)
$pers : AnalysisCue(cueType == AnalysisCue.ACTION_STOP_TALKING, 
uniquePersonID == $persID, timestamp > $ctfTimestamp) from entry-point 
"LowLevelCueStream"
  then
retract($ctf); //the suspicious line
//... do some other things
end

My configuration:
drools.dialect.java.compiler = JANINO
 EventProcessingOption = STREAM

I was able to reproduce the problem with following versions:
5.1.1
 5.2.0.M1
 5.2.0.CR1


Stack trace from the version: 5.2.0.CR1
org.drools.runtime.rule.ConsequenceException: rule: remove a cross talk
at 
org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at 
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:915)
at 
org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:844)
at 
org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1055)
at 
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:733)
at 
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:699)
at 
org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)
...
Caused by: java.lang.NullPointerException
at 
org.drools.core.util.RightTupleIndexHashTable.remove(RightTupleIndexHashTable.java:351)
at org.drools.reteoo.NotNode.retractRightTuple(NotNode.java:178)
at 
org.drools.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:235)
at 
org.drools.reteoo.EntryPointNode.retractObject(EntryPointNode.java:229)
at 
org.drools.common.NamedEntryPoint.retract(NamedEntryPoint.java:529)
at 
org.drools.base.DefaultKnowledgeHelper.retract(DefaultKnowledgeHelper.java:226)
at 
eu.ta2.orchestration.engine.cueLifter.Rule_remove_a_cross_talk_0.defaultConsequence(Unknown
 Source)
at 
eu.ta2.orchestration.engine.cueLifter.Rule_remove_a_cross_talk_0DefaultConsequenceInvoker.evaluate(Unknown
 Source)
at 
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:905)
... 31 more


Sometimes the exception occurs in the LeftTupleIndexHashTable:
org.drools.runtime.rule.ConsequenceException: rule: remove a cross talk
at 
org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at 
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:915)
at 
org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:844)
at 
org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1055)
at 
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:733)
at 
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:699)
at 
org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)
...
Caused by: java.lang.NullPointerException
at 
org.drools.core.util.LeftTupleIndexHashTable.remove(LeftTupleIndexHashTable.java:275)
at org.drools.reteoo.NotNode.retractLeftTuple(NotNode.java:231)
at 
org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateRetractLeftTuple(SingleLeftTupleSinkAdapter.java:212)
at 
org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateRetractLeftTuple(SingleLeftTupleSinkAdapter.java:86)
at 
org.drools.reteoo.JoinNode.retractLeftTuple(JoinNode.java:210)

Re: [rules-users] Range operator in Excel Decision Table

2011-06-29 Thread Wolfgang Laun
ScoreParser had a syntax error (agepe != age).

You also have a confusing mixture of a method-local Person object and a
member Person in class ScoreParser. Not knowing how you call ScoreParser,
all bets are off.

I suggest you add another rule with a constraint age >= 0 and an action
printing the Person - to see whether the fact is in the WM.

-W


On 29 June 2011 12:46, GrooV  wrote:

> I changed the RuleSet cell to RuleSet com.test but that gave me an error
> that
> Person couldn't be found, I then added import com.test.Person and it still
> didn't match the rule (Person was found now)
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Range-operator-in-Excel-Decision-Table-tp3120750p3121093.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Range operator in Excel Decision Table

2011-06-29 Thread GrooV
I changed the RuleSet cell to RuleSet com.test but that gave me an error that
Person couldn't be found, I then added import com.test.Person and it still
didn't match the rule (Person was found now)

--
View this message in context: 
http://drools.46999.n3.nabble.com/Range-operator-in-Excel-Decision-Table-tp3120750p3121093.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Guvnor guided editor problem - "add more options"

2011-06-29 Thread capeja
Hi,

I installed the latest jboss-6.0.0.Final and top of it the appropriate .war
file from guvnor-distribution-5.2.0.Final (with the modifications as
instructed by Marros). Guvnor does not start (404 error) anymore. 

I would need your help on this. Thanks in advance.

Starting Jboss gives the following debug output:

Calling C:\drools\jboss-6.0.0.Final\bin\run.conf.bat
===

  JBoss Bootstrap Environment

  JBOSS_HOME: C:\drools\jboss-6.0.0.Final

  JAVA: c:\Program Files\Java\jdk1.6.0_26\bin\java

  JAVA_OPTS: -Dprogram.name=run.bat -Xms128M -Xmx512M -XX:MaxPermSize=256M
-Dsun.rmi.dgc.client.gcInterval=360
-Dsun.rmi.dgc.server.gcInterval=360 -Dorg.jboss.resolver.warning=true
-server

  CLASSPATH: c:\Program
Files\Java\jdk1.6.0_26\lib\tools.jar;C:\drools\jboss-6.0.0.Final\bin\run.jar

===

13:30:25,094 INFO  [AbstractJBossASServerBase] Server Configuration:

JBOSS_HOME URL: file:/C:/drools/jboss-6.0.0.Final/
Bootstrap: $JBOSS_HOME\server/default/conf/bootstrap.xml
Common Base: $JBOSS_HOME\common/
Common Library: $JBOSS_HOME\common/lib/
Server Name: default
Server Base: $JBOSS_HOME\server/
Server Library: $JBOSS_HOME\server/default/lib/
Server Config: $JBOSS_HOME\server/default/conf/
Server Home: $JBOSS_HOME\server/default/
Server Data: $JBOSS_HOME\server/default/data/
Server Log: $JBOSS_HOME\server/default/log/
Server Temp: $JBOSS_HOME\server/default/tmp/

13:30:25,102 INFO  [AbstractServer] Starting: JBossAS [6.0.0.Final "Neo"]
13:30:29,293 INFO  [ServerInfo] Java version: 1.6.0_26,Sun Microsystems Inc.
13:30:29,293 INFO  [ServerInfo] Java Runtime: Java(TM) SE Runtime
Environment (build 1.6.0_26-b03)
13:30:29,293 INFO  [ServerInfo] Java VM: Java HotSpot(TM) 64-Bit Server VM
20.1-b02,Sun Microsystems Inc.
13:30:29,293 INFO  [ServerInfo] OS-System: Windows 7 6.1,amd64
13:30:29,295 INFO  [ServerInfo] VM arguments: -Dprogram.name=run.bat
-Xms128M -Xmx512M -XX:MaxPermSize=256M
-Dsun.rmi.dgc.client.gcInterval=360
-Dsun.rmi.dgc.server.gcInterval=360 -Dorg.jboss.resolver.warning=true
-Djava.endorsed.dirs=C:\drools\jboss-6.0.0.Final\lib\endorsed 
13:30:29,408 INFO  [JMXKernel] Legacy JMX core initialized
13:30:47,426 INFO  [AbstractServerConfig] JBoss Web Services - Stack CXF
Server 3.4.1.GA
13:30:49,864 INFO  [JSFImplManagementDeployer] Initialized 3 JSF
configurations: [Mojarra-1.2, MyFaces-2.0, Mojarra-2.0]
13:31:40,925 WARNING [FileConfigurationParser] AIO wasn't located on this
platform, it will fall back to using pure Java NIO. If your platform is
Linux, install LibAIO to enable the AIO journal
13:34:43,291 WARNING [FileConfigurationParser] AIO wasn't located on this
platform, it will fall back to using pure Java NIO. If your platform is
Linux, install LibAIO to enable the AIO journal
13:34:44,287 INFO  [JMXConnector] starting JMXConnector on host
127.0.0.1:1090
13:34:44,798 INFO  [MailService] Mail Service bound to java:/Mail
13:34:47,197 INFO  [HornetQServerImpl] live server is starting..
13:34:47,340 INFO  [JournalStorageManager] Using NIO Journal
13:34:47,377 WARNING [HornetQServerImpl] Security risk! It has been detected
that the cluster admin user and password have not been changed from the
installation default. Please see the HornetQ user guide, cluster chapter,
for instructions on how to do this.
13:34:49,547 INFO  [NettyAcceptor] Started Netty Acceptor version
3.2.1.Final-r2319 127.0.0.1:5445 for CORE protocol
13:34:49,555 INFO  [NettyAcceptor] Started Netty Acceptor version
3.2.1.Final-r2319 127.0.0.1:5455 for CORE protocol
13:34:49,560 INFO  [HornetQServerImpl] HornetQ Server version 2.1.2.Final
(Colmeia, 120) started
13:34:49,685 INFO  [WebService] Using RMI server codebase:
http://127.0.0.1:8083/
13:34:50,066 INFO  [jbossatx] ARJUNA-32010 JBossTS Recovery Service (tag:
JBOSSTS_4_14_0_Final) - JBoss Inc.
13:34:50,078 INFO  [arjuna] ARJUNA-12324 Start RecoveryActivators
13:34:50,127 INFO  [arjuna] ARJUNA-12296 ExpiredEntryMonitor running at ke,
29 kesä 2011 13:34:50
13:34:50,253 INFO  [arjuna] ARJUNA-12310 Recovery manager listening on
endpoint 127.0.0.1:4712
13:34:50,254 INFO  [arjuna] ARJUNA-12344 RecoveryManagerImple is ready on
port 4712
13:34:50,255 INFO  [jbossatx] ARJUNA-32013 Starting transaction recovery
manager
13:34:50,277 INFO  [arjuna] ARJUNA-12163 Starting service
com.arjuna.ats.arjuna.recovery.ActionStatusService on port 4713
13:34:50,284 INFO  [arjuna] ARJUNA-12337 TransactionStatusManagerItem host:
127.0.0.1 port: 4713
13:34:50,293 INFO  [arjuna] ARJUNA-12170 TransactionStatusManager started on
port 4713 and host 127.0.0.1 with service
com.arjuna.ats.arjuna.recovery.ActionStatusService
13:34:50,350 INFO  [jbossatx] ARJUNA-32017 JBossTS Transaction Service (JTA
version - tag: JBOSSTS_4_14_0_Final) - JBoss Inc.
13:34:50,474

Re: [rules-users] Range operator in Excel Decision Table

2011-06-29 Thread Wolfgang Laun
There is a slight flaw in the spreadsheet. The cell RuleSet must also
contain the package name, i.e., "RuleSet com.test"

-W

On 29 June 2011 11:23, GrooV  wrote:

> Sure, Thanks!
>
> I have it attached.
>
> http://drools.46999.n3.nabble.com/file/n3120885/CheckAccepted.rar
> CheckAccepted.rar
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Range-operator-in-Excel-Decision-Table-tp3120750p3120885.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] activation dependent of rule order in drl file in 5.2.0.Final?

2011-06-29 Thread Wolfgang Laun
Hi Florian,

this appears to be a bug in 5.2.0 - I was able to reproduce it. First
experiments suggest
that this is due to an indirect field access in combination with a
comparison to true or false,
such as

   Wrapper( this.product.boolean4 == true )

If you simply use

   Wrapper( this.product.boolean4 )

it is OK - the latter being possible only in 5.2.0.

Simple field accesses and comparisons to true/false are OK, as in
  Product( bool6 == true )

-W


2011/6/28 Florian Beckmann 

> Hi,
>
> because of https://issues.jboss.org/browse/JBRULES-2942 i just migrated
> our
> (maven) project to 5.2.0.Final - we depend on salience in some of our
> rules.
>
> However, after the salience issue was gone I'm facing a new problem in
> several
> test cases:
> Rules in previously (drools 5.1.1) working rule files don't get activated
> anymore when I insert facts - none at all.
> When moving the rule expected to fire (see "rule 4" in attached file)  to
> the
> first position in the drl file then suddenly several rules get activated
> and the
> expected rule fires.
>
> This shouldn't be the case, shouldn't it? Or do I miss something obvious
> here?
>
> Could a corrupt file somehow cause this?
>
> I attachached the rule file which causes the problem (I needed to obfuscate
> some names, sry). It is quite simple.
>
> I experienced a similar issue (again since 5.2.0.Final) with rules
> generated
> from templates, where I had to change the constraints order in the
> templates'
> LHS for then generated rules to get activated at all.
>
> First I would like to know if my statement that the rule position in the
> drl
> file shouldn't influence the activation (I don't mean firing or order of
> activations) of a rule at all, is correct.
> I don't use agenda groups.
>
> And second if someone experienced similar issues.
>
> I will try to build a test case which hopefully can reproduce this as soon
> as
> possible.
>
>
> Florian
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Range operator in Excel Decision Table

2011-06-29 Thread GrooV
Sure, Thanks!

I have it attached.

http://drools.46999.n3.nabble.com/file/n3120885/CheckAccepted.rar
CheckAccepted.rar 

--
View this message in context: 
http://drools.46999.n3.nabble.com/Range-operator-in-Excel-Decision-Table-tp3120750p3120885.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Range operator in Excel Decision Table

2011-06-29 Thread Michael Anstis
Can you post your entire example code, and we'll have a look.

On 29 June 2011 10:01, GrooV  wrote:

> I am using Drools 5.1.1 and indeed when I print the rules I see that it is
> correctly parsed but it when I run it with age 28 im not getting the
> correct
> output that the rule has ran successfully.
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Range-operator-in-Excel-Decision-Table-tp3120750p3120817.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Range operator in Excel Decision Table

2011-06-29 Thread GrooV
I am using Drools 5.1.1 and indeed when I print the rules I see that it is
correctly parsed but it when I run it with age 28 im not getting the correct
output that the rule has ran successfully.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Range-operator-in-Excel-Decision-Table-tp3120750p3120817.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Range operator in Excel Decision Table

2011-06-29 Thread Michael Anstis
What version of Drools are you using?

I tried with 5.2 (uploaded to Guvnor, to be honest, and viewed the source)
and it looks OK:-

1.|#generated from Decision Table2.|# rule values at B10, header at B53.|
rule "_10"4.|when5.|person : Person(age > 18 && < 65)6.|then
7.|person.setScore(100);8.|System.out.println("Accepted");9.
|end

On 29 June 2011 09:28, GrooV  wrote:

> Hi,
>
> Im currently trying to get a small decision table working with a range
> operator using a simple Person object to check if its age fits within the
> range. It doesn’t matter what I use and I tried almost all possibility’s I
> find online:
>
> •   Age > $1, age < $2
> •   Age > $1 && < $2
> •   Age > $1 && age < $2
> •   Age > $1, < $2
>
> None of em seem to work. But when I try age > $1 of age > $1 || < $2 it
> works. I can’t see what im doing wrong since most tutorials I follow use
> this operator to check if an age fits in the range.
>
> I attached the Excel sheet to this post.
>
> Thanks in advance,
>
> Matthijs
>
> http://drools.46999.n3.nabble.com/file/n3120750/CheckAccepted.xls
> CheckAccepted.xls
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Range-operator-in-Excel-Decision-Table-tp3120750p3120750.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Range operator in Excel Decision Table

2011-06-29 Thread GrooV
Hi, 

Im currently trying to get a small decision table working with a range
operator using a simple Person object to check if its age fits within the
range. It doesn’t matter what I use and I tried almost all possibility’s I
find online: 

•   Age > $1, age < $2 
•   Age > $1 && < $2 
•   Age > $1 && age < $2 
•   Age > $1, < $2 

None of em seem to work. But when I try age > $1 of age > $1 || < $2 it
works. I can’t see what im doing wrong since most tutorials I follow use
this operator to check if an age fits in the range. 

I attached the Excel sheet to this post. 

Thanks in advance, 

Matthijs 

http://drools.46999.n3.nabble.com/file/n3120750/CheckAccepted.xls
CheckAccepted.xls 

--
View this message in context: 
http://drools.46999.n3.nabble.com/Range-operator-in-Excel-Decision-Table-tp3120750p3120750.html
Sent from the Drools: User forum mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools 5.0 -> 5.2 Migration Issue

2011-06-29 Thread Wolfgang Laun
Please provide the type declaration for ActorType.Person, field gender and
typicial examples how gender fields are used in other rules. Ideally, if you
could reduce your rule set to this simple rule and one other rule, still
causeing the same problem.

Also, do you use "dialect 'mvel'"?

-W


2011/6/28 Steven Waldren 

> I am working to migrate my project from 5.0 to 5.2.0 Final.  I am getting
> an error that I cannot figure out how to fix.
>
> I get the error stack trace below my email signature.  The only thing the
> consequence does is insert an object.  This rule worked well in 5.0, and
> some of the early 5.2.0-snapshot builds.  When I comment out the rule, I get
> the same error for a similar rule.
>
> The rule:
>
> rule "ccr - Person"
> when
> ActorType.Person($g:gender != null)
> then
> insert($g);
> end
>
> The documentation does not say this is an incorrect syntax. Any help would
> be appreciated.
>
> Best,
> Steven
> --
> Steven E. Waldren, MD MS
> Co-founder, Open Health Data
> swald...@openhealthdata.com
>
>
>  validateTest(org.openhealthdata.validator.ValidatorManagerTest)  Time
> elapsed: 11.699 sec  <<< ERROR!
> org.drools.runtime.rule.ConsequenceException: rule: ccr - Person
>
> at
> org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
> at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:916)
> at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:845)
> at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1056)
> at
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:733)
> at
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:699)
> at
> org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)
> at
> org.openhealthdata.validator.ValidationManager.validate(ValidationManager.java:158)
> at
> org.openhealthdata.validator.ValidationManager.validate(ValidationManager.java:108)
> at
> org.openhealthdata.validator.ValidatorManagerTest.validateTest(ValidatorManagerTest.java:26)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> at
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> at
> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
> at $Proxy0.invoke(Unknown Source)
> at
> org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
> at
> org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
> at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
> Caused by: org.drools.RuntimeDroolsException: Exception executing
> predicate
> at
> org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:298)
> at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:130)
> at
> org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:450)
> at
> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:378)
> at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:134)
> at
> org.drools.reteo

Re: [rules-users] Date arithmetic in when part

2011-06-29 Thread Wolfgang Laun
Currently (5.2.0, but not <= 5.1.1) you can do:

rule future
when
Date( $t: time ) from new Date()
$p: Person( $dob: dob after[0] $t )
then
System.out.println( $p.getName() + " not born yet." );
end

There are indeed some restrictions w.r.t. the use of temporal operators but
comparing Date/long field to Date/long field is OK.

(@Lisa: You realize that new Date() is somewhat unprecise when used to mean
"today".)

-W

On 29 June 2011 01:04, lhorton  wrote:

> Interesting.  I tried to use this syntax to find out if a date is older
> than
> "now" using this source:
>
> $p2: Person( $dob2: dob before[3d] new Date() )
>
> but I get and exception: org.drools.RuntimeDroolsException: The 'before'
> operator can only be used to compare one event to another, and never to
> compare to literal constraints.
>
> any idea how to compare to "new Date()"?  I had already written a function
> to do this date comparison, but will use the Drools syntax instead if I can
> get this to work.
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/rules-users-Date-arithmetic-in-when-part-tp3118246p3119793.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools with Spring - Need Help

2011-06-29 Thread anilkapoor
can anybody guide me in this...

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-with-Spring-Need-Help-tp3115948p3120575.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users