[rules-users] Using object.getter in Decision table

2011-10-04 Thread jilani
Hi,

I have a scenario, where for decision table I will inject one object which
holds all facts. Using those facts the decision table has rules. How to
retrieve the child fact from parent in decision table.

sample for this is as follows

Java Code snippet:
DataObject dataObj = new DataObject();
Fact1 fact1 = new Fact1();
Fact2 fact2 = new Fact2();
dataObj.setFact1(fact1);
dataObj.setFact2(fact2);
statelessKnowledgeSession.execute(dataObj);


In decision table:

---
CONDITION   

fact1 : DataObject().getFact1(); 

fact1.getData1().equalsIgnoreCase($param)

Hello


Here I am getting error.

Please suggest me how to access the child fact from parent fact in decision
table.













--
View this message in context: 
http://drools.46999.n3.nabble.com/Using-object-getter-in-Decision-table-tp3392337p3392337.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] Is it possible to retrieve the collection of Conditions from DecisionTable?

2011-10-04 Thread Toni Rikkola
If you take a look at the Verifier it goes through the Drools AST with a 
visitor pattern.
It starts by using getting the PackageDescr using DrlParser, this uses Drools 
internals so be warned that it might change in the future.

  Reader drlReader = new InputStreamReader( stream );
  PackageDescr descr = new DrlParser().parse( drlReader );

After that it goes through the PackageDescr using PackageDescrVisitor. 
RuleDescrVisitor shows how to get the condition part from each rule.

https://github.com/droolsjbpm/drools/blob/master/drools-verifier/src/main/java/org/drools/verifier/visitor/PackageDescrVisitor.java
https://github.com/droolsjbpm/drools/blob/master/drools-verifier/src/main/java/org/drools/verifier/visitor/RuleDescrVisitor.java

Toni


On Oct 3, 2011, at 8:11 PM, Mark Proctor wrote:

 On 03/10/2011 18:03, Wolfgang Laun wrote:
 A condition does not have a name, as you write; values of the cells
 below a condition are (usually) literals.
 
 There is no API for extracting parts of a spreadsheet. You can look at
 the Drools source code (in the packages org.drools.decisiontable and
 .../parser) and write whatever you need - it is not too difficult.
 You can also look at drools-verifier, as that shows ho to analyse 
 resulting rule fragments.
 
 Mark
 
 -W
 
 
 On 3 October 2011 17:05, RaviCKotaravi.k...@wellsfargo.com  wrote:
 Hi All, for suppose I have a DecisionTable like below
 
 CONDITION   ACTION
 -
 COND1 ACTION1
 COND2 ACTION2
 COND3 ACTION3
 -
 
 This is just a representation of the DecisionTable. So I need to retrieve
 all the conditions and store them into a Collection like Set. Does Drools
 provide any such feature.
 
 We load the drools as below
 PackageBuilder builder = new PackageBuilder();
 builder.addPackageFromDrl(new StringReader(drl)); //drl is the filepath of
 decisiontable excel
 
 // add the package to a rulebase (deploy the rule package).
 RuleBase ruleBase = RuleBaseFactory.newRuleBase();
 ruleBase.addPackage(builder.getPackage());
 
 I tried to look into api of RuleBase, tried to get the packages, Rules,
 Consequence, etc etc, but could not find any method, that gets me the
 condition name.
 
 When I tried to do
 Package[] packages = rulebase.getPackages();
 
 for(Package pack : packages){
 System.out.println(Package Name is : +pack.getName());
 Rule[] rules = pack.getRules();
 for(Rule rule : rules){
 System.out.println(Rule name is : +rule.getName());
 
 All I get is some representation of each row, but I'm specifically looking
 for the value of the first column (CONDITION) for each rule.
 
 Please offer some guidance here.
 
 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/Is-it-possible-to-retrieve-the-collection-of-Conditions-from-DecisionTable-tp3390026p3390026.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 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] 5.3.0 CR1 has broken existing rules/flows

2011-10-04 Thread Wolfgang Laun
I have found that any serious Drools application should write and deploy a
consequence exception handler of its own. Perhaps you look at my modest
efforthttp://members.inode.at/w.laun/drools/CustomConsequenceExceptionHandlingHowTo.html-
I think it is still compatible. Any feedback welcome ;-)
-W

On 4 October 2011 04:46, lhorton lhor...@abclegal.com wrote:

 This is very good info.  I have found those Drools ConsequenceExceptions a
 real PITA to troubleshoot.  I wonder if the exception could be enhanced to
 show this info so users don't have to debug it?  I mean, to have the
 exception message show the true culprit rule name, or something useful like
 that?

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/5-3-0-CR1-has-broken-existing-rules-flows-tp3390922p3392014.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] Using object.getter in Decision table

2011-10-04 Thread Swindells, Thomas
Why are you using an extra data object -its far easier if your facts are 
actually facts in the working memory.

What you have written as your rules is totally incorrect - you seem to be 
trying to write java method calls not rule statements.
My advice is to
a) try writing the same rule as a drl first before trying to represent it in a 
spreadsheet
b) look at the intermediate drl that the spreadsheet compiler produces to get a 
better understanding of the output that the spreadsheet produces.

Thomas

 -Original Message-
 From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
 boun...@lists.jboss.org] On Behalf Of jilani
 Sent: 04 October 2011 07:43
 To: rules-users@lists.jboss.org
 Subject: [rules-users] Using object.getter in Decision table

 Hi,

 I have a scenario, where for decision table I will inject one object which 
 holds
 all facts. Using those facts the decision table has rules. How to retrieve the
 child fact from parent in decision table.

 sample for this is as follows

 Java Code snippet:
 DataObject dataObj = new DataObject();
 Fact1 fact1 = new Fact1();
 Fact2 fact2 = new Fact2();
 dataObj.setFact1(fact1);
 dataObj.setFact2(fact2);
 statelessKnowledgeSession.execute(dataObj);


 In decision table:

 ---
 CONDITION
 
 fact1 : DataObject().getFact1();
 
 fact1.getData1().equalsIgnoreCase($param)
 
 Hello
 

 Here I am getting error.

 Please suggest me how to access the child fact from parent fact in decision
 table.













 --
 View this message in context: http://drools.46999.n3.nabble.com/Using-
 object-getter-in-Decision-table-tp3392337p3392337.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


