Re: [rules-users] how to move a repository from derby database to Oracle Database

2010-05-03 Thread Jaroslaw Kijanowski
The first FileSystem path param should be the same as in the default 
repository.xml file. This is



and not



vadlam wrote:
> for some reason, the xml info within the OraclePersistenceManager tag came
> out as blank in the post.
> 
> I am attaching the file this time.
> 
> Also, I changed the path to point to rep.home variable as you suggested. I
> still get the same error. http://n3.nabble.com/file/n773632/repository.xml
> repository.xml 
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Rules doubt

2010-05-03 Thread Wolfgang Laun
Anatoly,

please note that I wrote "please" to Puneet, which is usually not considered
as being "impolite". Also, kindly note that I asked for more information,
which,
in my book, is not "inconsiderate", as simply deleting Puneet's post might
have been.

I do resent being called a "hater", and I'll let the community judge whether
my (admittedly ironic) kidding is "hateful". Somehow, however, posters have
to
be admonished to state their problem more detailed, without people on the
list having to waste their time playing guessing games or writing replies
begging
for more information.

-W

PS: A you can see now, it was not a question of "debugging", and so you have
wasted
your time on a "simple question". :-)


On Tue, May 4, 2010 at 5:10 AM, tolitius  wrote:

>
>
> @Wolfgang,
>
>No need to be a hater Wolfgang, the question is simple. I agree,
> examples would be helpful, but that is NOT how you grow a friendly
> community.
>
>Community is the biggest problem JBoss has. Why is it so inhumanly
> difficult to be polite and considerate?
>
> /Anatoly
>
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/Rules-doubt-tp774023p775029.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


Re: [rules-users] Rules doubt

2010-05-03 Thread Wolfgang Laun
Puneet,

this is what I do to load rules and start a session:


File drl = new File( getDrlPath() );

ruleBase = RuleBaseFactory.newRuleBase();
PackageBuilder pb = new PackageBuilder();
Reader fr = new FileReader( drl );
pb.addPackageFromDrl( fr );

if( pb.hasErrors() ){
PackageBuilderErrors errors = pb.getErrors();
for( DroolsError err: errors.getErrors() ){
System.err.println( err.toString() );
}
return;  // or whatever you need to do in your environment to
abort
}

ruleBase.addPackages( pb.getPackages() );
session = ruleBase.newStatefulSession();

and this is the error message that's printed due to a comparable error:
Rule Compilation error : [Rule name='ruleB']
appl/activation/Rule_ruleB_0.java (10:524) : The method setName(String)
in the type Thing is not applicable for the arguments (Double)

-W


2010/5/4 Puneet duggal 

