Re: [rules-users] addKnowledgePackages Delay

2010-05-02 Thread Moe Alkhafaji
Thanks for the reply. But I don't understand what you mean by caching  
the KnowledgeBase. This is about adding a pre compiled  
KnowledgePackage to a KnowledgeBase. So, how does caching a  
KnowledgeBase makes addition of new KnowledgePackage faster? Please  
excuse my ignorance if I am not catching what you are suggesting.  
Maybe a couple of lines of code to demonstrate your suggestion would  
be greatly appreciated. Thanks.


Sent from my iPhone

On May 3, 2010, at 1:24 AM, Rajnikant Gupta   
wrote:



Hi,

Yes, adding packages to knowledgeBase does take some time. You can  
probably try caching your knowledgeBase. By doing this all, but  
first, requests should be significantly fast.





Regards,

Rajnikant Gupta

http://rkthinks.wordpress.com/


On Mon, May 3, 2010 at 11:36 AM, malkhafaji  
 wrote:


Hello,

I am trying to add knowledge packages to an existing KnowledgeBase. My
largest DRL file has 110 rules. I noticed that it may take up to 5  
seconds

just to execute the following statement:

this.knowledgeBase.addKnowledgePackages(packages);

where "packages" is just a list of one knowledge package  
representing one
drl. The nature of my rules is that I initially load a small set of  
rules
and then at runtime my rules may load other DRLs. The problem is  
each DRL
loading command (this.knowledgeBase.addKnowledgePackages(packages))  
takes a
few seconds and I have no idea why. Although, all those DRLs are  
already
compiled (at startup time). It is the line I pasted above that takes  
the

longest time out of anything else I do.

Any idea why just merely adding a KnowledgePackage list to a  
KnowledgeBase

can take this much time? Do you guys have any suggestions on how I can
reduce this time? I tried to create another dummy KnowledgeBase and  
get the
KnowledgePackage from it at runtime and add that to my KnowedgeBase  
above

(thinking that would reduce the time maybe), but not at all.

Any ideas would be great. The API does not have much info on what  
that add
method exactly does behind the scenes, and how I can get around the  
long
delays. This is very frustrating to me, and I am not sure where to  
look.

Thanks for ANY help at all.
--
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/addKnowledgePackages-Delay-tp772574p772574.html
Sent from the Drools - User 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


Re: [rules-users] addKnowledgePackages Delay

2010-05-02 Thread Rajnikant Gupta
Hi,

Yes, adding packages to knowledgeBase does take some time. You can probably
try caching your knowledgeBase. By doing this all, but first,
requests should be significantly fast.




Regards,

Rajnikant Gupta

http://rkthinks.wordpress.com/


On Mon, May 3, 2010 at 11:36 AM, malkhafaji wrote:

>
> Hello,
>
> I am trying to add knowledge packages to an existing KnowledgeBase. My
> largest DRL file has 110 rules. I noticed that it may take up to 5 seconds
> just to execute the following statement:
>
> this.knowledgeBase.addKnowledgePackages(packages);
>
> where "packages" is just a list of one knowledge package representing one
> drl. The nature of my rules is that I initially load a small set of rules
> and then at runtime my rules may load other DRLs. The problem is each DRL
> loading command (this.knowledgeBase.addKnowledgePackages(packages)) takes a
> few seconds and I have no idea why. Although, all those DRLs are already
> compiled (at startup time). It is the line I pasted above that takes the
> longest time out of anything else I do.
>
> Any idea why just merely adding a KnowledgePackage list to a KnowledgeBase
> can take this much time? Do you guys have any suggestions on how I can
> reduce this time? I tried to create another dummy KnowledgeBase and get the
> KnowledgePackage from it at runtime and add that to my KnowedgeBase above
> (thinking that would reduce the time maybe), but not at all.
>
> Any ideas would be great. The API does not have much info on what that add
> method exactly does behind the scenes, and how I can get around the long
> delays. This is very frustrating to me, and I am not sure where to look.
> Thanks for ANY help at all.
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/addKnowledgePackages-Delay-tp772574p772574.html
> Sent from the Drools - User 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] addKnowledgePackages Delay

