[rules-users] Drools 5.1 - exception when trying to use incremental KB updates.

2010-08-12 Thread Stephen Mcgruer
Just moved to Drools 5.1, using a Guvnor package as the base for a  
Knowledge Base with incremental updating enabled. Our resource is a  
Guvnor PKG. We encounter the following error when a snapshot is made:

[2010:08:224 16:08:903:debug] KnowledgeAgent: Diffing: [UrlResource  
path='http://localhost:1337/drools-guvnor/org.drools.guvnor.Guvnor/package/TEST/v0.1']
[2010:08:224 16:08:935:debug] BinaryResourceDiffProducerImpl:  
Comparing [Rule name=Resource Null-Checker, agendaGroup=MAIN,  
salience=0, no-loop=false] against [Rule name=Resource Null-Checker,  
agendaGroup=MAIN, salience=0, no-loop=false]
Exception in thread "Thread-30" org.drools.RuntimeDroolsException:  
java.lang.reflect.InvocationTargetException : [Rule name=Resource  
Null-Checker, agendaGroup=MAIN, salience=0, no-loop=false]
at 
org.drools.core.util.ReflectiveVisitor.visit(ReflectiveVisitor.java:56)
at  
org.drools.agent.impl.BinaryResourceDiffProducerImpl.diff(BinaryResourceDiffProducerImpl.java:63)
at  
org.drools.agent.impl.KnowledgeAgentImpl.incrementalBuildResources(KnowledgeAgentImpl.java:785)
at  
org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:586)
at  
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:185)
at  
org.drools.agent.impl.KnowledgeAgentImpl$ChangeSetNotificationDetector.run(KnowledgeAgentImpl.java:1106)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at 
org.drools.core.util.ReflectiveVisitor.visit(ReflectiveVisitor.java:47)
... 6 more
Caused by: java.lang.RuntimeException: this MVELReturnValueExpression  
must be compiled for equality
at  
org.drools.base.mvel.MVELReturnValueExpression.equals(MVELReturnValueExpression.java:123)
at  
org.drools.rule.ReturnValueRestriction.equals(ReturnValueRestriction.java:306)
at  
org.drools.rule.ReturnValueConstraint.equals(ReturnValueConstraint.java:121)
at java.util.Arrays.equals(Unknown Source)
at org.drools.rule.OrConstraint.equals(OrConstraint.java:132)
at java.util.AbstractList.equals(Unknown Source)
at org.drools.rule.Pattern.equals(Pattern.java:317)
at org.drools.rule.GroupElement.equals(GroupElement.java:273)
at  
org.drools.agent.impl.BinaryResourceDiffProducerImpl.compareRules(BinaryResourceDiffProducerImpl.java:258)
at  
org.drools.agent.impl.BinaryResourceDiffProducerImpl.visitRule(BinaryResourceDiffProducerImpl.java:117)
... 11 more

The rule in question is quite straight-forward, works on the initial  
load up and worked in 5.0.1 fine. It is not the rule that was just  
changed. If I remove that rule, another is just substituted in its  
place in the error message.

What might be causing this? If you need more information, please ask.

Stephen

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



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


Re: [rules-users] How to do validation of facts in a Stateful Session?

2010-08-12 Thread Stephen Mcgruer
Apologies, where I use (Java) I do indeed mean the Java code between  
calls to fireAllRules(). I'm not entirely sure about how you meant to  
do it in rules, but how do you then report back to the user that there  
is a problem? The Java code that calls fireAllRules() has to be able  
to get errors and then pass them back to the webpage (yay for a  
project structure which requires me to communicate with the front end  
by generating XML JSP pages as replies to URL requests from the PHP  
code which runs the website...)

Cheers,
Stephen

Quoting Wolfgang Laun :