**
This message is confidential and intended only for the addressee. If you have 
received this message in error, please immediately notify the 
postmas...@nds.com and delete it from your system as well as any copies. The 
content of e-mails as well as traffic data may be monitored by NDS for 
employment and security purposes. To protect the environment please do not 
print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, 
United Kingdom. A company registered in England and Wales. Registered no. 
3080780. VAT no. GB 603 8808 40-00
**

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


Re: [rules-users] Is it possible to retrieve the collection of Conditions from DecisionTable?

2011-10-04 Thread Wolfgang Laun
Since Toni confirms me even before I post this on the list: Using the
Verifier way to get at a column from some spreadsheet is not for the faint
at heart. In addition to what Toni wrote: source code in the Drools AST
corner isn't even commented.
-W


2011/10/4 Toni Rikkola toni.rikk...@gmail.com

 If you take a look at the Verifier it goes through the Drools AST with a
 visitor pattern.
 It starts by using getting the PackageDescr using DrlParser, this uses
 Drools internals so be warned that it might change in the future.

   Reader drlReader = new InputStreamReader( stream );
   PackageDescr descr = new DrlParser().parse( drlReader );

 After that it goes through the PackageDescr
 using PackageDescrVisitor. RuleDescrVisitor shows how to get the condition
 part from each rule.


 https://github.com/droolsjbpm/drools/blob/master/drools-verifier/src/main/java/org/drools/verifier/visitor/PackageDescrVisitor.java

 https://github.com/droolsjbpm/drools/blob/master/drools-verifier/src/main/java/org/drools/verifier/visitor/RuleDescrVisitor.java

 Toni


 On Oct 3, 2011, at 8:11 PM, Mark Proctor wrote:

 On 03/10/2011 18:03, Wolfgang Laun wrote:

 A condition does not have a name, as you write; values of the cells

 below a condition are (usually) literals.


 There is no API for extracting parts of a spreadsheet. You can look at

 the Drools source code (in the packages org.drools.decisiontable and

 .../parser) and write whatever you need - it is not too difficult.

 You can also look at drools-verifier, as that shows ho to analyse
 resulting rule fragments.

 Mark


 -W



 On 3 October 2011 17:05, RaviCKotaravi.k...@wellsfargo.com  wrote:

 Hi All, for suppose I have a DecisionTable like below


 CONDITION   ACTION

 -

 COND1 ACTION1

 COND2 ACTION2

 COND3 ACTION3

 -


 This is just a representation of the DecisionTable. So I need to retrieve

 all the conditions and store them into a Collection like Set. Does Drools

 provide any such feature.


 We load the drools as below

 PackageBuilder builder = new PackageBuilder();

 builder.addPackageFromDrl(new StringReader(drl)); //drl is the filepath of

 decisiontable excel


 // add the package to a rulebase (deploy the rule package).

 RuleBase ruleBase = RuleBaseFactory.newRuleBase();

 ruleBase.addPackage(builder.getPackage());


 I tried to look into api of RuleBase, tried to get the packages, Rules,

 Consequence, etc etc, but could not find any method, that gets me the

 condition name.


 When I tried to do

 Package[] packages = rulebase.getPackages();


 for(Package pack : packages){

 System.out.println(Package Name is : +pack.getName());

 Rule[] rules = pack.getRules();

 for(Rule rule : rules){

 System.out.println(Rule name is : +rule.getName());


 All I get is some representation of each row, but I'm specifically looking

 for the value of the first column (CONDITION) for each rule.


 Please offer some guidance here.


 --

 View this message in context:
 http://drools.46999.n3.nabble.com/Is-it-possible-to-retrieve-the-collection-of-Conditions-from-DecisionTable-tp3390026p3390026.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 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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] 5.3.0 CR1 has broken existing rules/flows

2011-10-04 Thread Swindells, Thomas
That looks really useful, I didn't know that you could do that!
Any chance you could submit it as a patch to get the default version enhanced 
to do that!

Thanks,

Thomas

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun
Sent: 04 October 2011 08:42
To: Rules Users List
Subject: Re: [rules-users] 5.3.0 CR1 has broken existing rules/flows

I have found that any serious Drools application should write and deploy a 
consequence exception handler of its own. Perhaps you look at my modest 
efforthttp://members.inode.at/w.laun/drools/CustomConsequenceExceptionHandlingHowTo.html
 - I think it is still compatible. Any feedback welcome ;-)
-W
On 4 October 2011 04:46, lhorton 
lhor...@abclegal.commailto:lhor...@abclegal.com wrote:
This is very good info.  I have found those Drools ConsequenceExceptions a
real PITA to troubleshoot.  I wonder if the exception could be enhanced to
show this info so users don't have to debug it?  I mean, to have the
exception message show the true culprit rule name, or something useful like
that?

--
View this message in context: 
http://drools.46999.n3.nabble.com/5-3-0-CR1-has-broken-existing-rules-flows-tp3390922p3392014.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.orgmailto:rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




**
This message is confidential and intended only for the addressee. If you have 
received this message in error, please immediately notify the 
postmas...@nds.com and delete it from your system as well as any copies. The 
content of e-mails as well as traffic data may be monitored by NDS for 
employment and security purposes. To protect the environment please do not 
print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, 
United Kingdom. A company registered in England and Wales. Registered no. 
3080780. VAT no. GB 603 8808 40-00
**
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Guvnor and Axis2

2011-10-04 Thread Mario Viertel
Hi,

thanks for the reply. I had it already done. Because of its the better 
way to interact with guvnor.

Mario

Am 01.10.2011 04:08, schrieb jliu:
 On 2011/9/29 15:46, Mario Viertel wrote:
 Hi,

 I am using an own web service (Axis2; tomcat 6) to interact with Guvnor.
 All drools related jars (drools*, mvel*, knowledge-api) are contained
 in the lib folder of service's aar file. Via knowledge-api the service
 interacts with the guvnor repository.

 Unfortunately this doesn't work. At runtime a ClassNotFoundException has
 been thrown. A look into details revealed that the ClassLoader havn't
 loaded all jars containing in webservice's lib folder.

 Has anybody an idea what's going wrong. I'm not sure if this is an issue
 of drools, the axis2 engine or the tomcat engine.
 Its very hard to tell what the problem is based on the information you
 provided. I would suggest you to use Guvnor REST API to interact with
 Guvnor: [1].

 [1].
 https://hudson.jboss.org/jenkins/job/guvnor/lastSuccessfulBuild/artifact/guvnor-docs/target/docbook/publish/en-US/html_single/index.html#d0e1856

 Hope this helps,
 Jervis
 Thanks,
 Mario
 ___
 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


-- 

Mit freundlichen Gruessen

Mario Viertel
RMS - Radio Monitoring and Surveillance Solutions
BIS - Business and Intelligence Solutions

Tel:  +49 9131 583 510
Fax:  +49 9131 583 11
Mail: mario.vier...@medav.de
Skype: mavi-medav

Betriebsstaette Ilmenau
Homburger Platz 3
98693 Ilmenau
_

MEDAV GmbH
Graefenberger Str. 32-34
D-91080 Uttenreuth

Geschaeftsfuehrer Dr.-Ing. Hans-Joachim Kolb
Handelsregister Fuerth HRB 2311

Bankverbindung
Stadt- und Kreissparkasse Erlangen
BLZ 763 500 00, KtNr. 10 - 000 344

Internet http://www.medav.de

Angaben gemaess EHUG vom 10.11.2006


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


Re: [rules-users] 5.3.0 CR1 has broken existing rules/flows

2011-10-04 Thread Mark Proctor

On 04/10/2011 08:56, Swindells, Thomas wrote:


That looks really useful, I didn't know that you could do that!

Any chance you could submit it as a patch to get the default version 
enhanced to do that!



More than happy to except pull requests :)