2010-05-02 Thread malkhafaji

Hello,

I am trying to add knowledge packages to an existing KnowledgeBase. My
largest DRL file has 110 rules. I noticed that it may take up to 5 seconds
just to execute the following statement:

this.knowledgeBase.addKnowledgePackages(packages);

where "packages" is just a list of one knowledge package representing one
drl. The nature of my rules is that I initially load a small set of rules
and then at runtime my rules may load other DRLs. The problem is each DRL
loading command (this.knowledgeBase.addKnowledgePackages(packages)) takes a
few seconds and I have no idea why. Although, all those DRLs are already
compiled (at startup time). It is the line I pasted above that takes the
longest time out of anything else I do.

Any idea why just merely adding a KnowledgePackage list to a KnowledgeBase
can take this much time? Do you guys have any suggestions on how I can
reduce this time? I tried to create another dummy KnowledgeBase and get the
KnowledgePackage from it at runtime and add that to my KnowedgeBase above
(thinking that would reduce the time maybe), but not at all.

Any ideas would be great. The API does not have much info on what that add
method exactly does behind the scenes, and how I can get around the long
delays. This is very frustrating to me, and I am not sure where to look.
Thanks for ANY help at all.
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/addKnowledgePackages-Delay-tp772574p772574.html
Sent from the Drools - User 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 + ETL Process

2010-05-02 Thread Mauricio Salatino
Ok looks nice.. but you shouldn't begin and commit the transaction. If you
remove that.. do you have some error?

2010/5/2 

>  Hi Mauricio,
>
> Sorry if I was not clear. I have already installed Guvnor, and I have also
> changed repository.xml to persist data in MySQL.
> But I dont want to use Guvnor, I would like to author the rules and facts
> in Eclipse using Drools plugin ( I have also installed it ) and persist data
> in MySQL.
> That's because I'm trying to use JPAKnowlegeService
> Could you please take a look in the code of pastebin?
>
> TIA
>
>
>  -Original Message-
> From: Mauricio Salatino 
> To: Rules Users List 
> Sent: Fri, Apr 30, 2010 6:54 pm
> Subject: Re: [rules-users] Drools + ETL Process
>
>  Hi man,
> you are mixing a lot of stuff here..
> I will recommend you the following steps for achieving the steps that you
> are mentioning
> 1) Install guvnor
> 2) author the rules inside it.. (it already contains a JCR repository, that
> is similar to a database, it will allow you to store rules there), you can
> also author some objects (fact model) inside guvnor.
> 3) Then you can create tests to execute the rules and see which rules are
> fired.
>
> Greetings, hope it helps!
> 2010/4/30 
>
>>
>>  Hi Esteban,
>>
>> Sorry, I have only one week looking into Drools =)
>> Yes, I am talking about Drools Expert Database
>>
>> Looking into this
>> http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/apidocs/org/drools/persistence/jpa/JPAKnowledgeService.htmlI
>>  tried a sample snippet
>>
>> http://pastebin.com/uJd5642D
>>
>> But its incomplete, for example, I need to create the Rule in the database
>> also
>>
>> The things that I need to do are:
>> 1) Create Rule and Object Facts in Java and persist them in the Drools
>> Expert Database
>> 2) Check in the Guvnor Interface the Rules and Facts created in the step
>> before
>> 2) Fire the Rules created and get the response
>>
>>  Is there someone that have experience using JPA persistence with Drools?
>> I already have a simple project configured using JPA and Hibernate but I
>> still don't know how to proceed =(
>>
>> Thanks In Advance !
>>   -Original Message-
>> From: Esteban Aliverti 
>> To: Rules Users List 
>> Sent: Thu, Apr 29, 2010 9:02 pm
>> Subject: Re: [rules-users] Drools + ETL Process
>>
>>  Which drools database are you talking about? If you just want to use
>> drools expert, you don't need any db. If you want to persist your kbase or
>> rules, feel free to use whatever mechanism you want.
>>
>>  2010/4/28 
>>
>>>
>>>  Hi all,
>>>
>>> I am using Drools 5.0 with Tomcat 6 and MySQL.
>>>
>>> Now I need to insert data in the drools database but I DON'T want to use
>>> the Guvnor interface.
>>> This is because in the future we'll need to use a kind of ETL process to
>>> populate the drools database.
>>>
>>> Should I create a java class with JDBC access and perform a SQL direct to
>>> that tables?
>>> I did the reverse engineering of the drools database but I could not
>>> understood yet where the data are persisted.
>>>
>>> Any advice should be very helpful.
>>>
>>> Thanks in advance.
>>>
>>>
>>> ___
>>> rules-users mailing list
>>> rules-users@lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/rules-users
>>>
>>>
>>
>>
>> --
>> 
>>
>> Esteban Aliverti
>>
>> ___
>>
>>
>> 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
>>
>>
>
>
> --
> - http://salaboy.wordpress.com
> - http://www.jbug.com.ar
> - Salatino "Salaboy" Mauricio -
>
> ___
>
> 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
>
>