> This is My rule
>
>
> rule "Area_SquareFt_01_10-01-09_12-31-14"
> date-effective "01-Oct-2009" date-expires "31-Dec-2014"  salience 6
>  no-loop true
>   when
>  eval(BusinessLogic.gettest("Inside Area_SquareFt_01_10-01-09_12-31-14
> executed"))
>  objectP2483 : Para_2483( (fid2335=="Block") && (fid2336=="16") );
>
>  then
>  System.out.println("Area_SquareFt_01_10-01-09_12-31-14 executed");
>  objectP2483.setFid31003(new Double(497)); end
>
>
>
>  here My 31003 is a String  field   but i am assigning a Double in it  so
> that should'nt
>  work . But  the problem is because of this my all remmaning rules also
> stoped working.
> And it took 2 hours to detect it because the execute() method dosent
> through any error.
> So how can we detect these situation earlier ,so as to catch the problem
> early and why my the remm
> rules stoped woking because on this.
>
>
>
>
> On 5/4/10, tolitius  wrote:
>>
>>
>> @Puneet,
>>
>>Examples would be useful to understand what kind of problem you are
>> having. As to
>> Puneet wrote:
>> > how can I detect which exact business rule is having error
>>
>>Check out "Debugging Rules" section of Drools documentation:
>> http://bit.ly/9PRDRJ
>>
>> @Wolfgang,
>>
>>No need to be a hater Wolfgang, the question is simple. I agree,
>> examples would be helpful, but that is NOT how you grow a friendly
>> community.
>>
>>Community is the biggest problem JBoss has. Why is it so inhumanly
>> difficult to be polite and considerate?
>>
>> /Anatoly
>>
>> --
>> View this message in context:
>> http://drools-java-rules-engine.46999.n3.nabble.com/Rules-doubt-tp774023p775029.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] Rules doubt

2010-05-03 Thread Puneet duggal
This is My rule


rule "Area_SquareFt_01_10-01-09_12-31-14"
date-effective "01-Oct-2009" date-expires "31-Dec-2014"  salience 6
 no-loop true
  when
 eval(BusinessLogic.gettest("Inside Area_SquareFt_01_10-01-09_12-31-14
executed"))
 objectP2483 : Para_2483( (fid2335=="Block") && (fid2336=="16") );

 then
 System.out.println("Area_SquareFt_01_10-01-09_12-31-14 executed");
 objectP2483.setFid31003(new Double(497)); end



 here My 31003 is a String  field   but i am assigning a Double in it  so
that should'nt
 work . But  the problem is because of this my all remmaning rules also
stoped working.
And it took 2 hours to detect it because the execute() method dosent through
any error.
So how can we detect these situation earlier ,so as to catch the problem
early and why my the remm
rules stoped woking because on this.




On 5/4/10, tolitius  wrote:
>
>
> @Puneet,
>
>Examples would be useful to understand what kind of problem you are
> having. As to
> Puneet wrote:
> > how can I detect which exact business rule is having error
>
>Check out "Debugging Rules" section of Drools documentation:
> http://bit.ly/9PRDRJ
>
> @Wolfgang,
>
>No need to be a hater Wolfgang, the question is simple. I agree,
> examples would be helpful, but that is NOT how you grow a friendly
> community.
>
>Community is the biggest problem JBoss has. Why is it so inhumanly
> difficult to be polite and considerate?
>
> /Anatoly
>
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/Rules-doubt-tp774023p775029.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


Re: [rules-users] Rules doubt

2010-05-03 Thread Puneet duggal
@ friends,

This is My rule:-


rule "Area_SquareFt_01_10-01-09_12-31-14"
date-effective "01-Oct-2009" date-expires "31-Dec-2014"  salience 6
 no-loop true
  when
 eval(BusinessLogic.gettest("Inside Area_SquareFt_01_10-01-09_12-31-14
executed"))
 objectP2483 : Para_2483( (fid2335=="Block") && (fid2336=="16") );

 then
 System.out.println("Area_SquareFt_01_10-01-09_12-31-14 executed");
 objectP2483.setFid31003(new Double(497)); end



 here My 31003 is a String  field   but i am assigning a Double in it  so
that should'nt
 work . But  the problem is because of this my all remmaning rules also
stoped working.
And it took 2 hours to detect it because the execute() method dosent through
any error.
So how can we detect these situation earlier ,so as to catch the problem
early and why my the remm
rules stoped woking because on this.




On 5/4/10, Wolfgang Laun  wrote:
>
> Would you please turn your screen a little more to the left and enlarge the
> font so
> that we can see what "mistake" you have made and what the error message is?
>
> It would also help if we could see when this "mistake" happens.
>
> -W
>
>
> 2010/5/3 Puneet duggal 
>
>>  @ friends,
>>
>>
>> i am facing a  problem  in  my business rules and it is :-
>>
>>
>> when i make  single  mistake in my business rule rest all rules
>> stops working ,why is it so  ?  and how can i detect which exact business
>> rule is having
>> error
>>
>> thanks
>> Puneet
>>
>> ___
>> 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] Rules doubt

2010-05-03 Thread Mauricio Salatino
heh..
the kbuilder.getErrors() will show you some of the errors that you can have
at compilation time.
If you have just one error that will make all your knowledge uncompilable.
And because drools construct/build a network of nodes based on all your
knowledge you cannot have errors in one of the rules.



On Mon, May 3, 2010 at 11:10 PM, tolitius  wrote:

>
> @Puneet,
>
>Examples would be useful to understand what kind of problem you are
> having. As to
> Puneet wrote:
> > how can I detect which exact business rule is having error
>
> Check out "Debugging Rules" section of Drools documentation:
> http://bit.ly/9PRDRJ
>
> @Wolfgang,
>
>No need to be a hater Wolfgang, the question is simple. I agree,
> examples would be helpful, but that is NOT how you grow a friendly
> community.
>
>Community is the biggest problem JBoss has. Why is it so inhumanly
> difficult to be polite and considerate?
>
> /Anatoly
>
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/Rules-doubt-tp774023p775029.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
>



-- 
- 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] Rules doubt

2010-05-03 Thread tolitius

@Puneet,

Examples would be useful to understand what kind of problem you are
having. As to 
Puneet wrote:
> how can I detect which exact business rule is having error

Check out "Debugging Rules" section of Drools documentation:
http://bit.ly/9PRDRJ

@Wolfgang,

No need to be a hater Wolfgang, the question is simple. I agree,
examples would be helpful, but that is NOT how you grow a friendly
community. 

Community is the biggest problem JBoss has. Why is it so inhumanly
difficult to be polite and considerate?

/Anatoly

-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Rules-doubt-tp774023p775029.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-03 Thread Mauricio Salatino
Hi man,
can you show us your persistence.xml file where it's defined
org.drools.persistence.jpa
Persistence Unit?



2010/5/3 

>
>  Hi Mauricio, thanks for your reply
>
> I have commented the transaction , please check
> http://pastebin.com/NxQyft2t
> I put the hibernate log there too.
>
> There is no error, after the first time executed I have the tables created
> in mysql
>
> | processinstanceeventinfo   |
> | processinstanceinfo|
> | processinstanceinfo_eventtypes |
> | sessioninfo|
> | workiteminfo   |
>
> but they are empty, this is because I am not creating a process just rules
> and facts?
>
> the drools expert knowlege database persist rules and facts or this is
> maintained only in the working memory?
>
> TIA
>
>
>
>
>  -Original Message-
> From: Mauricio Salatino 
> To: Rules Users List 
> Sent: Sun, May 2, 2010 11:16 pm
> Subject: Re: [rules-users] Drools + ETL Process
>
>  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 -
>>
>> _

Re: [rules-users] Drools Flow: Workitems with the same name

2010-05-03 Thread Mauricio Salatino
Hi Anatoly,
1. Yes
2. based on the work item id it will know how to complete each of them
it's business related in my perspective, if you for example send something
to process in an external system, you will end up with workitemid related
with that process/external system. In such cases if you want to create a
mechanism decoupled from your external system, you need to keep track(build
your own mechanism) to handle that information.
add me to skype if you want to discuss about it.. we can discuss about how
to create something that works for you.
(skype: salaboy21)

On Mon, May 3, 2010 at 3:22 PM, tolitius  wrote:

>
> Hey Drools Crew,
>
>Business process can be designed to have more the one workitem ( human
> task ) with the same name. So two questions here:
>
>1. Confirming: "When registering handlers all of the workitems with
> the same name will use the same ( registered to the name ) handler?"
>
>2. What is the way for the client to identify the workitem in this
> case? Let's say there is a "truly" parallel definition:
>
>   /---> workitem1 ( async send to external
> system, waiting for completion )
>split > workitem2 ( async send to external
> system, waiting for completion )
>   \---> workitem3 ( async send to external
> system, waiting for completion )
>
>If workitem1 and workitem3 have the same name, and the response
> came back for workitem3, how do the client know to "complete" workitem3 vs.
> workitem1?
>
>Workitem IDs are completely workflow / drools-flow related, and
> when ( let's say ) approval has returned from an external system, a client
> should just tell one of the business workflow services to:
>
>completeApprovalFor( ExternalSystem.SuchAndSuch )
>
>workflow service will have a handler to a workflowInstance
> { businessId, sessionId, processInstanceId, List,
> etc.. }, so if it is a single workitem the process is waiting for, there is
> no problem, but if there are more workitems that make the process to wait +
> they may have the same name, it creates a problem.
>
>One solution (for the above specific case) would be to link external
> systems with work item ids, so instead of List< Workitems in progress >, it
> would be Map< ExternalSystem, Workitem >. But it just looks to complex and
> specific...
>
>Anything the framework can help with?
>
> Thank you,
> /Anatoly
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-Workitems-with-the-same-name-tp774182p774182.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
>



-- 
- 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] Conflict resolution strategies

2010-05-03 Thread jihedamine

Hi, 
Drools 5 uses salience and LIFO as conflict resolution strategies. 
I'd like to know what are the other strategies provided by Drools, if any (I
know we can define our own). 
Thanks.
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Conflict-resolution-strategies-tp774197p774197.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] Drools Flow: Workitems with the same name

2010-05-03 Thread tolitius

Hey Drools Crew,

Business process can be designed to have more the one workitem ( human
task ) with the same name. So two questions here:

1. Confirming: "When registering handlers all of the workitems with
the same name will use the same ( registered to the name ) handler?"

2. What is the way for the client to identify the workitem in this
case? Let's say there is a "truly" parallel definition:

   /---> workitem1 ( async send to external
system, waiting for completion )
split > workitem2 ( async send to external
system, waiting for completion )
   \---> workitem3 ( async send to external
system, waiting for completion )

If workitem1 and workitem3 have the same name, and the response
came back for workitem3, how do the client know to "complete" workitem3 vs.
workitem1?

Workitem IDs are completely workflow / drools-flow related, and
when ( let's say ) approval has returned from an external system, a client
should just tell one of the business workflow services to:

completeApprovalFor( ExternalSystem.SuchAndSuch )

workflow service will have a handler to a workflowInstance 
{ businessId, sessionId, processInstanceId, List,
etc.. }, so if it is a single workitem the process is waiting for, there is
no problem, but if there are more workitems that make the process to wait +
they may have the same name, it creates a problem.

One solution (for the above specific case) would be to link external
systems with work item ids, so instead of List< Workitems in progress >, it
would be Map< ExternalSystem, Workitem >. But it just looks to complex and
specific...

Anything the framework can help with?

Thank you,
/Anatoly
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-Workitems-with-the-same-name-tp774182p774182.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] Rules doubt

2010-05-03 Thread Wolfgang Laun
Would you please turn your screen a little more to the left and enlarge the
font so
that we can see what "mistake" you have made and what the error message is?

It would also help if we could see when this "mistake" happens.

-W


2010/5/3 Puneet duggal 

> @ friends,
>
>
> i am facing a  problem  in  my business rules and it is :-
>
>
> when i make  single  mistake in my business rule rest all rules
> stops working ,why is it so  ?  and how can i detect which exact business
> rule is having
> error
>
> thanks
> Puneet
>
> ___
> 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] Rules doubt

2010-05-03 Thread Puneet duggal
@ friends,


i am facing a  problem  in  my business rules and it is :-


when i make  single  mistake in my business rule rest all rules
stops working ,why is it so  ?  and how can i detect which exact business
rule is having
error

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


Re: [rules-users] how to move a repository from derby database to Oracle Database

2010-05-03 Thread vadlam

for some reason, the xml info within the OraclePersistenceManager tag came
out as blank in the post.

I am attaching the file this time.

Also, I changed the path to point to rep.home variable as you suggested. I
still get the same error. http://n3.nabble.com/file/n773632/repository.xml
repository.xml 
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/how-to-move-a-repository-from-derby-database-to-Oracle-Database-tp758128p773632.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] addKnowledgePackages Delay