Mark


Thanks,

Thomas

*From:*rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] *On Behalf Of *Wolfgang Laun

*Sent:* 04 October 2011 08:42
*To:* Rules Users List
*Subject:* Re: [rules-users] 5.3.0 CR1 has broken existing rules/flows

I have found that any serious Drools application should write and 
deploy a consequence exception handler of its own. Perhaps you look at 
my modest effort 
http://members.inode.at/w.laun/drools/CustomConsequenceExceptionHandlingHowTo.html 
- I think it is still compatible. Any feedback welcome ;-)

-W

On 4 October 2011 04:46, lhorton lhor...@abclegal.com 
mailto:lhor...@abclegal.com wrote:


This is very good info.  I have found those Drools ConsequenceExceptions a
real PITA to troubleshoot.  I wonder if the exception could be enhanced to
show this info so users don't have to debug it?  I mean, to have the
exception message show the true culprit rule name, or something useful 
like

that?

--
View this message in context: 
http://drools.46999.n3.nabble.com/5-3-0-CR1-has-broken-existing-rules-flows-tp3390922p3392014.html

Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org mailto:rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




**
This message is confidential and intended only for the addressee. If 
you have received this message in error, please immediately notify the 
postmas...@nds.com and delete it from your system as well as any 
copies. The content of e-mails as well as traffic data may be 
monitored by NDS for employment and security purposes. To protect the 
environment please do not print this e-mail unless necessary.


NDS Limited. Registered Office: One London Road, Staines, Middlesex, 
TW18 4EX, United Kingdom. A company registered in England and Wales. 
Registered no. 3080780. VAT no. GB 603 8808 40-00

**


___
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] Embed BRL Editor in application

2011-10-04 Thread Michael Anstis
Have you read 
thishttp://www.plugtree.com/guvnor-embed-asset%E2%80%99s-editor-in-your-application/
?

On 4 October 2011 06:35, shubhranshu shubhranshu.sw...@gmail.com wrote:

 Hello everybody,

 I am new to drools. I want to embed the BRL Editor in our application. I
 have read somewhere that it can be done by calling the
 standaloneEditorServlet. When I call the standaloneEditorServlet it appends
 pUUID=7c89819b-221d-470b-9fce-4bd3bbe02e75. I have to pass some
 initialization parameters to the servlet. I know the package name,
 categoryName but what will be the brlSource. Do I need to pass the whole
 brl
 (xml) file as parameter?

 Another thing on which action the standaloneEditorServlet is called.

 Please help

 Regards


 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Embed-BRL-Editor-in-application-tp3392242p3392242.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] Is it possible to retrieve the collection of Conditions from DecisionTable?

2011-10-04 Thread Swindells, Thomas
Looking at the SpreadsheetCompiler class you can do something like the following

/**
 * Generates DRL from the input stream containing the spreadsheet.
 *
 * @param xlsStream
 *The stream to the spreadsheet. Uses the first worksheet found
 *for the decision tables, ignores others.
 * @param type
 *The type of the file - InputType.CSV or InputType.XLS
 * @param listener
 *
 * @return DRL xml, ready for use in drools.
 */
public String compile(final InputStream xlsStream,
  final InputType type,
  final RuleSheetListener listener) {
final DecisionTableParser parser = type.createParser( listener );
parser.parseFile( xlsStream );
final Package rulePackage = listener.getRuleSet();

ListRule rules = rulePackage.getRules
for(Rule r : rules) {
r.getName();
ListCondition conditions = r.getConditions();
For(Condition c : conditions) {
String snippet = r.getSnippet();
}
}

final DRLOutput out = new DRLOutput();
rulePackage.renderDRL( out );
return out.getDRL();
}


Thomas
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun
Sent: 04 October 2011 08:53
To: Rules Users List
Subject: Re: [rules-users] Is it possible to retrieve the collection of 
Conditions from DecisionTable?

Since Toni confirms me even before I post this on the list: Using the Verifier 
way to get at a column from some spreadsheet is not for the faint at heart. In 
addition to what Toni wrote: source code in the Drools AST corner isn't even 
commented.
-W

