Error loading .brl rules
by Fnu Mahalakshmi
Hi,
I am getting an error reading .brl files.
Using this snippet of code for converting from brl to drl
import org.apache.commons.io.*;
String fileName = "GuidedRule.brl";
File file = new File(fileName);
String fileAsString = FileUtils.readFileToString(file);
BRXMLPersistence read = (BRXMLPersistence) BRXMLPersistence.getInstance();
BRDRLPersistence write = (BRDRLPersistence) BRDRLPersistence.getInstance();
String outputDRL = write.marshal(read.unmarshal(fileAsString));
String drlFilePath = "drlFile.drl";
File drlFile = new File(drlFilePath);
FileUtils.writeStringToFile(drlFile, outputDRL);
builder.addPackageFromDrl(new
InputStreamReader(RuleRunner.class.getResourceAsStream(drlFilePath)));
For this, I added commons-logging-1.1.1.jar file to my classpath. But still FileUtils is not getting resolved.
SO am unable to use FileUtils to convert input to String format.
Is there any other way to do this??? Why am I getting the error even after adding the jar to my classpath???
Please Help,
Thank you.
M
</pre>
<P><hr size=1></P>
<P><STRONG><font color=green>Please consider the environment before printing this email.</font></STRONG></P>
<P><STRONG>Visit our website at <a href="http://www.nyse.com">http://www.nyse.com</a> <br>
*****************************************************************************
<br>
Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.
</STRONG></P><pre>
15 years, 9 months
Re: [rules-users] error running .brl frules
by Fnu Mahalakshmi
Hi,
I have {Rule1.drl,Rule2,drl,Rule3.brl}
Both the .drl rules run correctly but the .brl does not load and gives me the following error
I am loading my rules as follows:
private RuleBase loadRules(String[] rules) throws Exception{
PackageBuilder builder = new PackageBuilder();
for ( int i = 0; i < rules.length; i++ ) {
String rulesFiles = rules[i];
//Check the type of rule file, then load it
System.out.println("loading rule file : "+rulesFiles);
loadRuleFile(rulesFiles,builder);
}
Package pkg = builder.getPackage();
RuleBase localRuleBase = RuleBaseFactory.newRuleBase();
localRuleBase.addPackage( pkg );
return localRuleBase;
}
private void loadRuleFile(String rulesFiles,PackageBuilder addRulesToThisPackage ) throws DroolsParserException, IOException{
int len = rulesFiles.length();
if(rulesFiles.substring((len-4), len).equalsIgnoreCase(".brl")){
BRXMLPersistence read = (BRXMLPersistence) BRXMLPersistence.getInstance();
BRDRLPersistence write = (BRDRLPersistence) BRDRLPersistence.getInstance();
String brl = rulesFiles;
String outputDRL = write.marshal(read.unmarshal(brl));
rulesFiles = outputDRL;
}
Reader source = new InputStreamReader( RuleRunner.class.getResourceAsStream(rulesFiles) );
//Exception if rule files are not found
if(null==source){
throw new FileNotFoundException("Cannot find rule file:"+rulesFiles);
}
//Load the rules , no DSL
addRulesToThisPackage.addPackageFromDrl(source);
}
I get the following error:
[Fatal Error] :1:1: Content is not allowed in prolog.
Exception in thread "main" com.thoughtworks.xstream.io.StreamException: : Content is not allowed in prolog.
at com.thoughtworks.xstream.io.xml.DomDriver.createReader(DomDriver.java:65)
at com.thoughtworks.xstream.io.xml.DomDriver.createReader(DomDriver.java:47)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:781)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:773)
at org.drools.brms.server.util.BRXMLPersistence.unmarshal(BRXMLPersistence.java:91)
at com.org.RuleRunner.loadRuleFile(RuleRunner.java:65)
at com.org.RuleRunner.loadRules(RuleRunner.java:42)
at com.org.RuleRunner.runStatelessRules(RuleRunner.java:90)
at com.org.RulesTest.main(RulesTest.java:40)
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at com.thoughtworks.xstream.io.xml.DomDriver.createReader(DomDriver.java:58)
... 8 more
Any Idea?????
Thank you.
M
</pre>
<P><hr size=1></P>
<P><STRONG><font color=green>Please consider the environment before printing this email.</font></STRONG></P>
<P><STRONG>Visit our website at <a href="http://www.nyse.com">http://www.nyse.com</a> <br>
*****************************************************************************
<br>
Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.
</STRONG></P><pre>
15 years, 9 months
AddKnowledgePackage with rules that uses global vars complains that the global var is not set
by dgimenes
I'm trying to add rules after the Process (workflow) started. That works, but
I wanted the rules to access database data using hibernate.
So I created a global object to store my EntityManager (I'm using SEAM; it's
like a Session object).
The problem is that when I add the KnowledgePackage with the rule that uses
the EntityManager, an exception is thrown because the global is not set.
BUT, if I try to set the global var, I get an exception saying it does not
exist.
Do you have any idea?
I've seen that when I add the KnowledgePackage to the
StatefullKnowledgeSession the rules are fired, and then I get the exception.
Is there a way to NOT fire the rules after inserting the packages?
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/AddKnowledgePackage-w...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 9 months
error accessing repository
by Fnu Mahalakshmi
Hi guys,
I am getting a really weird problem.
I am using eclipse for working on my drools project and I have installed the plugin for drools using the update link specified on the site.
It seemed to be working fine till yesterday.
But now I do not even get the option of importing from my guvnor repository. The guvnor option seems to not be there anywhere.
I tried reupdating using the link but that is fine.
Is there something I am missing over here???
Please help!
-M
</pre>
<P><hr size=1></P>
<P><STRONG><font color=green>Please consider the environment before printing this email.</font></STRONG></P>
<P><STRONG>Visit our website at <a href="http://www.nyse.com">http://www.nyse.com</a> <br>
*****************************************************************************
<br>
Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.
</STRONG></P><pre>
15 years, 9 months
Re: [rules-users] rules-users Digest, Vol 43, Issue 60
by Nikhil S. Kulkarni
Hi,
Thanks Thomas for Reply for Re: [rules-users] How to break the rules execution if one has
been satisfied ??
My Question is like in Java as we have break statement so that we can terminate the loop,
So if there are 1000 rules activated and Rule fired is Rule no 4 then How will I come out of this
Immediately in order to save time of rules execution.
Thanks & Regards,
Nikhil S. Kulkarni
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of rules-users-request(a)lists.jboss.org
Sent: Friday, June 11, 2010 5:16 PM
To: rules-users(a)lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 60
Send rules-users mailing list submissions to
rules-users(a)lists.jboss.org
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.jboss.org/mailman/listinfo/rules-users
or, via email, send a message with subject or body 'help' to
rules-users-request(a)lists.jboss.org
You can reach the person managing the list at
rules-users-owner(a)lists.jboss.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of rules-users digest..."
Today's Topics:
1. Fwd: [drools-user] Write Drools Books - Packt Publishing.
(Mark Proctor)
2. How to break the rules execution if one has been satisfied ??
(Nikhil S. Kulkarni)
3. Re: How to break the rules execution if one has been
satisfied ?? (Swindells, Thomas)
----------------------------------------------------------------------
Message: 1
Date: Fri, 11 Jun 2010 12:07:43 +0100
From: Mark Proctor <mproctor(a)codehaus.org>
Subject: [rules-users] Fwd: [drools-user] Write Drools Books - Packt
Publishing.
To: Rules Users List <rules-users(a)lists.jboss.org>, Rules Dev List
<rules-dev(a)lists.jboss.org>
Message-ID: <4C1218FF.8000608(a)codehaus.org>
Content-Type: text/plain; charset="iso-8859-1"
-------- Original Message --------Kshipra Singh <kshipras(a)packtpub.com>
Hello Everybody,
I represent Packt Publishing, the publishers of computer related books.
We are planning to expand our range of Drools books and are currently
inviting Drools experts interested in writing books for Packt.
We do not expect our authors to have any past writing experience. All
that you need to write for Packt is an expert knowledge of your subject,
a passion to share it with others and an ability to communicate clearly
in English.
So, if you love Drools and fancy writing a book, here's an opportunity
for you! Send us your book ideas at author(a)packtpub.com. Even if you
don't have a book idea and are simply interested in writing a book, we
are keen to hear from you!
More details about this opportunity are available at :
http://authors.packtpub.com/content/packt-invites-drools-book-ideas-authors
Thanks
Kshipra Singh
Author Relationship Manager
Packt Publishing
www.PacktPub.com <http://www.PacktPub.com>
Skype: kshiprasingh15
Twitter: http://twitter.com/packtauthors
Interested in becoming an author? Visit http://authors.packtpub.com for
all the information you need about writing for Packt.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100611/909f772...
------------------------------
Message: 2
Date: Fri, 11 Jun 2010 16:57:09 +0530
From: "Nikhil S. Kulkarni" <Nikhil.Kulkarni(a)mastek.com>
Subject: [rules-users] How to break the rules execution if one has
been satisfied ??
To: "rules-users(a)lists.jboss.org" <rules-users(a)lists.jboss.org>
Message-ID:
<697B15BDCE7BED458A324B1B4D09463D4CE6DBBF57(a)IND-MHP1MCL001.mastek.com>
Content-Type: text/plain; charset="us-ascii"
Hi,
In rules, in a particular rule set, all the when's are executed. In technical terms, the activation is first created. For all the rules in a rule set the when condition is first evaluated and if the when condition is satisfied for any rule then the rule is marked as ready to fire. Once all the when part for all the rules are evaluated then all the ones that were marked for fire are fired.
The performance issue that if there are some 1500 rows. Hence, when the rule is fired there are 1500 when conditions that are firstly checked. And only after this the then part is fired. There is no way to break the when checks on successful satisfaction of a particular rule when.
Example:
If I have say a group of 1000 rules as mentioned below
Rule_1
Salience 1000
When
Some_Conditions_1
Then
Some_Actions_1
Rule_2
Salience 999
When
Some_Conditions_2
Then
Some_Actions_2
.
.
.
Rule_1000
Salience 1
When
Some_Conditions_1000
Then
Some_Actions_1000
Let's assume that Some_conditions_2 = true
Now even though I have an ordering using salience, the rule engine will still execute all the when conditions (Some_Conditions_1 .. Some_Conditions_1000)
Is it possible for me to break this when evaluation even if one has been satisfied?
Thanks & Regards,
Nikhil S. Kulkarni
MASTEK LTD.
Mastek is in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCOMASTEK
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100611/2482cf2...
------------------------------
Message: 3
Date: Fri, 11 Jun 2010 12:46:01 +0100
From: "Swindells, Thomas" <TSwindells(a)nds.com>
Subject: Re: [rules-users] How to break the rules execution if one has
been satisfied ??
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<DAC86F5F3B84F14088F0DB16092558CA0855AE8E0A(a)UKMA1.UK.NDS.COM>
Content-Type: text/plain; charset="us-ascii"
You technical description isn't at all accurate.
You need to read up on Rete Trees, I'm still a bit vague on them myself but a hopefully slightly more accurate description is as follows:
When the rules are compiled each of their conditions is converted to a node on the graph. If rules share the same initial set of conditions then they will share those nodes in the tree. These nodes contain references to the data in the working memory that they match against. When an object is added or updated in working memory then the knowledge of this allows just the relevant nodes to be re-evaluated trickling down the tree. If a leaf node is reached with a particular set of Objects then this means that the rule can then be placed on the activation queue with that set of data.
This Rete graph is designed to solve the problem you are describing which is why we have a rules engine rather than doing the naive procedural implementation of 'firing rules'. Of course if all your rules are disjoint but rely on the same set of Objects then there isn't any choice but to evaluate all the rules, after all they may all do different things and normally you want multiple rules to fire.
How you write your rules can also have a massive impact on performance and the shape of the graph (which you can see in eclipse), are you worrying about this purely from a theoretical viewpoint or are you having a concrete performance problem?
Hope this helps your understanding,
Thomas
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Nikhil S. Kulkarni
Sent: 11 June 2010 12:27
To: rules-users(a)lists.jboss.org
Subject: [rules-users] How to break the rules execution if one has been satisfied ??
Hi,
In rules, in a particular rule set, all the when's are executed. In technical terms, the activation is first created. For all the rules in a rule set the when condition is first evaluated and if the when condition is satisfied for any rule then the rule is marked as ready to fire. Once all the when part for all the rules are evaluated then all the ones that were marked for fire are fired.
The performance issue that if there are some 1500 rows. Hence, when the rule is fired there are 1500 when conditions that are firstly checked. And only after this the then part is fired. There is no way to break the when checks on successful satisfaction of a particular rule when.
Example:
If I have say a group of 1000 rules as mentioned below
Rule_1
Salience 1000
When
Some_Conditions_1
Then
Some_Actions_1
Rule_2
Salience 999
When
Some_Conditions_2
Then
Some_Actions_2
.
.
.
Rule_1000
Salience 1
When
Some_Conditions_1000
Then
Some_Actions_1000
Let's assume that Some_conditions_2 = true
Now even though I have an ordering using salience, the rule engine will still execute all the when conditions (Some_Conditions_1 .. Some_Conditions_1000)
Is it possible for me to break this when evaluation even if one has been satisfied?
Thanks & Regards,
Nikhil S. Kulkarni
MASTEK LTD.
Mastek is in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCOMASTEK
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
________________________________
**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster(a)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
**************************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100611/0da1a60...
------------------------------
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
End of rules-users Digest, Vol 43, Issue 60
*******************************************
MASTEK LTD.
Mastek is in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCOMASTEK
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 years, 9 months
How to break the rules execution if one has been satisfied ??
by Nikhil S. Kulkarni
Hi,
In rules, in a particular rule set, all the when's are executed. In technical terms, the activation is first created. For all the rules in a rule set the when condition is first evaluated and if the when condition is satisfied for any rule then the rule is marked as ready to fire. Once all the when part for all the rules are evaluated then all the ones that were marked for fire are fired.
The performance issue that if there are some 1500 rows. Hence, when the rule is fired there are 1500 when conditions that are firstly checked. And only after this the then part is fired. There is no way to break the when checks on successful satisfaction of a particular rule when.
Example:
If I have say a group of 1000 rules as mentioned below
Rule_1
Salience 1000
When
Some_Conditions_1
Then
Some_Actions_1
Rule_2
Salience 999
When
Some_Conditions_2
Then
Some_Actions_2
.
.
.
Rule_1000
Salience 1
When
Some_Conditions_1000
Then
Some_Actions_1000
Let's assume that Some_conditions_2 = true
Now even though I have an ordering using salience, the rule engine will still execute all the when conditions (Some_Conditions_1 .. Some_Conditions_1000)
Is it possible for me to break this when evaluation even if one has been satisfied?
Thanks & Regards,
Nikhil S. Kulkarni
MASTEK LTD.
Mastek is in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCOMASTEK
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 years, 9 months
Fwd: [drools-user] Write Drools Books - Packt Publishing.
by Mark Proctor
-------- Original Message --------Kshipra Singh <kshipras(a)packtpub.com>
Hello Everybody,
I represent Packt Publishing, the publishers of computer related books.
We are planning to expand our range of Drools books and are currently
inviting Drools experts interested in writing books for Packt.
We do not expect our authors to have any past writing experience. All
that you need to write for Packt is an expert knowledge of your subject,
a passion to share it with others and an ability to communicate clearly
in English.
So, if you love Drools and fancy writing a book, here's an opportunity
for you! Send us your book ideas at author(a)packtpub.com. Even if you
don't have a book idea and are simply interested in writing a book, we
are keen to hear from you!
More details about this opportunity are available at :
http://authors.packtpub.com/content/packt-invites-drools-book-ideas-authors
Thanks
Kshipra Singh
Author Relationship Manager
Packt Publishing
www.PacktPub.com <http://www.PacktPub.com>
Skype: kshiprasingh15
Twitter: http://twitter.com/packtauthors
Interested in becoming an author? Visit http://authors.packtpub.com for
all the information you need about writing for Packt.
15 years, 9 months
Write Drools Books - Packt Publishing.
by Kshipra Singh
Hello Everybody,
I represent Packt Publishing, the publishers of computer related books.
We are planning to expand our range of Drools books and are currently inviting Drools experts interested in writing books for Packt.
We do not expect our authors to have any past writing experience. All that you need to write for Packt is an expert knowledge of your subject, a passion to share it with others and an ability to communicate clearly in English.
So, if you love Drools and fancy writing a book, here's an opportunity for you! Send us your book ideas at author(a)packtpub.com. Even if you don't have a book idea and are simply interested in writing a book, we are keen to hear from you!
More details about this opportunity are available at : http://authors.packtpub.com/content/packt-invites-drools-book-ideas-authors
Thanks
Kshipra Singh
Author Relationship Manager
Packt Publishing
www.PacktPub.com
Skype: kshiprasingh15
Twitter: http://twitter.com/packtauthors
Interested in becoming an author? Visit http://authors.packtpub.com for all the information you need about writing for Packt.
15 years, 9 months
Re: [rules-users] Design question for user login monitoring
by Greg Barton
Sure, an EJB call is fine. The rule action is just plain old java code. However I'd suggest not making a remote call directly. Unless you're using multithreaded execution the rules will run In only one thread, so a slow RPC will pause everything. I'd send requests locally to an external processing thread.
GreG
On Jun 10, 2010, at 11:04 AM, Earnie Dyke <earniedyke(a)yahoo.com> wrote:
Greg,
Thanks for the quick response. I already have the Login logging working with
and entity similar to what you describe.
To address your issues:
1. Yes, a singleton rule session is what I had in mind. Running inside an
MBean.
2. Could the service you refer to be an EJB? My app is using Seam if that
adds anything to this discussion.
Earnie!
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Design-question-for-u...
Sent from the Drools - User mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
15 years, 9 months
Convert rules to XSLT and dumping Rete Tree to XML
by Andargor
Hello, first time on this list, be gentle :)
I need to convert DRL/DSLR rules to XSLT. There are many reasons why this is
necessary, but I would rather not get into that.
The rules themselves are very simple presence/absence of "tags" and simple
numeric comparisons (all easily converted to XSLT), and the rule base is
acyclic. The RHS does not contain anything other than insertLogicals.
I can already perform a topological sort of the rules and output XSLT.
However, it gets messy because of the differing approach from Drools and I
was wondering if I could somehow dump to XML the "compiled" Rete network
from the KnowledgeBase (or WorkingMemory, or KnowledgeBuilder, I'm not
sure). That way i think I can make the XSLT simpler and cleaner by using a
more hierarchical approach to the statements.
There used to be Dumper and ReteDumper classes to do this in the past, but
looking at the source they seem to have disappeared.
Can someone give me a few pointers on dumping the Rete Tree to XML?
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Convert-rules-to-XSLT...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 9 months