2010-05-03 Thread Moe Alkhafaji
I got more information after debugging this. It seems like the time that
takes to load a KnowledgePackage increases as the number of KnowledgePackage
that I already have in my KnowledgeBase increases. So, my KB right now has
28 KPs, and that is when loading a new KP takes a long time. However, if I
have less KPs in my KB then loading will take much less.

What exactly happens when someone adds a new KP to an existing KB?
Considering that the KP is an already compiled set of rules. Why is this
dependent on the number of KPs in the KB? This is very frustrating because I
cannot find anything in the documentations or the historic threads on this
board. Maybe someone can shed some light on how this works behind the
scenes. Thank you.

On Mon, May 3, 2010 at 9:55 AM, Moe Alkhafaji wrote:

> Is there maybe a way to add those KnowledgePackages at startup time but
> somehow make them "hidden" and then just activate them when the KP needs to
> be available for execution and hiding it again (not available for execution)
> when they need to be unloaded?
>
> Thanks.
>
> Sent from my iPhone
>
> On May 3, 2010, at 9:36 AM, Moe Alkhafaji 
> wrote:
>
> I see. Thanks Rajnikant. I appreciate the assistance. I hope there would be
> a way to maybe make this more internal to the KnowledgeBase object itself,
> or define another object for this type of caching instead of creating this
> complexity outside. Does anyone have another approach? Or is it basically
> that everyone is "putting" up with the delays of adding a new
> KnowledgePackage to an existing KnowledgeBase? Thanks.
>
> 2010/5/3 Rajnikant Gupta < 
> capricorn@gmail.com>
>
>> As I said earlier It *may* or *may not* be relevant in your case. Usually
>> caching improves performance significantly in drools.
>>
>>  In case of our application it does so by a very significant factor.
>>
>> Regards,
>>
>> Rajnikant Gupta
>> http://rkthinks.wordpress.com/
>>
>>
>>  2010/5/3 Moe Alkhafaji < 
>> moe.alkhaf...@medcpu.com>
>>
>>>  Hmmm, so you are suggesting I keep caches all possible combinations of
>>> KnowledgePackages? If I have 100 possible KnowledgePackages and they are
>>> loaded and unloaded dynamically that means I will have to have 100 choose n
>>> where n goes from 1 to 100. That will make me go out of memory easy no?
>>>
>>> Thanks.
>>>
>>> Sent from my iPhone
>>>
>>> On May 3, 2010, at 2:07 AM, Rajnikant Gupta < 
>>> capricorn@gmail.com> wrote:
>>>
>>>   It may look something like this:
>>>
>>> Map *knowledgeBaseCacheMap* = new HashMap();
>>>
>>> this.knowledgeBase = knowledgeBaseCacheMap.get("");
>>>
>>> if(this.knowledgeBase == null){
>>>this.knowledgeBase.addKnowledgePackages(packages);
>>>*knowledgeBaseCacheMap.put("", this.knowledgeBase)*
>>> }
>>>
>>> By doing this the packages get added to the knowledgeBase only for the
>>> first time. From second request onwards you get the same knowledgeBase each
>>> time without the need for adding the packages again.
>>>
>>> But this is valid only if you are not changing your rules. If your rules
>>> are changing from time to time, you may have to look at caching at more
>>> lower levels.
>>>
>>> I am not sure whether this can be helpful in your case but this is often
>>> helpful.
>>>
>>>
>>> Regards,
>>>
>>> Rajnikant Gupta
>>>  
>>> http://rkthinks.wordpress.com/
>>>
>>>
>>>  2010/5/3 Moe Alkhafaji < 
>>> 
>>> moe.alkhaf...@medcpu.com>
>>>
  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 < 
 
 capricorn@gmail.com> 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 
 <
 moe.alkhaf...@medcpu.com> 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 represe