2011/10/4 Toni Rikkola toni.rikk...@gmail.commailto:toni.rikk...@gmail.com
If you take a look at the Verifier it goes through the Drools AST with a 
visitor pattern.
It starts by using getting the PackageDescr using DrlParser, this uses Drools 
internals so be warned that it might change in the future.

  Reader drlReader = new InputStreamReader( stream );
  PackageDescr descr = new DrlParser().parse( drlReader );

After that it goes through the PackageDescr using PackageDescrVisitor. 
RuleDescrVisitor shows how to get the condition part from each rule.

https://github.com/droolsjbpm/drools/blob/master/drools-verifier/src/main/java/org/drools/verifier/visitor/PackageDescrVisitor.java
https://github.com/droolsjbpm/drools/blob/master/drools-verifier/src/main/java/org/drools/verifier/visitor/RuleDescrVisitor.java

Toni


On Oct 3, 2011, at 8:11 PM, Mark Proctor wrote:


On 03/10/2011 18:03, Wolfgang Laun wrote:

A condition does not have a name, as you write; values of the cells
below a condition are (usually) literals.

There is no API for extracting parts of a spreadsheet. You can look at
the Drools source code (in the packages org.drools.decisiontable and
.../parser) and write whatever you need - it is not too difficult.
You can also look at drools-verifier, as that shows ho to analyse
resulting rule fragments.

Mark


-W


On 3 October 2011 17:05, 
RaviCKotaravi.k...@wellsfargo.commailto:ravi.k...@wellsfargo.com  wrote:
Hi All, for suppose I have a DecisionTable like below

CONDITION   ACTION
-
COND1 ACTION1
COND2 ACTION2
COND3 ACTION3
-

This is just a representation of the DecisionTable. So I need to retrieve
all the conditions and store them into a Collection like Set. Does Drools
provide any such feature.

We load the drools as below
PackageBuilder builder = new PackageBuilder();
builder.addPackageFromDrl(new StringReader(drl)); //drl is the filepath of
decisiontable excel

// add the package to a rulebase (deploy the rule package).
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage(builder.getPackage());

I tried to look into api of RuleBase, tried to get the packages, Rules,
Consequence, etc etc, but could not find any method, that gets me the
condition name.

When I tried to do
Package[] packages = rulebase.getPackages();