> By "(Java)" do you mean Java code between calls to fireAllRules() or Java
> code
> in RHS? I think that what you describe in items 5, 6 and 7 can very well be
> written as rules, based on a Validation object inserted at the time the
> actual
> operation is done in WM. It should contain:
>- links to the old, or new, or both, Fact objects
>- the validation status (OPEN, VALID, INVALID)
>
> Need a more detailed outline?
>
> -W
>
> On 12 August 2010 10:08, Stephen Mcgruer  wrote:
>
>> Hi there,
>>
>> My project uses Drools to (among other things) validate new
>> facts/updates to old facts, according to a set of rules. (For example,
>> we might have a rule that says "No two people can be named the same
>> thing".) Our method of validation and error reporting was originally
>> chosen for a stateless session (before we had the requirement of doing
>> checks like the above), and I feel I've had to hack it a bit much to
>> get it working with stateful sessions. The current methodology is:
>>
>> 1. (Website) The user inserts/updates a fact.
>> 2. (Java) If the fact is new, an object is created for it. If it is an
>> update, the pre-existing object is fetched from the object repository
>> (the interface to the database) and a backup copy of the object is
>> taken.
>> 3. (Java) This fact is either inserted into the KnowledgeBase (KB) or
>> a pre-existing fact in the KB is updated depending.
>> 4. (Rules) If the new/updated object fails a validation rule, it will
>> be retracted and a ValidationError object will be inserted into the KB.
>> 5. (Java) The code then searches for ValidationError objects that
>> match the just inserted/updated object. If it finds any it records
>> them and then retracts them from the KB.
>> 6. (Java) If there are no errors, then that's it - a success report is
>> generated and passed back to the website.
>> 7. (Java) If there were errors, then if the user was updating a fact
>> the backup of it (before the changes) is inserted back into the KB.
>> The website is then passed a failure report.
>>
>>
>> It just feels very hacky to do so much manual insertion/retracting
>> from the Java side of the code.
>>
>> So, is there a 'correct' way to do stateful validation? And does our
>> current way even work, or are there hidden problems that we've not
>> spotted?
>>
>> Cheers,
>> Stephen
>>
>> --
>> The University of Edinburgh is a charitable body, registered in
>> Scotland, with registration number SC005336.
>>
>>
>>
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>



-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



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


[rules-users] How to do validation of facts in a Stateful Session?

2010-08-12 Thread Stephen Mcgruer
Hi there,

My project uses Drools to (among other things) validate new  
facts/updates to old facts, according to a set of rules. (For example,  
we might have a rule that says "No two people can be named the same  
thing".) Our method of validation and error reporting was originally  
chosen for a stateless session (before we had the requirement of doing  
checks like the above), and I feel I've had to hack it a bit much to  
get it working with stateful sessions. The current methodology is:

1. (Website) The user inserts/updates a fact.
2. (Java) If the fact is new, an object is created for it. If it is an  
update, the pre-existing object is fetched from the object repository  
(the interface to the database) and a backup copy of the object is  
taken.
3. (Java) This fact is either inserted into the KnowledgeBase (KB) or  
a pre-existing fact in the KB is updated depending.
4. (Rules) If the new/updated object fails a validation rule, it will  
be retracted and a ValidationError object will be inserted into the KB.
5. (Java) The code then searches for ValidationError objects that  
match the just inserted/updated object. If it finds any it records  
them and then retracts them from the KB.
6. (Java) If there are no errors, then that's it - a success report is  
generated and passed back to the website.
7. (Java) If there were errors, then if the user was updating a fact  
the backup of it (before the changes) is inserted back into the KB.  
The website is then passed a failure report.


It just feels very hacky to do so much manual insertion/retracting  
from the Java side of the code.

So, is there a 'correct' way to do stateful validation? And does our  
current way even work, or are there hidden problems that we've not  
spotted?

Cheers,
Stephen

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



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


[rules-users] Incorrect allowable comparison when using Guvnor GUI Rules - known bug?

2010-08-04 Thread Stephen Mcgruer
Hi there. I was just wondering if the following was a known bug or not  
(and if it was
fixed in Guvnor 5.1 - I am using 5.0):

I have two classes, Foo.java and Bar.java. Bar has a property in it,  
an integer (also
tried doubles, not tried anything else) called barInt. Foo also has a  
property, an
instance of Bar called fooBar.

Creating a GUI rule in Guvnor, I begin with the 'when' block. I add a  
check for a Foo. In
this Foo, I add a check upon its fooBar parameter. Now, I want to  
match on the fooBar's
barInt property being less than a hundred. So, I click on fooBar, and  
choose the 'barInt'
subfield. It appears, *BUT* there is no option for "is greater than"  
or "is less than",
only "is equals to" and "is not equals to"! I have tried manually  
creating such a rule,
and using "<" or ">" is allowed there, so it is a bug - or at least a  
missing feature
with the GUI.

I have an entire report written up, with attatched files and  
screenshots and everything,
but I just wanted to check:

A. If this is a known bug.
B. If it is fixed in Guvnor 5.1.
C. Where to submit bug reports for Guvnor.


Cheers,
Stephen


-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



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


[rules-users] Cannot work out how to get created fact to retract on change of 'when' conditions - help!

2010-08-04 Thread Stephen Mcgruer
Hey,

We have the following situation: Fact1 and Fact2 both have a 'score'  
property. They also both have a 'month' property. When a Fact1 and a  
Fact2 have the same month (at most there will only be one such pairing  
for each month), a Fact3 is created with a score made from adding the  
two base Facts scores:

rule "ExampleRule"
dialect "mvel"
when
 Fact1( fact1Month : month, fact1Score : score > 0)
 Fact2( month == fact1Month, fact2Score : score > 0)
 then
 Fact3 fact3 = new Fact3();
 fact3.setScore( fact1Score + fact2Score);
 insertLogical(fact3);
end

Our problem is that if fact1Score or fact2Score is now changed, a new  
Fact3 with a new score is created, *but* the old Fact3 is of course  
not removed - the conditions in its when still hold true as well (the  
new score is still above 0).

Can anyone think of a way to make sure that if either fact1Score or  
fact2Score is changed, then the old fact3 is removed from memory?

The only way we could at all think to do this is to add a timestamp to  
fact3, and to have another rule that retracts old fact3s if there is  
one with a newer timestamp and the same month... but it seems horribly  
messy.

Thanks,
Stephen

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



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


Re: [rules-users] Updating to 5.1 - what jars do I need to replace?

2010-08-04 Thread Stephen Mcgruer
Apologies Jervis for taking so long to get back to you - and the list.  
Unfortunately I've been unable to get time to get 5.1 installed on my  
machine again, since we're in quite a rush here to get the project  
finished. When I have a bit of free time I will reinstall 5.1 Guvnor  
and try and re-create the bug. Sorry I am unable to help right atm.

Stephen

Quoting Jervis Liu :

> Stephen Mcgruer wrote:
>> Just to note, I no longer need help with this. After discovering that
>> the Guvnor 5.1 interface did not work fully (when trying to create a
>> bean in a *when* clause, the pencil icon did not do anything - known
>> bug?) in our environment - Firefox 3.6.8 and IE 6 in Windows XP - we
>> have decided not to migrate yet.
>>
>>
> Hi Could you please be more specific on the "pencil" bug? For example,
> how to reproduce etc, a screen shot would be helpful. Please file a jira
> if its indeed a bug. This will make sure it gets fixed in the next release.
>
> BTW, why dont you simply install a new Guvnor 5.1? If you want to
> migrate your data, you can use the export function to export data to an
> xml file, then import it back to the new installation.
>
> Cheers,
> Jervis
>
>> Cheers,
>> Stephen
>>
>> Quoting Stephen Mcgruer :
>>
>>
>>> Hi guys,
>>>
>>> Really struggling with what jars I need to replace to update to Drools
>>> 5.1. I've tried replacing just the "drools" jars, but I get a
>>> "java.io.InvalidClassException:
>>> org.drools.rule.DialectRuntimeRegistry; local class incompatible:
>>> stream classdesc serialVersionUID = 5308493362083281112, local class
>>> serialVersionUID = 510" error, so I assume I need to replace more -
>>> but I don't know which. I tried replacing all of the ones that had new
>>> versions in the drools 5.1 binaries, but this caused Hibernate to fail
>>> on runtime, claiming it couldnt understand annotations! The following
>>> is a list of the jars currently in the project for Drools 5.0 - I did
>>> not put together this list originally, so some might not be needed but
>>> I dont know which. I would much appreciate some help working out which
>>> jars I need to change to get my code to talk to Guvnor 5.1...
>>>
>>> Main lib:
>>>
>>> activation-1.1.jar
>>> antlr-2.7.6.jar
>>> antlrworks-1.3.1.jar
>>> btm-1.3.2.jar
>>> com.springsource.org.apache.commons.pool-1.5.3.jar
>>> commons-collections-3.1.jar
>>> commons-dbcp-1.4.jar
>>> commons-io-1.3.2.jar
>>> commons-lang-2.4.jar
>>> commons-logging.jar
>>> core-3.4.2.v_883_R34x.jar
>>> dom4j.jar
>>> drools-ant-5.0.1.jar
>>> drools-api-5.0.1.jar
>>> drools-compiler-5.0.1.jar
>>> drools-core-5.0.1.jar
>>> drools-decisiontables-5.0.1.jar
>>> drools-persistence-jpa-5.0.1.jar
>>> drools-process-task-5.0.1.jar
>>> drools-solver-core-5.0.1.jar
>>> drools-templates-5.0.1.jar
>>> drools-verifier-5.0.1.jar
>>> drools-workitems-5.0.1.jar
>>> ejb3-persistence.jar
>>> hibernate-annotations.jar
>>> hibernate-commons-annotations.jar
>>> hibernate-core.jar
>>> hibernate-entitymanager-3.3.2.GA.jar
>>> hibernate3.jar
>>> janino-2.5.15.jar
>>> jars.txt
>>> javassist-3.9.0.GA.jar
>>> joda-time-1.6.jar
>>> jstl.jar
>>> jta-1.1.jar
>>> junit-3.8.1.jar
>>> log4j-1.2.15.jar
>>> mail-1.4.jar
>>> mvel2-2.0.10.jar
>>> mysql-connector-java-5.1.12-bin.jar
>>> persistence-api-1.0.jar
>>> servlet-api-2.3.jar
>>> slf4j-api-1.5.6.jar
>>> slf4j-log4j12-1.5.10.jar
>>> spring-2.5.6.jar
>>> spring-beans-2.5.6.jar
>>> spring-context-2.5.6.jar
>>> spring-context-support-2.5.6.jar
>>> spring-core-2.5.6.jar
>>> spring-test-2.5.6.jar
>>> spring-web-2.5.6.jar
>>> spring-webmvc.jar
>>> spring.jar
>>> standard.jar
>>> xpp3_min-1.1.4c.jar
>>> xstream-1.3.1.jar
>>>
>>>
>>>
>>>
>>>
>>>
>>> WEBINF:
>>>
>>> antlr-2.7.6.jar
>>> antlrworks-1.3.1.jar
>>> com.springsource.org.apache.commons.pool-1.5.3.jar
>>> commons-collections-3.1.jar
>>> commons-dbcp-1.4.jar
>>> commons-lang-2.4.jar
>>> commons-logging.jar
>>> dom4j.jar
>>> drools-ant-5.0.1.jar
>>> drools-api-5.0.1.jar
>>> drools-com

Re: [rules-users] Updating to 5.1 - what jars do I need to replace?

2010-07-29 Thread Stephen Mcgruer
Just to note, I no longer need help with this. After discovering that  
the Guvnor 5.1 interface did not work fully (when trying to create a  
bean in a *when* clause, the pencil icon did not do anything - known  
bug?) in our environment - Firefox 3.6.8 and IE 6 in Windows XP - we  
have decided not to migrate yet.

Cheers,
Stephen

Quoting Stephen Mcgruer :

> Hi guys,
>
> Really struggling with what jars I need to replace to update to Drools
> 5.1. I've tried replacing just the "drools" jars, but I get a
> "java.io.InvalidClassException:
> org.drools.rule.DialectRuntimeRegistry; local class incompatible:
> stream classdesc serialVersionUID = 5308493362083281112, local class
> serialVersionUID = 510" error, so I assume I need to replace more -
> but I don't know which. I tried replacing all of the ones that had new
> versions in the drools 5.1 binaries, but this caused Hibernate to fail
> on runtime, claiming it couldnt understand annotations! The following
> is a list of the jars currently in the project for Drools 5.0 - I did
> not put together this list originally, so some might not be needed but
> I dont know which. I would much appreciate some help working out which
> jars I need to change to get my code to talk to Guvnor 5.1...
>
> Main lib:
>
> activation-1.1.jar
> antlr-2.7.6.jar
> antlrworks-1.3.1.jar
> btm-1.3.2.jar
> com.springsource.org.apache.commons.pool-1.5.3.jar
> commons-collections-3.1.jar
> commons-dbcp-1.4.jar
> commons-io-1.3.2.jar
> commons-lang-2.4.jar
> commons-logging.jar
> core-3.4.2.v_883_R34x.jar
> dom4j.jar
> drools-ant-5.0.1.jar
> drools-api-5.0.1.jar
> drools-compiler-5.0.1.jar
> drools-core-5.0.1.jar
> drools-decisiontables-5.0.1.jar
> drools-persistence-jpa-5.0.1.jar
> drools-process-task-5.0.1.jar
> drools-solver-core-5.0.1.jar
> drools-templates-5.0.1.jar
> drools-verifier-5.0.1.jar
> drools-workitems-5.0.1.jar
> ejb3-persistence.jar
> hibernate-annotations.jar
> hibernate-commons-annotations.jar
> hibernate-core.jar
> hibernate-entitymanager-3.3.2.GA.jar
> hibernate3.jar
> janino-2.5.15.jar
> jars.txt
> javassist-3.9.0.GA.jar
> joda-time-1.6.jar
> jstl.jar
> jta-1.1.jar
> junit-3.8.1.jar
> log4j-1.2.15.jar
> mail-1.4.jar
> mvel2-2.0.10.jar
> mysql-connector-java-5.1.12-bin.jar
> persistence-api-1.0.jar
> servlet-api-2.3.jar
> slf4j-api-1.5.6.jar
> slf4j-log4j12-1.5.10.jar
> spring-2.5.6.jar
> spring-beans-2.5.6.jar
> spring-context-2.5.6.jar
> spring-context-support-2.5.6.jar
> spring-core-2.5.6.jar
> spring-test-2.5.6.jar
> spring-web-2.5.6.jar
> spring-webmvc.jar
> spring.jar
> standard.jar
> xpp3_min-1.1.4c.jar
> xstream-1.3.1.jar
>
>
>
>
>
>
> WEBINF:
>
> antlr-2.7.6.jar
> antlrworks-1.3.1.jar
> com.springsource.org.apache.commons.pool-1.5.3.jar
> commons-collections-3.1.jar
> commons-dbcp-1.4.jar
> commons-lang-2.4.jar
> commons-logging.jar
> dom4j.jar
> drools-ant-5.0.1.jar
> drools-api-5.0.1.jar
> drools-compiler-5.0.1.jar
> drools-core-5.0.1.jar
> drools-decisiontables-5.0.1.jar
> drools-persistence-jpa-5.0.1.jar
> drools-process-task-5.0.1.jar
> drools-templates-5.0.1.jar
> drools-verifier-5.0.1.jar
> drools-workitems-5.0.1.jar
> ejb3-persistence.jar
> hibernate-annotations.jar
> hibernate-commons-annotations.jar
> hibernate-core.jar
> hibernate3.jar
> javassist-3.9.0.GA.jar
> jstl.jar
> jta-1.1.jar
> log4j-1.2.15.jar
> mvel2-2.0.10.jar
> mysql-connector-java-5.1.12-bin.jar
> slf4j-api-1.5.6.jar
> slf4j-log4j12-1.5.10.jar
> spring-webmvc.jar
> spring.jar
> standard.jar
> test.txt
> xstream-1.3.1.jar
>
>
>
> Cheers,
> Stephen
>
> --
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
>
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>



-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



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


[rules-users] Updating to 5.1 - what jars do I need to replace?

2010-07-29 Thread Stephen Mcgruer
Hi guys,

Really struggling with what jars I need to replace to update to Drools  
5.1. I've tried replacing just the "drools" jars, but I get a  
"java.io.InvalidClassException:  
org.drools.rule.DialectRuntimeRegistry; local class incompatible:  
stream classdesc serialVersionUID = 5308493362083281112, local class  
serialVersionUID = 510" error, so I assume I need to replace more -  
but I don't know which. I tried replacing all of the ones that had new  
versions in the drools 5.1 binaries, but this caused Hibernate to fail  
on runtime, claiming it couldnt understand annotations! The following  
is a list of the jars currently in the project for Drools 5.0 - I did  
not put together this list originally, so some might not be needed but  
I dont know which. I would much appreciate some help working out which  
jars I need to change to get my code to talk to Guvnor 5.1...

Main lib:

activation-1.1.jar
antlr-2.7.6.jar
antlrworks-1.3.1.jar
btm-1.3.2.jar
com.springsource.org.apache.commons.pool-1.5.3.jar
commons-collections-3.1.jar
commons-dbcp-1.4.jar
commons-io-1.3.2.jar
commons-lang-2.4.jar
commons-logging.jar
core-3.4.2.v_883_R34x.jar
dom4j.jar
drools-ant-5.0.1.jar
drools-api-5.0.1.jar
drools-compiler-5.0.1.jar
drools-core-5.0.1.jar
drools-decisiontables-5.0.1.jar
drools-persistence-jpa-5.0.1.jar
drools-process-task-5.0.1.jar
drools-solver-core-5.0.1.jar
drools-templates-5.0.1.jar
drools-verifier-5.0.1.jar
drools-workitems-5.0.1.jar
ejb3-persistence.jar
hibernate-annotations.jar
hibernate-commons-annotations.jar
hibernate-core.jar
hibernate-entitymanager-3.3.2.GA.jar
hibernate3.jar
janino-2.5.15.jar
jars.txt
javassist-3.9.0.GA.jar
joda-time-1.6.jar
jstl.jar
jta-1.1.jar
junit-3.8.1.jar
log4j-1.2.15.jar
mail-1.4.jar
mvel2-2.0.10.jar
mysql-connector-java-5.1.12-bin.jar
persistence-api-1.0.jar
servlet-api-2.3.jar
slf4j-api-1.5.6.jar
slf4j-log4j12-1.5.10.jar
spring-2.5.6.jar
spring-beans-2.5.6.jar
spring-context-2.5.6.jar
spring-context-support-2.5.6.jar
spring-core-2.5.6.jar
spring-test-2.5.6.jar
spring-web-2.5.6.jar
spring-webmvc.jar
spring.jar
standard.jar
xpp3_min-1.1.4c.jar
xstream-1.3.1.jar






WEBINF:

antlr-2.7.6.jar
antlrworks-1.3.1.jar
com.springsource.org.apache.commons.pool-1.5.3.jar
commons-collections-3.1.jar
commons-dbcp-1.4.jar
commons-lang-2.4.jar
commons-logging.jar
dom4j.jar
drools-ant-5.0.1.jar
drools-api-5.0.1.jar
drools-compiler-5.0.1.jar
drools-core-5.0.1.jar
drools-decisiontables-5.0.1.jar
drools-persistence-jpa-5.0.1.jar
drools-process-task-5.0.1.jar
drools-templates-5.0.1.jar
drools-verifier-5.0.1.jar
drools-workitems-5.0.1.jar
ejb3-persistence.jar
hibernate-annotations.jar
hibernate-commons-annotations.jar
hibernate-core.jar
hibernate3.jar
javassist-3.9.0.GA.jar
jstl.jar
jta-1.1.jar
log4j-1.2.15.jar
mvel2-2.0.10.jar
mysql-connector-java-5.1.12-bin.jar
slf4j-api-1.5.6.jar
slf4j-log4j12-1.5.10.jar
spring-webmvc.jar
spring.jar
standard.jar
test.txt
xstream-1.3.1.jar



Cheers,
Stephen

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



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


[rules-users] How to compare java.sql.Dates in a Drools 'when'

2010-07-28 Thread Stephen Mcgruer
Hi there,

Sorry for so many questions today. How would one compare dates in a  
Drools when/then rule? I have an object, Tool, that has a last used  
field which is a java.sql.Date (yes, this is a fairly bad type for it  
to be. Long story.). I want to write a rule to check if there is a  
Tool that has this date set in the future. Now, to get the current  
date/time (in Java!) you would do:

java.util.Date today = new java.util.Date();
java.sql.Date sqlToday = new java.sql.Date(today.getTime());

But how do I do something like this in a Drools rule?! (Where I want  
to compare last used to sqlToday).

Thanks,
Stephen

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


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


Re: [rules-users] 401 error when attempting to get PKG for changeset.

2010-07-28 Thread Stephen Mcgruer
Kris,

Thanks for the post, but I have tried something like that:


 
 
 


And unfortunately this didn't work! D=


Sudden thought - I am running the old Drools jar files - 5.0.1. Would  
these need to be updated to work with Guvnor 5.1?

Stephen

Quoting Kris Verlaenen :

> Stephen,
>
> Something like this:
>  xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
> xs:schemaLocation='http://drools.org/drools-5.0/change-set
> drools-change-set-5.0.xsd' >
> 
>  source='http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defaultPackage/LATEST'
> type='PKG' basicAuthentication="enabled" username="admin" password="admin"
> />
> 
> Kris
>
> - Original Message -
> From: "Stephen Mcgruer" 
> To: 
> Sent: Wednesday, July 28, 2010 1:09 PM
> Subject: [rules-users] 401 error when attempting to get PKG for changeset.
>
>
>> I have the following changeset:
>>
>> > xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
>> xs:schemaLocation='http://drools.org/drools-5.0/change-set
>> drools-change-set-5.0.xsd' >
>> 
>> > source='http://localhost:1337/drools-guvnor/org.drools.guvnor.Guvnor/package/TEST/v0.1'
>> type='PKG' />
>> 
>> 
>>
>> I just updated to the RC of Guvnor, and my PKG address now demands a
>> username and
>> password when I try and access it. Anything works, which is fine, but
>> how do I edit the
>> changeset so that it gives the details? At the moment when I run my
>> Java WAR it just
>> moans that it gets a 401 from that URL...
>>
>> Thanks!
>>
>> --
>> The University of Edinburgh is a charitable body, registered in
>> Scotland, with registration number SC005336.
>>
>>
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>



-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



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


Re: [rules-users] How do I totally clear out an installation of Guvnor (Tomcat 6.0)

2010-07-28 Thread Stephen Mcgruer
Thanks Esteban and Jervis, that worked. Just in case it's important,  
the repository file and directory were actually in the $TOMCAT_HOME  
folder, not under bin.

Cheers,
Stephen

Quoting Esteban Aliverti :

> Go to $TOMCAT_HOME/bin and remove *repository.xml* file and
> *respository*directory.
>
>
> Best,
>
> 
>
> Esteban Aliverti
> - Developer @ http://www.plugtree.com
> - Blog @ http://ilesteban.wordpress.com
>
>
> On Wed, Jul 28, 2010 at 7:51 AM, Jervis Liu  wrote:
>
>> Stephen Mcgruer wrote:
>> > Hi there,
>> >
>> > I'm migrating to Guvnor RC atm, and was wanting to completely clear
>> > out my Guvnor Packages files before I did so - I wanted everything
>> > gone. I thought that all information was stored in the Guvnor folder
>> > created in Tomcat/webapps, so I deleted that, restarted the server and
>> > dragged in the new Guvnor RC WAR file. This built itself fine and is
>> > up and running on the server - but my packages are still there! Where
>> > abouts are these kept in Apache Tomcat? I can't just delete them from
>> > within Guvnor because despite me being able to delete most of the
>> > files/packages/etc, there are three categories that claim to be 'still
>> > in use' and won't let me delete them... even though there are *no*
>> > other files left!
>> >
>> > Any help is much appreciated.
>> >
>> > Stephen
>> >
>> >
>> Guvnor repository data is stored under the bin directory of your
>> application server by default. Go to that directory, delete the file and
>> directory called "repository", then you will be fine.
>>
>> Cheers,
>> Jervis
>>
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>



-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



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


Re: [rules-users] 401 error when attempting to get PKG for changeset.

2010-07-28 Thread Stephen Mcgruer
As an update, I found this post -
http://comments.gmane.org/gmane.comp.java.drools.user/20163 - and so I tried:


 
 
 



Doesn't work. Same 401 error as before.

Stephen

Quoting Stephen Mcgruer :

> I have the following changeset:
>
>   xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
>  xs:schemaLocation='http://drools.org/drools-5.0/change-set
> drools-change-set-5.0.xsd' >
>  
>   source='http://localhost:1337/drools-guvnor/org.drools.guvnor.Guvnor/package/TEST/v0.1'
> type='PKG' />
>  
> 
>
> I just updated to the RC of Guvnor, and my PKG address now demands a
> username and
> password when I try and access it. Anything works, which is fine, but
> how do I edit the
> changeset so that it gives the details? At the moment when I run my
> Java WAR it just
> moans that it gets a 401 from that URL...
>
> Thanks!
>
> --
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>



-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



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


[rules-users] 401 error when attempting to get PKG for changeset.

2010-07-28 Thread Stephen Mcgruer
I have the following changeset:


 
 
 


I just updated to the RC of Guvnor, and my PKG address now demands a  
username and
password when I try and access it. Anything works, which is fine, but  
how do I edit the
changeset so that it gives the details? At the moment when I run my  
Java WAR it just
moans that it gets a 401 from that URL...

Thanks!

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


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


[rules-users] How do I totally clear out an installation of Guvnor (Tomcat 6.0)

2010-07-28 Thread Stephen Mcgruer
Hi there,

I'm migrating to Guvnor RC atm, and was wanting to completely clear  
out my Guvnor Packages files before I did so - I wanted everything  
gone. I thought that all information was stored in the Guvnor folder  
created in Tomcat/webapps, so I deleted that, restarted the server and  
dragged in the new Guvnor RC WAR file. This built itself fine and is  
up and running on the server - but my packages are still there! Where  
abouts are these kept in Apache Tomcat? I can't just delete them from  
within Guvnor because despite me being able to delete most of the  
files/packages/etc, there are three categories that claim to be 'still  
in use' and won't let me delete them... even though there are *no*  
other files left!

Any help is much appreciated.

Stephen

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


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


Re: [rules-users] Automatic updating of Guvnor Rules appears to be not working.

2010-06-25 Thread Stephen Mcgruer
Unfortunately that might be quite tricky, although I can try if  
necessary. I do think that perhaps the problem lies in the way I  
handle the auto-updating, I think I'm doing it wrong. Originally I  
just created the knowledge base and knowledge agent like so, and  
started the ResourceChange Notifier and Scanner services:

//construct a knowledgebase that uses Equality mode assert behaviour  
so that it can match beans properly
KnowledgeBaseConfiguration knowledgeBaseConfig =  
KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
knowledgeBaseConfig.setProperty("drools.assertBehaviour", "equality");
knowledgeBase = KnowledgeBaseFactory.newKnowledgeBase(knowledgeBaseConfig);

//create a new knowledgeAgent to track changes
knowledgeAgent = KnowledgeAgentFactory.newKnowledgeAgent(  
"knowledgeAgent", knowledgeBase );
knowledgeAgent.applyChangeSet( ResourceFactory.newClassPathResource(  
"changeSet.xml" ) );
knowledgeBase = knowledgeAgent.getKnowledgeBase();

ResourceFactory.getResourceChangeNotifierService().start();
ResourceFactory.getResourceChangeScannerService().start();


This seemed to claim to update the knowledge base, but nothing changed  
as I mentioned before. At the moment, I'm trying rebuilding the  
knowledgebase when I detect a change, but this involves re-inserting  
the entire database which could be big eventuallly... And it doesn't  
even work entirely correctly either XD.

What are the correct steps to take to keep a knowledgeBase  
auto-updating, and do you have to re-create it each time?

Thanks,
Stephen


Quoting Esteban Aliverti :

> Could you please try your example using latest SNAPSHOT or 5.1M2?
>
> Thanks
>
> On Thu, Jun 24, 2010 at 10:20 AM, Stephen Mcgruer   
> wrote:
>
>> Sorry, I'm using Drools 5.0.1
>>
>> Cheers,
>> Stephen
>>
>> Quoting Esteban Aliverti :
>>
>> > Which version of drools are you using?
>> >
>> > On Thu, Jun 24, 2010 at 5:33 AM, Stephen Mcgruer
>> > wrote:
>> >
>> >> Hi there. I'm trying to get automatic update of rules working in my
>> >> project, and seem to
>> >> have run into a problem. As far as I can tell, automatic polling and
>> >> updating is turned
>> >> on, and claims to update the knowledgebase, but changes to the rules
>> >> don't seem to have
>> >> any effect. A simple example - if I add the rule:
>> >>
>> >> rule "TestRule"
>> >> dialect "mvel"
>> >> when
>> >> then
>> >> System.out.println("Hello, world!");
>> >> end
>> >>
>> >> And start my application, I get:
>> >>
>> >> Firing all rules...
>> >> Hello, world!
>> >> All rules fired.
>> >>
>> >> As expected. If I then change the rule as follows:
>> >>
>> >> rule "TestRule"
>> >> dialect "mvel"
>> >> when
>> >> then
>> >> System.out.println("I have changed!");
>> >> end
>> >>
>> >> I get this output (timestamps trimmed for readability):
>> >>
>> >> ResourceChangeScanner attempt to scan 1 resources
>> >> ResourceChangeScanner modified resource=[UrlResource
>> >> path='
>> >>
>> http://localhost:1337/drools-guvnor/org.drools.guvnor.Guvnor/package/ERMIE/v0.1
>> >> ']
>> >> :
>> >> 1277371031000 : 1277371254000
>> >> ResourceChangeNotification received ChangeSet notification
>> >> ResourceChangeScanner thread is waiting for 60
>> >> ResourceChangeNotification processing ChangeSet
>> >> ResourceChangeNotification ChangeSet modified resource=[UrlResource
>> >> path='
>> >>
>> http://localhost:1337/drools-guvnor/org.drools.guvnor.Guvnor/package/ERMIE/v0.1
>> >> ']
>> >> for listener=org.drools.agent.impl.knowledgeagenti...@e2d0b2
>> >> KnowledgeAgent received ChangeSet changed notification
>> >> ResourceChangeNotification thread is waiting for queue update
>> >> KnowledgAgent applying ChangeSet
>> >> KnowledgeAgent ChangeSet requires KnowledgeBuilderKnowledgeAgent
>> >> rebuilding KnowledgeBase
>> >> using ChangeSet
>> >> KnowledgeAgent building resource=[UrlResource
>> >> path='
>> >>
>> http://localhost:1337/drools-guvnor/org.drools.guvnor.Guvnor/package/ERMIE/v0.1
>> &

Re: [rules-users] Automatic updating of Guvnor Rules appears to be not working.

2010-06-24 Thread Stephen Mcgruer
Sorry, I'm using Drools 5.0.1

Cheers,
Stephen

Quoting Esteban Aliverti :

> Which version of drools are you using?
>
> On Thu, Jun 24, 2010 at 5:33 AM, Stephen Mcgruer   
> wrote:
>
>> Hi there. I'm trying to get automatic update of rules working in my
>> project, and seem to
>> have run into a problem. As far as I can tell, automatic polling and
>> updating is turned
>> on, and claims to update the knowledgebase, but changes to the rules
>> don't seem to have
>> any effect. A simple example - if I add the rule:
>>
>> rule "TestRule"
>> dialect "mvel"
>> when
>> then
>> System.out.println("Hello, world!");
>> end
>>
>> And start my application, I get:
>>
>> Firing all rules...
>> Hello, world!
>> All rules fired.
>>
>> As expected. If I then change the rule as follows:
>>
>> rule "TestRule"
>> dialect "mvel"
>> when
>> then
>> System.out.println("I have changed!");
>> end
>>
>> I get this output (timestamps trimmed for readability):
>>
>> ResourceChangeScanner attempt to scan 1 resources
>> ResourceChangeScanner modified resource=[UrlResource
>> path='
>> http://localhost:1337/drools-guvnor/org.drools.guvnor.Guvnor/package/ERMIE/v0.1
>> ']
>> :
>> 1277371031000 : 1277371254000
>> ResourceChangeNotification received ChangeSet notification
>> ResourceChangeScanner thread is waiting for 60
>> ResourceChangeNotification processing ChangeSet
>> ResourceChangeNotification ChangeSet modified resource=[UrlResource
>> path='
>> http://localhost:1337/drools-guvnor/org.drools.guvnor.Guvnor/package/ERMIE/v0.1
>> ']
>> for listener=org.drools.agent.impl.knowledgeagenti...@e2d0b2
>> KnowledgeAgent received ChangeSet changed notification
>> ResourceChangeNotification thread is waiting for queue update
>> KnowledgAgent applying ChangeSet
>> KnowledgeAgent ChangeSet requires KnowledgeBuilderKnowledgeAgent
>> rebuilding KnowledgeBase
>> using ChangeSet
>> KnowledgeAgent building resource=[UrlResource
>> path='
>> http://localhost:1337/drools-guvnor/org.drools.guvnor.Guvnor/package/ERMIE/v0.1
>> ']
>> KnowledgeAgent adding KnowledgeDefinitionsPackage ERMIE
>> KnowledgeAgent new KnowledgeBase now built and in use
>>
>> So, this makes it seem like everything has worked. However, if I
>> insert a new fact and
>> fire all rules...
>>
>> Inserting new fact...
>> Hello, World!
>>
>> So, it hasn't worked. What might I have done wrong?
>>
>>
>> -Stephen
>>
>> --
>> The University of Edinburgh is a charitable body, registered in
>> Scotland, with registration number SC005336.
>>
>>
>>
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>
>
> --
> 
>
> Esteban Aliverti
>



-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



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


[rules-users] Automatic updating of Guvnor Rules appears to be not working.

2010-06-24 Thread Stephen Mcgruer
Hi there. I'm trying to get automatic update of rules working in my  
project, and seem to
have run into a problem. As far as I can tell, automatic polling and  
updating is turned
on, and claims to update the knowledgebase, but changes to the rules  
don't seem to have
any effect. A simple example - if I add the rule:

rule "TestRule"
 dialect "mvel"
 when
 then
 System.out.println("Hello, world!");
end

And start my application, I get:

Firing all rules...
Hello, world!
All rules fired.

As expected. If I then change the rule as follows:

rule "TestRule"
 dialect "mvel"
 when
 then
 System.out.println("I have changed!");
end

I get this output (timestamps trimmed for readability):

ResourceChangeScanner attempt to scan 1 resources
ResourceChangeScanner modified resource=[UrlResource
path='http://localhost:1337/drools-guvnor/org.drools.guvnor.Guvnor/package/ERMIE/v0.1']
  
:
1277371031000 : 1277371254000
ResourceChangeNotification received ChangeSet notification
ResourceChangeScanner thread is waiting for 60
ResourceChangeNotification processing ChangeSet
ResourceChangeNotification ChangeSet modified resource=[UrlResource
path='http://localhost:1337/drools-guvnor/org.drools.guvnor.Guvnor/package/ERMIE/v0.1']
for listener=org.drools.agent.impl.knowledgeagenti...@e2d0b2
KnowledgeAgent received ChangeSet changed notification
ResourceChangeNotification thread is waiting for queue update
KnowledgAgent applying ChangeSet
KnowledgeAgent ChangeSet requires KnowledgeBuilderKnowledgeAgent  
rebuilding KnowledgeBase
using ChangeSet
KnowledgeAgent building resource=[UrlResource
path='http://localhost:1337/drools-guvnor/org.drools.guvnor.Guvnor/package/ERMIE/v0.1']
KnowledgeAgent adding KnowledgeDefinitionsPackage ERMIE
KnowledgeAgent new KnowledgeBase now built and in use

So, this makes it seem like everything has worked. However, if I  
insert a new fact and
fire all rules...

Inserting new fact...
Hello, World!

So, it hasn't worked. What might I have done wrong?


-Stephen

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



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