Re: [rules-users] Flow - handling multiple events of the same kind

2010-05-03 Thread Ed Staub


salaboy wrote:
> 
> Can you give us a use case for that situation?
> 
Sure!
The case is one where an asynchronous workitem - that is, one which doesn't
call completeWorkItem from within executeWorkItem - creates messages which
need to invoke additional business-process behavior.  These could be made to
invoke secondary processes, but there's a lot of economy in keeping their
behavior within the same process - error-handling, external aborting, and
monitoring are all a lot simpler.

-Ed

-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Flow-handling-multiple-events-of-the-same-kind-tp767773p773510.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] Flow - handling multiple events of the same kind

2010-05-03 Thread Ed Staub


salaboy wrote:
> 
> Can you give us a use case for that situation?
> 
Sure!
The case is one where an asynchronous workitem - that is, one which doesn't
call completeWorkItem from within executeWorkItem - creates messages which
need to invoke additional business-process behavior.  These could be made to
invoke secondary processes, but there's a lot of economy in keeping their
behavior within the same process - error-handling, external aborting, and
monitoring are all a lot simpler.

-Ed

-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Flow-handling-multiple-events-of-the-same-kind-tp767773p773509.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] Smooks Data Loader uses

2010-05-03 Thread JNaylies

Hi all,

I'm new in drools development and I would like toload datas with Smooks Data
Loader.
Unfortunately, I do not find a lot of example of uses.

My need is to load datas from proprietary format and i do not understand all
mechanism.

So, I would thanks you a lot to help me to find good example or good
documentation about this.

Best regards
Jérôme

Ps : sorry for my poor English 
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Smooks-Data-Loader-uses-tp773488p773488.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] addKnowledgePackages Delay

