[rules-users] How to use database in drool

2012-02-12 Thread shawn
connection between the engine to the database? I know Hibernate can do it, but for SQL is there any way to do it? Regards, Shawn -- View this message in context: http://drools.46999.n3.nabble.com/How-to-use-database-in-drool-tp3737584p3737584.html Sent from the Drools: User forum mailing list archive

Re: [rules-users] How to use database in drool

2012-02-12 Thread shawn
Thanks~~ -- View this message in context: http://drools.46999.n3.nabble.com/How-to-use-database-in-drool-tp3737584p3737622.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list

[rules-users] rule with array

2012-02-15 Thread shawn
Hi, I meet a problem to find an element in an array. First, I have a 2 dimensional array and a 1 dimensional array. I need to compare whether the element in 2 dimensional array is as same as 1 dimensional array. How to solve it? Like: In Java - int [][] A; int [] B; how to iterate array A and

Re: [rules-users] rule with array

2012-02-15 Thread shawn
yeah, I have thought about it. But if I use function, I have to write three for loops. like: /*function Boolean findSubject(Request request) { Pointer sPointer = request.getSubjectPath(); Pointer aPointer = request.getAuthorTable(); for( int i = 0; i p.length; i++ ) {

Re: [rules-users] rule with array

2012-02-15 Thread shawn
I found someone idea. It's kind of like split array. when Request( $sPath : getSubjectPath() ) // get two dimensional array then for( int i = 0; i $sPath.length; i++ ) { insert( $sPath[i]); } But I don't know how to find the facts

Re: [rules-users] rule with array

2012-02-16 Thread shawn
Thank you~ -- View this message in context: http://drools.46999.n3.nabble.com/rule-with-array-tp3747680p3749524.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org

Re: [rules-users] rule with array

2012-02-16 Thread shawn
Thanks~~ -- View this message in context: http://drools.46999.n3.nabble.com/rule-with-array-tp3747680p3752097.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org

[rules-users] KnowledgeBase and KnowledgePackage

2012-02-16 Thread shawn
I am a beginner. Just ask a simple question: What's the difference between KnowledgeBase and KnowledgePackage? In which case should I use knowledgePackage? Collection or ? -- View this message in context:

[rules-users] How to create a drl file or decision table dynamically?

2012-02-24 Thread shawn
If it is possible to create a drl file or decision table dynamically in drool or java? Like the drool received data then create drl or decision table based on the data? Data: Condition 1 AND Condition 2 OR Condition 3 . Can the above data be stored in the rule file which also contains the

Re: [rules-users] How to create a drl file or decision table dynamically?

2012-02-24 Thread shawn
Thanks for your reply. Sorry, I am not quite clear about your first option. What's the meaning of 'Construct a DRL String'? -- View this message in context: http://drools.46999.n3.nabble.com/How-to-create-a-drl-file-or-decision-table-dynamically-tp3772708p3773060.html Sent from the Drools: User

Re: [rules-users] How to create a drl file or decision table dynamically?

2012-02-24 Thread shawn
Is it from JBPM or ? -- View this message in context: http://drools.46999.n3.nabble.com/How-to-create-a-drl-file-or-decision-table-dynamically-tp3772708p3773142.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users

Re: [rules-users] How to create a drl file or decision table dynamically?

2012-02-24 Thread shawn
Thank you~ Does it mean I have to write a file in java and saved it as .drl? fluent API is in jbpm, right? -- View this message in context: http://drools.46999.n3.nabble.com/How-to-create-a-drl-file-or-decision-table-dynamically-tp3772708p3773187.html Sent from the Drools: User forum mailing

Re: [rules-users] How to create a drl file or decision table dynamically?

2012-02-24 Thread shawn
Thanks a lot~ Looking forward to hearing from you. -- View this message in context: http://drools.46999.n3.nabble.com/How-to-create-a-drl-file-or-decision-table-dynamically-tp3772708p3773255.html Sent from the Drools: User forum mailing list archive at Nabble.com.

Re: [rules-users] How to create a drl file or decision table dynamically?

2012-02-25 Thread shawn
Hi~ Do you have any example about using stringBuilder? Cheers -- View this message in context: http://drools.46999.n3.nabble.com/How-to-create-a-drl-file-or-decision-table-dynamically-tp3772708p3774707.html Sent from the Drools: User forum mailing list archive at Nabble.com.

Re: [rules-users] How to create a drl file or decision table dynamically?

2012-02-26 Thread shawn
Hi Michael, Thank you for your reply~ Now, I understand some mechanism of building dynamic class. Back to my question, if I understand correct, those methods you mentioned is to add a drl file(exist) to the knowledgeBase dynamically, right? But how about the file? I mean if I need to write

Re: [rules-users] How to create a drl file or decision table dynamically?

2012-02-26 Thread shawn
Thank you ~ I will learn the documentation more. -- View this message in context: http://drools.46999.n3.nabble.com/How-to-create-a-drl-file-or-decision-table-dynamically-tp3772708p3777002.html Sent from the Drools: User forum mailing list archive at Nabble.com.

Re: [rules-users] How to create a drl file or decision table dynamically?

2012-02-26 Thread shawn
Sorry, I forget to mention one thing. What's really difficult for me is to translate the AND,OR(Condition 1 AND Condition 2 OR Condition 3) to the drool. Because someone will send the request with the expression(Condition 1 AND Condition 2 OR Condition 3) to me. For each request the

Re: [rules-users] How to create a drl file or decision table dynamically?

2012-02-26 Thread shawn
Thank your for your reply~ I am developing the Identity and Access management. I have finished the basic requirement, but the pre-condition part is what I am doing. The website sends the pre-condition(like what IP address or the time period can user access) that user sets. The pre-conditions are

Re: [rules-users] How to create a drl file or decision table dynamically?

2012-02-26 Thread shawn
February 2012 16:00, shawn lt;youngxiao121@gt; wrote: Sorry, I forget to mention one thing. What's really difficult for me is to translate the AND,OR(Condition 1 AND Condition 2 OR Condition 3) to the drool. Because someone will send the request with the expression(Condition 1 AND Condition 2

[rules-users] Drool Function error

2012-02-29 Thread shawn
I write a function in drool, but it always has error. The error is :The method insertLogical(PreCondition) is undefined for the type InsertPreCondition Is it because insertLogical must be used in RHS? Is there any way to use insertLogical in function or implement the function in RHS? code:

Re: [rules-users] Drool Function error

2012-03-01 Thread shawn
Thank you~ -- View this message in context: http://drools.46999.n3.nabble.com/Drool-Function-error-tp3788965p3789874.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org

[rules-users] How to make the working memory clean?

2012-03-01 Thread shawn
I don't understand the garbage collection mechanism in drool, though I have read the expert documentation. 1 - how to retract a global variable in drool? 2 - how to retract all the facts that have been inserted into the working memory? If I use halt(), does it retract all facts in the working

Re: [rules-users] How to make the working memory clean?

2012-03-01 Thread shawn
Thank you very much~ 1- You don't retract, you can set it to null, same way as set to an object. Is it in java or in drool? If I understand correct, global variable is not really inserted into the working memory,right? Global just ensure drool can see the variable? 2-Several ways, simple is to use

Re: [rules-users] How to make the working memory clean?

2012-03-01 Thread shawn
Thanks a lot. -- View this message in context: http://drools.46999.n3.nabble.com/How-to-make-the-working-memory-clean-tp3790730p3791945.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list

[rules-users] Simple question about String comparison in Drool

2012-03-07 Thread shawn
I insert several strings into working memory to make a comparison. But how to compare a anonymous string to another string. code like: List String s = ArrayList String String key function void insertValue( s, KnowledgeHelper kh ) { for( String string : s ) {

Re: [rules-users] Simple question about String comparison in Drool

2012-03-08 Thread shawn
Thank you` -- View this message in context: http://drools.46999.n3.nabble.com/Simple-question-about-String-comparison-in-Drool-tp3808352p3809203.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list

[rules-users] matches operator

2012-03-11 Thread shawn
is there anyone knows how to write it? Cheers. Shawn -- View this message in context: http://drools.46999.n3.nabble.com/matches-operator-tp3816492p3816492.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing

Re: [rules-users] matches operator

2012-03-11 Thread shawn
Thanks for your reply. Is this means I can't match two string variables? Only match a string constant with a string variable? -- View this message in context: http://drools.46999.n3.nabble.com/matches-operator-tp3816492p3816818.html Sent from the Drools: User forum mailing list archive at

Re: [rules-users] matches operator

2012-03-11 Thread shawn
Thanks -- View this message in context: http://drools.46999.n3.nabble.com/matches-operator-tp3816492p3816900.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org

[rules-users] questions on guvnor and drools 5.0

2009-06-01 Thread Garner, Shawn
I was wondering if somebody can help me with some questions: 1) Is there any more detail on how to setup Guvnor with a database? 2) How do you use the test scenarios with complex object structures? -eg Create a fact in working memory that has another Object in it which in turn has a list

[rules-users] RE: questions on guvnor and drools 5.0

2009-06-04 Thread Garner, Shawn
Sorry it's been a few days and I haven't gotten any response on any questions/statements below. I've used drools in the past but am pretty new to some features of drools still and new to Guvnor. I wrote a proof of concept drools/Guvnor app and these are the things I don't like or have

RE: [rules-users] RE: questions on guvnor and drools 5.0

2009-06-04 Thread Garner, Shawn
Of Wolfgang Laun Sent: Thursday, June 04, 2009 11:59 AM To: Rules Users List Subject: Re: [rules-users] RE: questions on guvnor and drools 5.0 On 6/4/09, Garner, Shawn garner.sh...@principal.com wrote: 2) How do you use the test scenarios with complex object structures? -eg Create a fact

RE: [rules-users] Default rule

2009-06-04 Thread Garner, Shawn
The ruleflow-group and the State Example from the documentation may be what you're looking for. SG -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Malenfant, Andre Sent: Thursday, June 04, 2009 3:47 PM To: Rules

[rules-users] question on drools and method calls on facts

2009-09-01 Thread Garner, Shawn
I'm under the impression that in the action clause of a rule you should only do one of the following: 1) Set a property on a Fact 2) Retract a Fact 3) Insert (Assert) a new Fact 4) Modify an existing Fact However in some of the examples in the documentation it shows calling methods other than

Re: [rules-users] (no subject)

2009-09-09 Thread Garner, Shawn
Functions on the LHS are not advised and says so in the drools user guide. I can think of two ways to do this (forgive me if my syntax is slightly off). Way number 1 rule ProductDescription validation when $listing : Listing( $description:productDescription != null,

[rules-users] drools 5.0.1 enum serialization/deserialization problem

2010-01-13 Thread Garner, Shawn
We are pre-compiling the rules and then reading them in and running them later. I'm getting this error when reading in the compiled (serialized rules) rules: Error deserializing enum value... This line (pretty similar to this) is causing the issue when it's deserializing the Java 5 Enum.

[rules-users] error on retracting fact on drools 5.0.1

2010-01-21 Thread Garner, Shawn
I have a rule and it is supposed to retract two objects when $objectOne : ObjectOne(...) $objectTwo : ObjectTwo(...) then retract($objectOne); #retract($objectTwo); end No matter what I do I can't ever retract objectTwo. I put a print statement and it is there. If

[rules-users] prevent infinite loops

2010-01-29 Thread Garner, Shawn
Is there a good way to globally prevent infinite loops. I had rule A and rule B and they both have FactA on the condition. They also both modify FactA. I tried no-loop and it prevents a loop of repeating RuleA over and over. However it then goes from Rule A back to Rule B back to Rule A. I fixed