-- 
- http://salaboy.wordpress.com
- http://www.jbug.com.ar
- Salatino "Salaboy" Mauricio -
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools + ETL Process

2010-05-02 Thread andre . fonseca

 Hi Mauricio,

Sorry if I was not clear. I have already installed Guvnor, and I have also 
changed repository.xml to persist data in MySQL.
But I dont want to use Guvnor, I would like to author the rules and facts in 
Eclipse using Drools plugin ( I have also installed it ) and persist data in 
MySQL.
That's because I'm trying to use JPAKnowlegeService
Could you please take a look in the code of pastebin?

TIA


 

 

-Original Message-
From: Mauricio Salatino 
To: Rules Users List 
Sent: Fri, Apr 30, 2010 6:54 pm
Subject: Re: [rules-users] Drools + ETL Process


Hi man,
you are mixing a lot of stuff here..
I will recommend you the following steps for achieving the steps that you are 
mentioning
1) Install guvnor
2) author the rules inside it.. (it already contains a JCR repository, that is 
similar to a database, it will allow you to store rules there), you can also 
author some objects (fact model) inside guvnor.
3) Then you can create tests to execute the rules and see which rules are fired.

Greetings, hope it helps!

2010/4/30  

 

 Hi Esteban,

Sorry, I have only one week looking into Drools =)
Yes, I am talking about Drools Expert Database

Looking into this 
http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/apidocs/org/drools/persistence/jpa/JPAKnowledgeService.html
 I tried a sample snippet

http://pastebin.com/uJd5642D

But its incomplete, for example, I need to create the Rule in the database also

The things that I need to do are:
1) Create Rule and Object Facts in Java and persist them in the Drools Expert 
Database
2) Check in the Guvnor Interface the Rules and Facts created in the step before
2) Fire the Rules created and get the response


 

 Is there someone that have experience using JPA persistence with Drools? I 
already have a simple project configured using JPA and Hibernate but I still 
don't know how to proceed =(

Thanks In Advance !



-Original Message-
From: Esteban Aliverti 
To: Rules Users List 
Sent: Thu, Apr 29, 2010 9:02 pm
Subject: Re: [rules-users] Drools + ETL Process


Which drools database are you talking about? If you just want to use drools 
expert, you don't need any db. If you want to persist your kbase or rules, feel 
free to use whatever mechanism you want.


2010/4/28  

 

 Hi all,

I am using Drools 5.0 with Tomcat 6 and MySQL.

Now I need to insert data in the drools database but I DON'T want to use the 
Guvnor interface.
This is because in the future we'll need to use a kind of ETL process to 
populate the drools database.

Should I create a java class with JDBC access and perform a SQL direct to that 
tables?
I did the reverse engineering of the drools database but I could not understood 
yet where the data are persisted.

Any advice should be very helpful.

Thanks in advance.




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





-- 


Esteban Aliverti

 
___

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





-- 
 - http://salaboy.wordpress.com
 - http://www.jbug.com.ar
 - Salatino "Salaboy" Mauricio -

 