2010-05-03 Thread Moe Alkhafaji
Is there maybe a way to add those KnowledgePackages at startup time  
but somehow make them "hidden" and then just activate them when the KP  
needs to be available for execution and hiding it again (not available  
for execution) when they need to be unloaded?


Thanks.

Sent from my iPhone

On May 3, 2010, at 9:36 AM, Moe Alkhafaji   
wrote:


I see. Thanks Rajnikant. I appreciate the assistance. I hope there  
would be a way to maybe make this more internal to the KnowledgeBase  
object itself, or define another object for this type of caching  
instead of creating this complexity outside. Does anyone have  
another approach? Or is it basically that everyone is "putting" up  
with the delays of adding a new KnowledgePackage to an existing  
KnowledgeBase? Thanks.


2010/5/3 Rajnikant Gupta 
As I said earlier It may or may not be relevant in your case.  
Usually caching improves performance significantly in drools.


 In case of our application it does so by a very significant factor.

Regards,

Rajnikant Gupta
http://rkthinks.wordpress.com/


2010/5/3 Moe Alkhafaji 
Hmmm, so you are suggesting I keep caches all possible combinations  
of KnowledgePackages? If I have 100 possible KnowledgePackages and  
they are loaded and unloaded dynamically that means I will have to  
have 100 choose n where n goes from 1 to 100. That will make me go  
out of memory easy no?


Thanks.

Sent from my iPhone

On May 3, 2010, at 2:07 AM, Rajnikant Gupta  
 wrote:



It may look something like this:

Map knowledgeBaseCacheMap = new HashMap();

this.knowledgeBase = knowledgeBaseCacheMap.get("");

if(this.knowledgeBase == null){
   this.knowledgeBase.addKnowledgePackages(packages);
   knowledgeBaseCacheMap.put("", this.knowledgeBase)
}

By doing this the packages get added to the knowledgeBase only for  
the first time. From second request onwards you get the same  
knowledgeBase each time without the need for adding the packages  
again.


But this is valid only if you are not changing your rules. If your  
rules are changing from time to time, you may have to look at  
caching at more lower levels.


I am not sure whether this can be helpful in your case but this is  
often helpful.



Regards,

Rajnikant Gupta
http://rkthinks.wordpress.com/


2010/5/3 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



Re: [rules-users] addKnowledgePackages Delay

2010-05-03 Thread Moe Alkhafaji
I see. Thanks Rajnikant. I appreciate the assistance. I hope there would be
a way to maybe make this more internal to the KnowledgeBase object itself,
or define another object for this type of caching instead of creating this
complexity outside. Does anyone have another approach? Or is it basically
that everyone is "putting" up with the delays of adding a new
KnowledgePackage to an existing KnowledgeBase? Thanks.

2010/5/3 Rajnikant Gupta 

> As I said earlier It *may* or *may not* be relevant in your case. Usually
> caching improves performance significantly in drools.
>
>  In case of our application it does so by a very significant factor.
>
> Regards,
>
> Rajnikant Gupta
> http://rkthinks.wordpress.com/
>
>
> 2010/5/3 Moe Alkhafaji 
>
>>  Hmmm, so you are suggesting I keep caches all possible combinations of
>> KnowledgePackages? If I have 100 possible KnowledgePackages and they are
>> loaded and unloaded dynamically that means I will have to have 100 choose n
>> where n goes from 1 to 100. That will make me go out of memory easy no?
>>
>> Thanks.
>>
>> Sent from my iPhone
>>
>> On May 3, 2010, at 2:07 AM, Rajnikant Gupta 
>> wrote:
>>
>>   It may look something like this:
>>
>> Map *knowledgeBaseCacheMap* = new HashMap();
>>
>> this.knowledgeBase = knowledgeBaseCacheMap.get("");
>>
>> if(this.knowledgeBase == null){
>>this.knowledgeBase.addKnowledgePackages(packages);
>>*knowledgeBaseCacheMap.put("", this.knowledgeBase)*
>> }
>>
>> By doing this the packages get added to the knowledgeBase only for the
>> first time. From second request onwards you get the same knowledgeBase each
>> time without the need for adding the packages again.
>>
>> But this is valid only if you are not changing your rules. If your rules
>> are changing from time to time, you may have to look at caching at more
>> lower levels.
>>
>> I am not sure whether this can be helpful in your case but this is often
>> helpful.
>>
>>
>> Regards,
>>
>> Rajnikant Gupta
>> http://rkthinks.wordpress.com/
>>
>>
>>  2010/5/3 Moe Alkhafaji < 
>> moe.alkhaf...@medcpu.com>
>>
>>>  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 < 
>>> capricorn@gmail.com> 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 < 
>>> 
>>> moe.alkhaf...@medcpu.com> 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-t

[rules-users] Drools Flow: a few questions

2010-05-03 Thread HMandic

Hi, I have two questions regarding flow and human tasks.

First, how do you populate ActorId field in Human task at runtime?
The thing is that I don't know which users are potential owners of a task
when the process is started. Could I call a method that populates actors in
OnEntryAction of a human task? 
And could someone give me an example how to do it, maybe a code snippet?
(Not how to call a method, but how to get its result and put it in ActorId
field.)