for(Package pack : packages){
System.out.println(Package Name is : +pack.getName());
Rule[] rules = pack.getRules();
for(Rule rule : rules){
System.out.println(Rule name is : +rule.getName());

All I get is some representation of each row, but I'm specifically looking
for the value of the first column (CONDITION) for each rule.

Please offer some guidance here.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Is-it-possible-to-retrieve-the-collection-of-Conditions-from-DecisionTable-tp3390026p3390026.html
Sent from the Drools: User forum mailing list archive at 
Nabble.comhttp://Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.orgmailto:rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list

Re: [rules-users] Using object.getter in Decision table

2011-10-04 Thread jilani
Thank You for your reply. 

I am trying to access all the facts through one fact, actually the scenario
is we have multiple screens in our application and each screen will have
multiple fields where we want to show/hide the screen/field based on data
provided in screens. 

So Instead of sending each screen data separate, We thought of sending the
parent object and inside the rules(i.e decision table) we want to access the
data of specific screen.

As mentioned by you, I am using the intermediate DRL output using below code
SpreadsheetCompiler sc = new SpreadsheetCompiler();
String drlstr = null;
try
{
drlstr =
sc.compile(ResourceFactory.newClassPathResource(decisionTableSheet,
this.getClass()).getInputStream(), InputType.XLS);
}

Here it is giving the rule parse exception and returning the package as
null.

Coming to DRL, I am facing difficulty in defining rules like scenarios as
below

- null check
- need to use java String methods like equals() and length()
- setting data in HashMap, ArrayList 

Actually I tried the above using a rule definition in Guvnor.

It would be helpful If you can provide me the URL or some information to
write rules using DRL.

My Development environment:
Drools 5.2
Eclipse with JBoss tools











--
View this message in context: 
http://drools.46999.n3.nabble.com/Using-object-getter-in-Decision-table-tp3392337p3392506.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] Using object.getter in Decision table

2011-10-04 Thread Swindells, Thomas
The best place to start is the drools documentation 
http://www.jboss.org/drools/documentation particularly the expert guide.
This shows both drl and spreadsheet syntax and examples.
You are getting the exception because the first line of the condition should 
just be an object restriction eg fact1 : DataObject()
Your second line is then a restriction on that data object.

What you send from your screen and what you insert into the working memory 
doesn't have to be identical.
Your screen may use a single object to relay the object but that doesn't mean 
you can't explode it into separate facts as you insert it into your working 
memory, but it depends on what you are trying to achieve - are these just 
validation rules or are you going to be modifying the objects?

Thomas

 -Original Message-
 From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
 boun...@lists.jboss.org] On Behalf Of jilani
 Sent: 04 October 2011 09:43
 To: rules-users@lists.jboss.org
 Subject: Re: [rules-users] Using object.getter in Decision table

 Thank You for your reply.

 I am trying to access all the facts through one fact, actually the scenario 
 is we
 have multiple screens in our application and each screen will have multiple
 fields where we want to show/hide the screen/field based on data provided
 in screens.

 So Instead of sending each screen data separate, We thought of sending the
 parent object and inside the rules(i.e decision table) we want to access the
 data of specific screen.

 As mentioned by you, I am using the intermediate DRL output using below
 code SpreadsheetCompiler sc = new SpreadsheetCompiler();
 String drlstr = null;
 try
 {
 drlstr =
 sc.compile(ResourceFactory.newClassPathResource(decisionTableSheet,
 this.getClass()).getInputStream(), InputType.XLS);
 }

 Here it is giving the rule parse exception and returning the package as null.

 Coming to DRL, I am facing difficulty in defining rules like scenarios as 
 below

 - null check
 - need to use java String methods like equals() and length()
 - setting data in HashMap, ArrayList

 Actually I tried the above using a rule definition in Guvnor.

 It would be helpful If you can provide me the URL or some information to
 write rules using DRL.

 My Development environment:
 Drools 5.2
 Eclipse with JBoss tools


**
This message is confidential and intended only for the addressee. If you have 
received this message in error, please immediately notify the 
postmas...@nds.com and delete it from your system as well as any copies. The 
content of e-mails as well as traffic data may be monitored by NDS for 
employment and security purposes. To protect the environment please do not 
print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, 
United Kingdom. A company registered in England and Wales. Registered no. 
3080780. VAT no. GB 603 8808 40-00
**

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


Re: [rules-users] Embed BRL Editor in application

2011-10-04 Thread Tihomir Surdilovic
There is a blog and a video on this at 
http://blog.athico.com/2011/04/using-oryx-designer-and-guvnor-in-your.html. 
It includes the source for a sample application (seam2/richfaces) that 
is shown in the video and uses the embedded Guvnor editors. Hope this helps.

On 10/4/11 4:19 AM, Michael Anstis wrote:
Have you read this 
http://www.plugtree.com/guvnor-embed-asset%E2%80%99s-editor-in-your-application/?


On 4 October 2011 06:35, shubhranshu shubhranshu.sw...@gmail.com 
mailto:shubhranshu.sw...@gmail.com wrote:


Hello everybody,

I am new to drools. I want to embed the BRL Editor in our
application. I
have read somewhere that it can be done by calling the
standaloneEditorServlet. When I call the standaloneEditorServlet
it appends
pUUID=7c89819b-221d-470b-9fce-4bd3bbe02e75. I have to pass some
initialization parameters to the servlet. I know the package name,
categoryName but what will be the brlSource. Do I need to pass the
whole brl
(xml) file as parameter?

Another thing on which action the standaloneEditorServlet is called.

Please help

Regards


--
View this message in context:

http://drools.46999.n3.nabble.com/Embed-BRL-Editor-in-application-tp3392242p3392242.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org mailto: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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Using object.getter in Decision table

2011-10-04 Thread jilani
Thomas,

The best place to start is the drools documentation
http://www.jboss.org/drools/documentation particularly the expert guide. 
This shows both drl and spreadsheet syntax and examples. 
- Yes. I have downloaded all the drools info from here. then I got one
expert pdf document in reference folder of final distribution. I think it is
the same in above URL.
Here as mentioned in the document I have defined rules in repository using
Guvnor and then tried to access the knowledgebase using knowledgeAgent,
which I failed to access from web application where as from console
application it is working. 

You are getting the exception because the first line of the condition should
just be an object restriction eg fact1 : DataObject() 
Your second line is then a restriction on that data object. 

- that means I can not get the child fact from a parent object as I tried.
As of now the only way is I need to insert the facts as and when rule needs
it and then retract that. Please correct me If I am missing anything in my
understanding.

What you send from your screen and what you insert into the working memory
doesn't have to be identical. 
Your screen may use a single object to relay the object but that doesn't
mean you can't explode it into separate facts as you insert it into your
working memory, but it depends on what you are trying to achieve - are these
just validation rules or are you going to be modifying the objects? 

I am modifying the object, so that based on that object state some
functionality has to be done in next layer. what I am trying to achieve is
generic rule util methods for my application to use these methods across
different method calls. 

Thank You
Jilani

--
View this message in context: 
http://drools.46999.n3.nabble.com/Using-object-getter-in-Decision-table-tp3392337p3392738.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 PLANNER - getting started - drools-eclipse-plugin

2011-10-04 Thread vik
:( what I have  to do with this error:

Exception in thread main java.lang.IllegalArgumentException: Problem
reading unsolvedSolutionFile:
data\travelingtournament\smart\unsolved\1-nl14.xml
at
org.drools.planner.benchmark.SolverBenchmarkSuite.readUnsolvedSolution(SolverBenchmarkSuite.java:221)
at
org.drools.planner.benchmark.SolverBenchmarkSuite.benchmark(SolverBenchmarkSuite.java:188)
at
org.drools.planner.benchmark.XmlSolverBenchmarker.benchmark(XmlSolverBenchmarker.java:85)
at
org.drools.planner.examples.common.app.CommonBenchmarkApp.process(CommonBenchmarkApp.java:36)
at
org.drools.planner.examples.app.GeneralDroolsPlannerBenchmarkApp.main(GeneralDroolsPlannerBenchmarkApp.java:37)
Caused by: java.io.FileNotFoundException:
data\travelingtournament\smart\unsolved\1-nl14.xml (The system cannot find
the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.init(Unknown Source)
at
org.drools.planner.benchmark.SolverBenchmarkSuite.readUnsolvedSolution(SolverBenchmarkSuite.java:216)

Thank you very much...

--
View this message in context: 
http://drools.46999.n3.nabble.com/DROOLS-PLANNER-getting-started-tp3030567p3392986.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 PLANNER - getting started - drools-eclipse-plugin

2011-10-04 Thread Geoffrey De Smet
Same cause: the working directory of a benchmarkerApp should be set to 
the directory container the data dir.

Op 04-10-11 14:44, vik schreef:
 :( what I have  to do with this error:

 Exception in thread main java.lang.IllegalArgumentException: Problem
 reading unsolvedSolutionFile:
 data\travelingtournament\smart\unsolved\1-nl14.xml
   at
 org.drools.planner.benchmark.SolverBenchmarkSuite.readUnsolvedSolution(SolverBenchmarkSuite.java:221)
   at
 org.drools.planner.benchmark.SolverBenchmarkSuite.benchmark(SolverBenchmarkSuite.java:188)
   at
 org.drools.planner.benchmark.XmlSolverBenchmarker.benchmark(XmlSolverBenchmarker.java:85)
   at
 org.drools.planner.examples.common.app.CommonBenchmarkApp.process(CommonBenchmarkApp.java:36)
   at
 org.drools.planner.examples.app.GeneralDroolsPlannerBenchmarkApp.main(GeneralDroolsPlannerBenchmarkApp.java:37)
 Caused by: java.io.FileNotFoundException:
 data\travelingtournament\smart\unsolved\1-nl14.xml (The system cannot find
 the path specified)
   at java.io.FileInputStream.open(Native Method)
   at java.io.FileInputStream.init(Unknown Source)
   at
 org.drools.planner.benchmark.SolverBenchmarkSuite.readUnsolvedSolution(SolverBenchmarkSuite.java:216)

 Thank you very much...

 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/DROOLS-PLANNER-getting-started-tp3030567p3392986.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


-- 
With kind regards,
Geoffrey De Smet


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


[rules-users] IllegalStateException happens when ResourceChangeScanner working on Version 5.3.0.CR1

2011-10-04 Thread Oliver Liu
Hi Guys,

I want to upgrade drools from 5.1.1 to 5.3.0 CR1, but i found
ResourceChangeScanner could't work.

In version 5.1.1, i wrote this code to get a KnowledgeAgent

KnowledgeAgent kagent =
KnowledgeAgentFactory.newKnowledgeAgent(ReleaseAgent);
kagent.addEventListener(new ReloadingRuleEventListener(this));

kagent.applyChangeSet(ResourceFactory.newClassPathResource(changeset-url.xml));

changeset-url.xml content is like:
change-set xmlns='http://drools.org/drools-5.0/change-set'
xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
xs:schemaLocation='http://drools.org/drools-5.0/change-set
   
http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd'

   add
  resource
 
source='http://hostname:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/PackageName1/snapshot_release'
  type='PKG' basicAuthentication=enabled username=user1
password=123456 /
  
  resource
 
source='http://hostname:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/PackageName2/snapshot_release'
  type='PKG' basicAuthentication=enabled username=user1
password=123456 /

  resource
 
source='http://hostname:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/PackageName3/snapshot_release'
  type='PKG' basicAuthentication=enabled username=user1
password=123456 /
   /add
/change-set

then wrote this code to scan if there is a new version snapshot on guvnor
ResourceChangeScannerConfiguration sconf = ResourceFactory
.getResourceChangeScannerService()
.newResourceChangeScannerConfiguration();
sconf.setProperty(drools.resource.scanner.interval,60);


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

It works very well, each time when ResourceChangeScanner finding there is
new snapshot, it can reload the rules from guvnor properly.

But when i updated to 5.3.0 CR1, ran this code, error happens:
Exception in thread Thread-2 java.lang.IllegalStateException: reader does
have
 a modified date
at
org.drools.io.impl.ReaderResource.getLastModified(ReaderResource.java
:64)
at
org.drools.io.impl.ResourceChangeScannerImpl.scan(ResourceChangeScann
erImpl.java:169)
at
org.drools.io.impl.ResourceChangeScannerImpl$ProcessChangeSet.run(Res
ourceChangeScannerImpl.java:326)
at java.lang.Thread.run(Thread.java:619)

It seems in new version, UrlResource was parsed to ReaderResource(i rememer
in 5.1.1, each resource in changeset-url.xml was parsed to UrlResource).


Can you give a help?
Thanks a lot


--
View this message in context: 
http://drools.46999.n3.nabble.com/IllegalStateException-happens-when-ResourceChangeScanner-working-on-Version-5-3-0-CR1-tp3393027p3393027.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 - Operations with snapshots

2011-10-04 Thread Demian Calcaprina
Thanks Jervis.

I currently use Guvnor 5.2, and saw that I can use version so I will try to
use them.

- Is there something I will be missing about versions, by using 5.2?
- Do you know when a new version is created? With Snapshots, I could choose
when to create a new one. How about versions?

Thanks!

Demian

2011/10/3 jliu j...@redhat.com

  On 2011/10/4 1:54, Demian Calcaprina wrote:

 Hi everyone. I am using Guvnor 5.2, and I need to make some operations from
 my application.

  Specifically, I need to make two operations remotely:
 - List Snapshots, as it is possible to list packages.
 - Create a new snapshot from a package.

  Is this possible to make these operation through rest API?

  Hi,

 Start from 5.3, Guvnor Packages are fully versioned. I would recommend you
 to use a vesioned package instead of package snapshot. Package snapshot will
 be deprecated in the future.

 Cheers,
 Jervis

 Thanks,

  Demian




 ___
 rules-users mailing 
 listrules-users@lists.jboss.orghttps://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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Looping in When part

2011-10-04 Thread rahulkrishnan
Hi
 I want to match a string with the contents of hashmap. The process is like
this.

Let the string is abcd
First it will search for abcd in the map
if found i have to assign it to a variable else i has to remove the last
alphabet (abc) and have to match with hashmap like is the process.

My Problem is iam not able to do that iteration in when part 
What i have done is i will check the condition in when part if it matches
the hashmap then it will exit. Else it will satisfies the condition(String
not matching any of hashmap contents) and goes in then and update the string
by removing the last alphabet and loops .

rule somerule
no-loop false
when 
  condition for checking that hashmap  has no key of String s and
s.length0
then
  modify the String s by removing last alphabet
end


is there any option to do the looping in the when part itself


--
View this message in context: 
http://drools.46999.n3.nabble.com/Looping-in-When-part-tp3393236p3393236.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] Looping in When part

2011-10-04 Thread Wolfgang Laun
You'll need 2 rules, one for truncating a key that does not match and
another one for handling the match. If you have to handle absolute failure
(not even a matches) you'll need a third rule and a more complex fact for
storing the original and the truncated string.

These 2 rules are untested:

rule truncate when not found
when
$s: String( length  0 )
$m: Map( keySet not contains $s )
then
retract( $s );
insert( $s.substring( 0, $s.length() -1 );
end

rule found
when
$s: String()
$m: Map( keySet contains $s )
then
System.out.println( key  + $s +  is in the Map );
end

-W

On 4 October 2011 15:41, rahulkrishnan rahulkrishn...@gmail.com wrote:

 Hi
  I want to match a string with the contents of hashmap. The process is like
 this.

 Let the string is abcd
 First it will search for abcd in the map
 if found i have to assign it to a variable else i has to remove the last
 alphabet (abc) and have to match with hashmap like is the process.

 My Problem is iam not able to do that iteration in when part
 What i have done is i will check the condition in when part if it matches
 the hashmap then it will exit. Else it will satisfies the condition(String
 not matching any of hashmap contents) and goes in then and update the
 string
 by removing the last alphabet and loops .

 rule somerule
 no-loop false
 when
  condition for checking that hashmap  has no key of String s and
 s.length0
 then
  modify the String s by removing last alphabet
 end


 is there any option to do the looping in the when part itself


 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Looping-in-When-part-tp3393236p3393236.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] Are retracted events garbage collected in stateful session?

2011-10-04 Thread John
I am inserting a high volume of relatively large objects into a long-running
StatefulKnowledgeSession in Stream mode.  I use a rule to start a jbpm
process when each event is received, and the last step retracts the event. 
I assumed these were all being garbage collected until my app server started
running out of memory.  I ran a profiler and saw that none of my event
objects were ever collected.

Is there any way of freeing references without disposing the working memory? 
This is not a good option for our app.  I have read this post 
http://drools.46999.n3.nabble.com/Removing-facts-from-statefulknowledgeSession-s-memory-td1875795.html#a1881799
Removing-facts-from-statefulknowledgeSession-s-memory  and several others,
but my objects are all manually retracted.  I just need to make them
available for garbage collection.  

I am running drools 5.2.0 Final, guvnor 5.2.0 Final, and jbpm 5.1.0 Final
and I am using the BusinessRulesProcessor action in jboss to insert events.

Thanks,
John

--
View this message in context: 
http://drools.46999.n3.nabble.com/Are-retracted-events-garbage-collected-in-stateful-session-tp3393695p3393695.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] 5.3.0 CR1 has broken existing rules/flows

2011-10-04 Thread Jamie
Thanks for all of the feedback.  I haven't tried W's handler, but I'm
planning to.  I did take Edson's advice and was able to get some more info. 

It appears to involve the interaction between 3 rules.  For background, this
is a fraud detection application.  Under certain conditions, we need to look
up additional customer information.  Some rules are run to determine whether
the lookup is required and then another rule actually does the lookup.  In
this case:

Rule 021 says if the order is small, set the lookup flag to false
Rule 042B says if the order is from a 'bad' country, set the lookup flag to
true
Rule 022 says if the lookup flag is true, do the lookup

If rule 021 fires alone, then 022 does not fire and all is well.
If rule 042B fires alone, then 022 fires and all is well.
If 021 fires to turn off the lookup AND 042B fires to turn on the lookup,
then 022 gets and NPE.

As Edson suspected, the item is null and the 'rule' variable points to rule
021.

I'm not sure if it matters, but each rules involved is in a different agenda
group.

As I mentioned, this works in 5.2.0.Final, but breaks in 5.3.0.CR1. 

Hope this helps pinpoint the issue.


--
View this message in context: 
http://drools.46999.n3.nabble.com/5-3-0-CR1-has-broken-existing-rules-flows-tp3390922p3393730.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] 5.3.0 CR1 has broken existing rules/flows

2011-10-04 Thread Wolfgang Laun
Just saw and fixed an invalid import for ConsequenceExceptionHandler.
-W


On 4 October 2011 18:00, Jamie js...@llbean.com wrote:

 Thanks for all of the feedback.  I haven't tried W's handler, but I'm
 planning to.  I did take Edson's advice and was able to get some more info.

 It appears to involve the interaction between 3 rules.  For background,
 this
 is a fraud detection application.  Under certain conditions, we need to
 look
 up additional customer information.  Some rules are run to determine
 whether
 the lookup is required and then another rule actually does the lookup.  In
 this case:

 Rule 021 says if the order is small, set the lookup flag to false
 Rule 042B says if the order is from a 'bad' country, set the lookup flag to
 true
 Rule 022 says if the lookup flag is true, do the lookup

 If rule 021 fires alone, then 022 does not fire and all is well.
 If rule 042B fires alone, then 022 fires and all is well.
 If 021 fires to turn off the lookup AND 042B fires to turn on the lookup,
 then 022 gets and NPE.

 As Edson suspected, the item is null and the 'rule' variable points to rule
 021.

 I'm not sure if it matters, but each rules involved is in a different
 agenda
 group.

 As I mentioned, this works in 5.2.0.Final, but breaks in 5.3.0.CR1.

 Hope this helps pinpoint the issue.


 --
 View this message in context:
 http://drools.46999.n3.nabble.com/5-3-0-CR1-has-broken-existing-rules-flows-tp3390922p3393730.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] 5.3.0 CR1 has broken existing rules/flows

2011-10-04 Thread Edson Tirelli
   The difference in that area from 5.2 to 5.3 is that in 5.3 the
interaction between Terminal Nodes and the agenda was refactored into a
listerner pattern . This is required for future features we are working
on. It seems the change introduced the regression.

   This is probably enough info to recreate the problem and I bet the
different agenda groups are really important in recreating it.

   I am working in a couple tasks at the moment, but if you can meanwhile
open a JIRA with this info I will fix it for the 5.3 final release. If you
can, please try to isolate a test case with this scenario:

If 021 fires to turn off the lookup AND 042B fires to turn on the
lookup, then 022 gets and NPE.

   If you are unable to, no problem.

   BTW, I liked Wolfgang's handler as well. If he would like to contribute
the code, more than happy to add it to the codebase.

   Edson

2011/10/4 Jamie js...@llbean.com

 Thanks for all of the feedback.  I haven't tried W's handler, but I'm
 planning to.  I did take Edson's advice and was able to get some more info.

 It appears to involve the interaction between 3 rules.  For background,
 this
 is a fraud detection application.  Under certain conditions, we need to
 look
 up additional customer information.  Some rules are run to determine
 whether
 the lookup is required and then another rule actually does the lookup.  In
 this case:

 Rule 021 says if the order is small, set the lookup flag to false
 Rule 042B says if the order is from a 'bad' country, set the lookup flag to
 true
 Rule 022 says if the lookup flag is true, do the lookup

 If rule 021 fires alone, then 022 does not fire and all is well.
 If rule 042B fires alone, then 022 fires and all is well.
 If 021 fires to turn off the lookup AND 042B fires to turn on the lookup,
 then 022 gets and NPE.

 As Edson suspected, the item is null and the 'rule' variable points to rule
 021.

 I'm not sure if it matters, but each rules involved is in a different
 agenda
 group.

 As I mentioned, this works in 5.2.0.Final, but breaks in 5.3.0.CR1.

 Hope this helps pinpoint the issue.


 --
 View this message in context:
 http://drools.46999.n3.nabble.com/5-3-0-CR1-has-broken-existing-rules-flows-tp3390922p3393730.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




-- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] 5.3.0 CR1 has broken existing rules/flows

2011-10-04 Thread lhorton
definitely a much improved handler.  in case someone who reads this is using
spring to load droools, here is an example of loading a different handler
for a knowledge base in the xml:

drools:kbase id=workflowKnowledgeBase node=droolsClusterNode1
  drools:configurationdrools:consequenceExceptionHandler
handler=com.rules.utility.RulesConsequenceExceptionHandler
//drools:configuration
/drools:kbase

--
View this message in context: 
http://drools.46999.n3.nabble.com/5-3-0-CR1-has-broken-existing-rules-flows-tp3390922p3394441.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] 5.3.0 CR1 has broken existing rules/flows

2011-10-04 Thread Mark Proctor

On 04/10/2011 20:17, Edson Tirelli wrote:


   The difference in that area from 5.2 to 5.3 is that in 5.3 the 
interaction between Terminal Nodes and the agenda was refactored into 
a listerner pattern . This is required for future features we are 
working on. It seems the change introduced the regression.


   This is probably enough info to recreate the problem and I bet the 
different agenda groups are really important in recreating it.


   I am working in a couple tasks at the moment, but if you can 
meanwhile open a JIRA with this info I will fix it for the 5.3 final 
release. If you can, please try to isolate a test case with this scenario:


If 021 fires to turn off the lookup AND 042B fires to turn on the 
lookup, then 022 gets and NPE.

   If you are unable to, no problem.

   BTW, I liked Wolfgang's handler as well. If he would like to 
contribute the code, more than happy to add it to the codebase.

I've already aplied this to master and the 5.3.x branch:
https://issues.jboss.org/browse/JBRULES-3233

Mark


   Edson

2011/10/4 Jamie js...@llbean.com mailto:js...@llbean.com

Thanks for all of the feedback.  I haven't tried W's handler, but I'm
planning to.  I did take Edson's advice and was able to get some
more info.

It appears to involve the interaction between 3 rules.  For
background, this
is a fraud detection application.  Under certain conditions, we
need to look
up additional customer information.  Some rules are run to
determine whether
the lookup is required and then another rule actually does the
lookup.  In
this case:

Rule 021 says if the order is small, set the lookup flag to false
Rule 042B says if the order is from a 'bad' country, set the
lookup flag to
true
Rule 022 says if the lookup flag is true, do the lookup

If rule 021 fires alone, then 022 does not fire and all is well.
If rule 042B fires alone, then 022 fires and all is well.
If 021 fires to turn off the lookup AND 042B fires to turn on the
lookup,
then 022 gets and NPE.

As Edson suspected, the item is null and the 'rule' variable
points to rule
021.

I'm not sure if it matters, but each rules involved is in a
different agenda
group.

As I mentioned, this works in 5.2.0.Final, but breaks in 5.3.0.CR1.

Hope this helps pinpoint the issue.


--
View this message in context:

http://drools.46999.n3.nabble.com/5-3-0-CR1-has-broken-existing-rules-flows-tp3390922p3393730.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org mailto:rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




--
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com http://www.jboss.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] rule limit

2011-10-04 Thread Bobby Richards
Is it possible to limit the number of rules in a drl file?

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


Re: [rules-users] Memory leak in 5.2/5.3

2011-10-04 Thread alopez
Good news, I followed your advice and patched drools-core to prevent this,
focusing on removing all listeners:

AbstractWorkingMemory.java, line 1246:

for ( Iterator it = this.__ruleBaseEventListeners.iterator(); it.hasNext();
) {
   this.ruleBase.removeEventListener( (RuleBaseEventListener) it.next()
);
}

I changed that to:

for ( Iterator it = this.ruleBase.getRuleBaseEventListeners().iterator();
it.hasNext(); ) {
   this.ruleBase.removeEventListener( (RuleBaseEventListener) it.next()
);
}

And now works OK, no memory leak.

Thanks



--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-Memory-leak-in-5-2-5-3-tp3280351p3394726.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] rule limit

2011-10-04 Thread Ansgar Konermann
Am 04.10.2011 23:27, schrieb Bobby Richards:
 Is it possible to limit the number of rules in a drl file?
Yes.

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


[rules-users] Guvnor: Rules compilation error

2011-10-04 Thread Prashanth
Hi,

In-spite of having the jar loaded, and having them available in the Drools
Guvnor and able to write rules with “zero ” errors in verification,

Rule compilation fails during validation after writing rules, 

says “Cannot resolve classname” for all those classes that have been
imported and available to write rules

Classes have been referred with their fully qualified class-names too.

I request help to resolve this problem. 

Thanks and Regards
Prashanth

--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-Rules-compilation-error-tp3395529p3395529.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: Rules compilation error

2011-10-04 Thread Toni Rikkola
Hi,

I suggest that you open a Jira for this. https://issues.jboss.org/browse/GUVNOR
If possible, create a small repository export that we can use to reproduce 
this. 

Toni

On Oct 5, 2011, at 6:45 AM, Prashanth wrote:

 Hi,
 
 In-spite of having the jar loaded, and having them available in the Drools
 Guvnor and able to write rules with “zero ” errors in verification,
 
 Rule compilation fails during validation after writing rules, 
 
 says “Cannot resolve classname” for all those classes that have been
 imported and available to write rules
 
 Classes have been referred with their fully qualified class-names too.
 
 I request help to resolve this problem. 
 
 Thanks and Regards
 Prashanth
 
 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/Guvnor-Rules-compilation-error-tp3395529p3395529.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