___
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] RuleAgent in webservice

2010-05-02 Thread shekharputtur puttur
Hi All

I am using Guvnor  for rule edition and modification.
I uploaded the Package containing the classes for writing rules.
Attributes are taken from the uploaded package.Package was developed in
eclipse editor.
Rule writing was successful. In property file i have stored URL given by the
Guvnor.
I have stored  the property file at "WEB-INF/classes".The Rule agent is
reading the property file.
But when I run the project, it shows "ClassNotFoundException" for the class
I uploaded in the Guvnor.
When I viewed the Package source in the Guvnor  I could see the import
statement
for the class,but still why this error?
Could anybody give me some hints to solve this.
Thanks & Regards
Shekhar



On Fri, Apr 30, 2010 at 11:19 PM, shekharputtur puttur <
shekharput...@gmail.com> wrote:

> Hi All
> Thanks a lot for your kind response.
> After putting properties file in the "WEB-INF/classes" it worked.
> I will try the method suggested by you too.
>
> Thanks &  Regards
> Shekhar
> Bangalore
>
>
>
>
> On 4/30/10, Gayatri Chandak  wrote:
>>
>> Hi,
>>
>> I had also faced the same problem.
>> Use the below code, it works proeprly.
>>
>> Properties properties = new Properties();
>> InputStream stream = DiscountCheckServlet.class.getResourceAsStream
>> ("");
>> properties.load(stream);
>> RuleAgent agent = RuleAgent.newRuleAgent(properties);
>>
>> Please let me know if it works.
>>
>> Regards,
>> Gayatri Chandak
>> TEG-Open Source
>> Tata Consultancy Services
>> Yantra Park -(STPI)
>> 2nd Pokharan Road,
>> Opp HRD Voltas Center,Subash Nagar
>> Mumbai - 400 601,Maharashtra
>> India
>> Ph:- 022-67782556
>> Mailto: gayatri.chan...@tcs.com
>> Website: http://www.tcs.com
>> 
>> Experience certainty.   IT Services
>>  Business Solutions
>>  Outsourcing
>> 
>>
>>
>>
>> From:   shekharputtur puttur 
>>
>> To: rules-users@lists.jboss.org
>>
>> Date:   04/30/2010 02:29 PM
>>
>> Subject:[rules-users] RuleAgent in webservice
>>
>> Sent by:rules-users-boun...@lists.jboss.org
>>
>>
>>
>>
>>
>>
>> Hi All,
>> I am  using drools API, and developed a webservice out of it.
>> I created rule binary package using BRMS Guvnor.
>> I used RuleAgent to acces the properties file.
>> ie RuleAgent agent = RuleAgent.newRuleAgent("/
>> application.properties");
>> "application.properties"  file was stored in current working directory.
>> I executed my application using eclipse, it was fine .
>>
>> For testing  purpose  i  deployed  the application in tomcat application
>> server.
>> Now  it is unable to find "application.properties" file. and shows
>> following in "catalina.out" file:
>> java.lang.NullPointerException
>> at java.util.Properties$LineReader.readLine(Properties.java:418)
>> at java.util.Properties.load0(Properties.java:337)
>> at java.util.Properties.load(Properties.java:325)
>> at org.drools.agent.RuleAgent.loadFromProperties
>> (RuleAgent.java:299)
>> at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:256)
>> My question is, in which location should i keep the
>> "application.properties" file , so that RuleAgent can access it.
>>
>> Could you please tell me the solution.
>>
>> Thanks & Regards
>> Shekhar___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>>
>> =-=-=
>> Notice: The information contained in this e-mail
>> message and/or attachments to it may contain
>> confidential or privileged information. If you are
>> not the intended recipient, any dissemination, use,
>> review, distribution, printing or copying of the
>> information contained in this e-mail message
>> and/or attachments to it are strictly prohibited. If
>> you have received this communication in error,
>> please notify us by reply e-mail or telephone and
>> immediately and permanently delete the message
>> and any attachments. Thank you
>>
>>
>>
>>
>> ___
>> 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