And second, if I don't use the OnEntryAction approach, how can I access that
task before any of the potential users are inserted into it? 
A code snippet would also be greatly appreciated, something like:

ksession.getProcessInstance().getTask(someIdentifier).setActorId("user1,user2");

-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-a-few-questions-tp773385p773385.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-03 Thread andre . fonseca

 

 Hi Mauricio, thanks for your reply


 
I have commented the transaction , please check http://pastebin.com/NxQyft2t
I put the hibernate log there too.

There is no error, after the first time executed I have the tables created in 
mysql

| processinstanceeventinfo   |
| processinstanceinfo|
| processinstanceinfo_eventtypes |
| sessioninfo|
| workiteminfo   |

but they are empty, this is because I am not creating a process just rules and 
facts?

the drools expert knowlege database persist rules and facts or this is 
maintained only in the working memory?

TIA




 

-Original Message-
From: Mauricio Salatino 
To: Rules Users List 
Sent: Sun, May 2, 2010 11:16 pm
Subject: Re: [rules-users] Drools + ETL Process


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.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





-- 
 - 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] addKnowledgePackages Delay

2010-05-03 Thread Rajnikant Gupta
As I said earlier It *may* or *may not* be relevant in your case. Usually
caching improves performance significantly in drools.

 In case of our application it does so by a very significant factor.

Regards,

Rajnikant Gupta
http://rkthinks.wordpress.com/


2010/5/3 Moe Alkhafaji 

>  Hmmm, so you are suggesting I keep caches all possible combinations of
> KnowledgePackages? If I have 100 possible KnowledgePackages and they are
> loaded and unloaded dynamically that means I will have to have 100 choose n
> where n goes from 1 to 100. That will make me go out of memory easy no?
>
> Thanks.
>
> Sent from my iPhone
>
> On May 3, 2010, at 2:07 AM, Rajnikant Gupta 
> wrote:
>
>   It may look something like this:
>
> Map *knowledgeBaseCacheMap* = new HashMap();
>
> this.knowledgeBase = knowledgeBaseCacheMap.get("");
>
> if(this.knowledgeBase == null){
>this.knowledgeBase.addKnowledgePackages(packages);
>*knowledgeBaseCacheMap.put("", this.knowledgeBase)*
> }
>
> By doing this the packages get added to the knowledgeBase only for the
> first time. From second request onwards you get the same knowledgeBase each
> time without the need for adding the packages again.
>
> But this is valid only if you are not changing your rules. If your rules
> are changing from time to time, you may have to look at caching at more
> lower levels.
>
> I am not sure whether this can be helpful in your case but this is often
> helpful.
>
>
> Regards,
>
> Rajnikant Gupta
> http://rkthinks.wordpress.com/
>
>
> 2010/5/3 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 < 
>> moe.alkhaf...@medcpu.com> 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
>>
>>
>  ___
> rules-users mailing list
> rules-users@lists.jboss.org
> h

Re: [rules-users] addKnowledgePackages Delay

2010-05-03 Thread Moe Alkhafaji
Hmmm, so you are suggesting I keep caches all possible combinations of  
KnowledgePackages? If I have 100 possible KnowledgePackages and they  
are loaded and unloaded dynamically that means I will have to have 100  
choose n where n goes from 1 to 100. That will make me go out of  
memory easy no?


Thanks.

Sent from my iPhone

On May 3, 2010, at 2:07 AM, Rajnikant Gupta   
wrote:



It may look something like this:

Map knowledgeBaseCacheMap = new HashMap();

this.knowledgeBase = knowledgeBaseCacheMap.get("");

if(this.knowledgeBase == null){
   this.knowledgeBase.addKnowledgePackages(packages);
   knowledgeBaseCacheMap.put("", this.knowledgeBase)
}

By doing this the packages get added to the knowledgeBase only for  
the first time. From second request onwards you get the same  
knowledgeBase each time without the need for adding the packages  
again.


But this is valid only if you are not changing your rules. If your  
rules are changing from time to time, you may have to look at  
caching at more lower levels.


I am not sure whether this can be helpful in your case but this is  
often helpful.



Regards,

Rajnikant Gupta
http://rkthinks.wordpress.com/


2010/5/3 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


___
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] Rules "if one of element of this array has ... "

2010-05-03 Thread Maxime Terrettaz

Excuse me, I have no idea fow while I have 4 posts... 
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Rules-if-one-of-element-of-this-array-has-tp773082p773104.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] Rules "if one of element of this array has ... "

2010-05-03 Thread Maxime Terrettaz

Hi, 

I have OUL_R21 facts which have a array of OUL_R21_ORDER_OBSERVATION
objects.
OUL_R21_ORDER_OBSERVATION object has a array of OUL_R21_OBSERVATION.
OUL_R21_OBSERVATION object has a array of OUL_R21_OBSERVATION_RESULT.
And OUL_R21_OBSERVATION_RESULT has a OBX child.
I want to add the number one in my global list if one of all OBX has
abnormalFlags.value in ( 'HH', 'LL', 'AA', 'H', 'L', 'A' )

if
(OUL_21.ORDER_OBSERVATIONS[*].OBSERVATIONS[*].OBSERVATION_RESULTS[*].OBX.abnormalFlags.value
in ( 'HH', 'LL', 'AA', 'H', 'L', 'A' )){
   list.add(1);
}

Here is the rule in tring to create...

package com.xwave.drools 
import com.xwave.hapi.hl7v2.model.v24.message.OUL_R21
import com.xwave.hapi.hl7v2.model.v24.group.OUL_R21_ORDER_OBSERVATION
import com.xwave.hapi.hl7v2.model.v24.group.OUL_R21_OBSERVATION
import com.xwave.hapi.hl7v2.model.v24.group.OUL_R21_OBSERVATION_RESULT
import java.util.ArrayList
import ca.uhn.hl7v2.model.v24.segment.OBX
global java.util.List list

/* Pour le chainage de tableau, il est obligatoire de le faire étape après
étape */
rule "Get All OBX"
dialect "mvel"
when
$labMessage : OUL_R21() 
$orderObservation : OUL_R21_ORDER_OBSERVATION() from
$labMessage.ORDER_OBSERVATIONS
$observation : OUL_R21_OBSERVATION() from
$orderObservation.OBSERVATIONS 
$observationResult : OUL_R21_OBSERVATION_RESULT() from
$observation.OBSERVATION_RESULTS
$obx : OBX() from $observationResult.OBX
then 
insert($obx);
end

rule "Abnormals"
dialect "mvel"
when
$result : ArrayList(size > 0) from 
collect(OBX(abnormalFlags.value in (
'HH', 'LL', 'AA', 'H', 'L', 'A' )))
then 
System.out.println("Abnormal result : " + $result);
list.add(1);
end

Could you please tell me the solution.
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Rules-if-one-of-element-of-this-array-has-tp773082p773082.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] Rules "if one of element of this array has ... "

2010-05-03 Thread Maxime Terrettaz

Hi, 

I have OUL_R21 facts which have a array of OUL_R21_ORDER_OBSERVATION
objects.
OUL_R21_ORDER_OBSERVATION object has a array of OUL_R21_OBSERVATION.
OUL_R21_OBSERVATION object has a array of OUL_R21_OBSERVATION_RESULT.
And OUL_R21_OBSERVATION_RESULT has a OBX child.
I want to add the number one in my global list if one of all OBX has
abnormalFlags.value in ( 'HH', 'LL', 'AA', 'H', 'L', 'A' )

if
(OUL_21.ORDER_OBSERVATIONS[*].OBSERVATIONS[*].OBSERVATION_RESULTS[*].OBX.abnormalFlags.value
in ( 'HH', 'LL', 'AA', 'H', 'L', 'A' )){
   list.add(1);
}

Here is the rule in tring to create...

package com.xwave.drools 
import com.xwave.hapi.hl7v2.model.v24.message.OUL_R21
import com.xwave.hapi.hl7v2.model.v24.group.OUL_R21_ORDER_OBSERVATION
import com.xwave.hapi.hl7v2.model.v24.group.OUL_R21_OBSERVATION
import com.xwave.hapi.hl7v2.model.v24.group.OUL_R21_OBSERVATION_RESULT
import java.util.ArrayList
import ca.uhn.hl7v2.model.v24.segment.OBX
global java.util.List list

/* Pour le chainage de tableau, il est obligatoire de le faire étape après
étape */
rule "Get All OBX"
dialect "mvel"
when
$labMessage : OUL_R21() 
$orderObservation : OUL_R21_ORDER_OBSERVATION() from
$labMessage.ORDER_OBSERVATIONS
$observation : OUL_R21_OBSERVATION() from
$orderObservation.OBSERVATIONS 
$observationResult : OUL_R21_OBSERVATION_RESULT() from
$observation.OBSERVATION_RESULTS
$obx : OBX() from $observationResult.OBX
then 
insert($obx);
end

rule "Abnormals"
dialect "mvel"
when
$result : ArrayList(size > 0) from 
collect(OBX(abnormalFlags.value in (
'HH', 'LL', 'AA', 'H', 'L', 'A' )))
then 
System.out.println("Abnormal result : " + $result);
list.add(1);
end

Could you please tell me the solution.
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Rules-if-one-of-element-of-this-array-has-tp773081p773081.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] Rules "if one of element of this array has ... "

2010-05-03 Thread Maxime Terrettaz

Hi, 

I have OUL_R21 facts which have a array of OUL_R21_ORDER_OBSERVATION
objects.
OUL_R21_ORDER_OBSERVATION object has a array of OUL_R21_OBSERVATION.
OUL_R21_OBSERVATION object has a array of OUL_R21_OBSERVATION_RESULT.
And OUL_R21_OBSERVATION_RESULT has a OBX child.
I want to add the number one in my global list if one of all OBX has
abnormalFlags.value in ( 'HH', 'LL', 'AA', 'H', 'L', 'A' )

if
(OUL_21.ORDER_OBSERVATIONS[*].OBSERVATIONS[*].OBSERVATION_RESULTS[*].OBX.abnormalFlags.value
in ( 'HH', 'LL', 'AA', 'H', 'L', 'A' )) list.add(1);

Here is the rule in tring to create...

package com.xwave.drools 
import com.xwave.hapi.hl7v2.model.v24.message.OUL_R21
import com.xwave.hapi.hl7v2.model.v24.group.OUL_R21_ORDER_OBSERVATION
import com.xwave.hapi.hl7v2.model.v24.group.OUL_R21_OBSERVATION
import com.xwave.hapi.hl7v2.model.v24.group.OUL_R21_OBSERVATION_RESULT
import java.util.ArrayList
import ca.uhn.hl7v2.model.v24.segment.OBX
global java.util.List list

/* Pour le chainage de tableau, il est obligatoire de le faire étape après
étape */
rule "Get All OBX"
dialect "mvel"
when
$labMessage : OUL_R21() 
$orderObservation : OUL_R21_ORDER_OBSERVATION() from
$labMessage.ORDER_OBSERVATIONS
$observation : OUL_R21_OBSERVATION() from
$orderObservation.OBSERVATIONS 
$observationResult : OUL_R21_OBSERVATION_RESULT() from
$observation.OBSERVATION_RESULTS
$obx : OBX() from $observationResult.OBX
then 
insert($obx);
end

rule "Abnormals"
dialect "mvel"
when
$result : ArrayList(size > 0) from 
collect(OBX(abnormalFlags.value in (
'HH', 'LL', 'AA', 'H', 'L', 'A' )))
then 
System.out.println("Abnormal result : " + $result);
list.add(1);
end

Could you please tell me the solution.
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Rules-if-one-of-element-of-this-array-has-tp773080p773080.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] Rules "if one of element of this array has ... "

2010-05-03 Thread Maxime Terrettaz

Hi, 

I need to create a rule to verify is the value of a property.
I have OUL_R21 facts which have a array of OUL_R21_ORDER_OBSERVATION
objects.
OUL_R21_ORDER_OBSERVATION object has a array of OUL_R21_OBSERVATION.
OUL_R21_OBSERVATIONobject has a array of OUL_R21_OBSERVATION_RESULT.
And OUL_R21_OBSERVATION_RESULT has a OBX child.
I want to add the number one in my global list if one of all OBX has
abnormalFlags.value in ( 'HH', 'LL', 'AA', 'H', 'L', 'A' )

OUL_21.ORDER_OBSERVATIONS[].OBSERVATIONS[].OBSERVATION_RESULTS[].OBX.abnormalFlags.value
in ( 'HH', 'LL', 'AA', 'H', 'L', 'A' )

Here is the rule in tring to create...


package com.xwave.drools 
import com.xwave.hapi.hl7v2.model.v24.message.OUL_R21
import com.xwave.hapi.hl7v2.model.v24.group.OUL_R21_ORDER_OBSERVATION
import com.xwave.hapi.hl7v2.model.v24.group.OUL_R21_OBSERVATION
import com.xwave.hapi.hl7v2.model.v24.group.OUL_R21_OBSERVATION_RESULT
import java.util.ArrayList
import ca.uhn.hl7v2.model.v24.segment.OBX
global java.util.List list

/* Pour le chainage de tableau, il est obligatoire de le faire étape après
étape */
rule "Get All OBX"
dialect "mvel"
lock-on-active 
when
$labMessage : OUL_R21() 
$orderObservation : OUL_R21_ORDER_OBSERVATION() from
$labMessage.ORDER_OBSERVATIONS
$observation : OUL_R21_OBSERVATION() from
$orderObservation.OBSERVATIONS 
$observationResult : OUL_R21_OBSERVATION_RESULT() from
$observation.OBSERVATION_RESULTS
$obx : OBX() from $observationResult.OBX
then 
insert($obx);
end

rule "Anormaux"
dialect "mvel"
when
$result : ArrayList(size > 0) from 
collect(OBX(abnormalFlags.value in (
'HH', 'LL', 'AA', 'H', 'L', 'A' )))
then 
System.out.println("Résultats anormaux : " + $result);
list.add(1);
end

-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Rules-if-one-of-element-of-this-array-has-tp773073p773073.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] Problem with the Decision table

2010-05-03 Thread murphy

Do you still have the problem?

A detailed error-message would be helpful. What cannot be resolved?
Maybe your classes are not defined in the
com.rabo.bbb.rfc36877.poc.decisionTable package.

And as far as I know you have to declare all objects in the condition. So
put "event : BusinessEvent" in a condition-column and use it with
event.setEvents("$param") in the action-column.

Just take a look at the drools-examples to see how it works.
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Problem-with-the-Decision-table-tp761643p772822.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 guvnor/repository jackrabbit upgrade

2010-05-03 Thread kicho

Hi!

Thanks for your response, i'll be waiting for your changes in svn.

Cheers,
kicho
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/drools-guvnor-repository-jackrabbit-upgrade-tp762273p772676.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] addKnowledgePackages Delay

2010-05-03 Thread Rajnikant Gupta
It may look something like this:

Map *knowledgeBaseCacheMap* = new HashMap();

this.knowledgeBase = knowledgeBaseCacheMap.get("");

if(this.knowledgeBase == null){
   this.knowledgeBase.addKnowledgePackages(packages);
   *knowledgeBaseCacheMap.put("", this.knowledgeBase)*
}

By doing this the packages get added to the knowledgeBase only for the first
time. From second request onwards you get the same knowledgeBase each time
without the need for adding the packages again.

But this is valid only if you are not changing your rules. If your rules are
changing from time to time, you may have to look at caching at more lower
levels.

I am not sure whether this can be helpful in your case but this is often
helpful.


Regards,

Rajnikant Gupta
http://rkthinks.wordpress.com/


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