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

2012-02-24 Thread Leonardo Gomes
Hi Michael,

Do you have a link to the Fluent API documentation? I wanted to answer to
this question and couldn't find the link anywhere.

Thanks,
Leo.

2012/2/24 Michael Anstis michael.ans...@gmail.com

 Yes.

 If the data defines the rules then there are numerous options:-

- Construct a DRL String yourself and pass this to a KnowledgeBuilder
- Use the fluent API to build rules programmatically
- Construct an XLS decision table using your favourite XLS (Java) API
and look at drools-decisiontables
- Construct a Guvnor decision table using classes in
droolsjbpm-ide-common (bundled with Guvnor)

 If the data is to be plugged into place-holders in statically defined
 rules:-

- Look at the use of Drools Expert Templates

 Decision tables do not lend themselves well to OR as there is an
 implicit AND between columns.

 There might be other solutions, these are those that came readily to mind.

 With kind regards,

 Mike


 On 24 February 2012 14:31, shawn youngxiao...@hotmail.com wrote:

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


 --
 View this message in context:
 http://drools.46999.n3.nabble.com/How-to-create-a-drl-file-or-decision-table-dynamically-tp3772708p3772708.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users



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


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


Re: [rules-users] CPU Spike creating a StatefulKnowledgeSession using OSGi

2012-01-11 Thread Leonardo Gomes
I'm not sure which version he's using, but there were already some fixes
around this on 5.2 and/or 5.3, done by Surdilovic, if I recall well..

I've applied the same sort of approach here, but haven't proposed a pull
request, because I didn't have time to check if it was already fixed on 5.4:
https://github.com/leogomes/drools-compiler/commit/e42e3480c4c6a0a0cbfe5f3d198ec493ecf45035

However, the problem of looking up excessively the classpath, specially in
cases where we will never find what we are looking for, remains for the
compilation step. Other than an OSGI environment, you can notice it also
while running on Weblogic 11g with a lot of stuff on your classpath. I
tried to start a thread to discuss that on the dev's list sometime ago:

http://drools.46999.n3.nabble.com/Rules-compilation-and-unnecessary-attempts-to-getResourceAsStream-td3481614.html

Cheers,
Leo.



2010/8/10 Mark Proctor mproc...@codehaus.org

 **
 On 10/08/2010 17:22, David Conde wrote:

 Hi Pavel,

  I've changed it over to use a stateless session and I'm seeing the
 same behavior. I've done some debugging and it seems to be very slow
 loading up the SessionConfiguration due to all of the loading that happens
 in ChainedProperties.

 it could well be that.

 When looking for property we search the available classpaths. With OSGi
 you have to add a lot of classpaths to it, so it searches them all...

 Other than telling it not to search the classpath for .properties files,
 not sure what else we can do here...

 Mark


  Thanks,
 Dave

 On 10 August 2010 13:53, Pavel Tavoda pavel.tav...@gmail.com wrote:

 Interesting. Normally it should be fast. Try to change your patter and
 load binary compiled serialized package from disk. You can find it in
 documentation.
 Also consider using stateless session. Do you really need stateful
 session?

 Pavel

 2010/8/9 David Conde dco...@calomtech.com:
  Is it possible that this might be invoking the compiler when a session
 is
  created? I have all of the init code in the service start call and
 stored as
  members of the service for reuse but I must create a new knowledge
 session
  for each run.
  Any ideas?
  Thanks,
  Dave
 
  -- Forwarded message --
  From: David Conde dco...@calomtech.com
  Date: 9 August 2010 11:17
  Subject: Re: [rules-users] CPU Spike creating a StatefulKnowledgeSession
  using OSGi
  To: Rules Users List rules-users@lists.jboss.org
 
 
  The line that it spikes on is StatefulKnowledgeSession ksession =
  kbase.newStatefulKnowledgeSession();.
  Cheers,
  Dave
 
  On 9 August 2010 11:09, Pavel Tavoda pavel.tav...@gmail.com wrote:
 
  Is it session creation or rule compilation?
 
  Pavel
 
  2010/8/9 David Conde dco...@calomtech.com:
   Good Morning,
   I now have drools running on the Spring DM-Server but I am seeing a
 CPU
   spike when creating a StatefulKnowledgeSession. I've tested this
 outside
   of
   an OSGi environment and I don't see the spike. Does anyone know any
   settings
   that I can change that might make this go away?
   Thanks,
   Dave
  
   --
   David Conde
   CTO Calom Technologies
  
  
   ___
   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 
 listrules-users@lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/rules-users



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


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


Re: [rules-users] Integration of drools with webapplication (Servlet)

2011-12-22 Thread Leonardo Gomes
You can have a look here:
https://github.com/leogomes/raul-analyzer
and here:
https://github.com/leogomes/analyzer-web

It's nothing serious, but something I was playing with sometime ago to demo
some ideas. I can't provide any support, but it's very simple. A servlet
that calls drools to analyze some mocked data (you'll see some objects
being created with mockito there).

Cheers,
Leo.

On Thu, Dec 22, 2011 at 1:29 PM, srinivasasanda srinivasasa...@gmail.comwrote:

 Hi All,

 Please any one can provide me the code to integrate with web application

 please provide me some link...

 Thanks in Advance
 Thank u...

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Integration-of-drools-with-webapplication-Servlet-tp3606467p3606467.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

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


[rules-users] Guvnor: Embed Asset’s Editor in your application

2011-08-02 Thread Leonardo Gomes
I was reading this nice article from the plugtree guys:
http://www.plugtree.com/guvnor-embed-asset%E2%80%99s-editor-in-your-application/

and was wondering if there's a light-weight version of Guvnor that I could
use if I'm only interested in the BRL edition mode, that is, if I don't want
to worry about rules persistence using Guvnor, etc.

If not, how difficult do you think it would be to put up something that
would allow me to run the decision table in BRL edition mode by doing
something as simple as *mvn tomcat:tomcat*, for example?

Cheers!

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


Re: [rules-users] drools-ant

2011-06-15 Thread Leonardo Gomes
Hi,

You can have a look at this thread for a maven alternative:
http://drools.46999.n3.nabble.com/maven-drools-plugin-to-compile-DRL-s-at-build-time-td725751.html

Cheers,
Leo.

2011/6/13 Abhay B. Chaware abhay.chaw...@kpitcummins.com

  How do I compile only rule (.drl) files into packages ?   I read that
 drools-ant can be used to compile rules, but not getting any information
 about using the drools-ant. How do I use drools-ant ?  Is that the only way
 to compile rules ? Any other options ?



 -abhay



 This message contains information that may be privileged or confidential
 and is the property of the KPIT Cummins Infosystems Ltd. It is intended only
 for the person to whom it is addressed. If you are not the intended
 recipient, you are not authorized to read, print, retain copy, disseminate,
 distribute, or use this message or any part thereof. If you receive this
 message in error, please notify the sender immediately and delete all copies
 of this message. KPIT Cummins Infosystems Ltd. does not accept any liability
 for virus infected mails.

 ___
 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] drools dynamic LHS

2011-05-24 Thread Leonardo Gomes
You can have a fact that stores those values:

rule Check Age
   when
   Context($ageLimit : age)
   Person(age  $ageLimit)
   then
 do something...
end

On Tue, May 24, 2011 at 6:33 PM, marunam suta...@gmail.com wrote:

 Hello,

 I have a question about having dynamic LHS in drool rules. Below is what I
 am looking for

 rule Check Age
when
Person(age  24)
then
  do something...
 end

 What is the best way to keep the actual fact data dynamic(i.e. 24 in this
 case) and how do I feed it do drools
 This is very simple rule and the only fact value(hardcoded) that I have is
 24. I may have complex rules in which I could have many fact values for
 different attributes. I am looking for a solution where I don't hard code
 any value in the rule

 Thank you for looking into this and your response


 --
 View this message in context:
 http://drools.46999.n3.nabble.com/drools-dynamic-LHS-tp2980536p2980536.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

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


Re: [rules-users] drools dynamic LHS

2011-05-24 Thread Leonardo Gomes
The Context fact I mentioned would be populated with values coming from a DB
or properties file. At runtime you can read the right properties file,
create a Context object and feed the working memory with it plus all the
other regular facts you already have. With this you achieve the
parametrization you're looking for, and there's no need to change code for
that.

Another approach is the one described by Ansgar with different DRLs. Both
would work, you just need to make up your mind :)

On Tue, May 24, 2011 at 9:17 PM, marunam suta...@gmail.com wrote:

 I understand that fact could store the values but my question more towards
 how to design this for dynamic number of facts. Let's say, if the business
 want to modify the rules with more fact values, I want to be able to happen
 this dynamically rather than changing the code for fact values and adding
 it
 there.

 I was thinking more toward having a property file(database??) and program
 reads those dynamic values and prepares fact model before running the rules

 Thoughts??

 Thanks

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/drools-dynamic-LHS-tp2980536p2981145.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

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


Re: [rules-users] Expected relative performance of 5.2

2011-05-23 Thread Leonardo Gomes
Hi Nathan,

In you system, do all rules fire most of the time, or is it the type of
system where only some of the rules fire each time you create a session?
We've recently introduced a feature that should improve performance, if it's
the latter. You would need to get the latest snapshot for 5.2 from our
repository and configure you rule base to activate it. It's described here:
http://blog.athico.com/2011/05/left-right-unlinking-first-steps.html

If you could provide some feedback, it would be very much appreciated.

Thanks,
Leonardo.


2011/5/23 Mark Proctor mproc...@codehaus.org

  On 23/05/2011 00:06, Nathan Bell wrote:

  I have a general question about the expected performance of 5.2. In a
 system with many facts and many rules what is the expected performance of
 5.2 compared to 5.1. In terms of speed is it expected to perform the same,
 better, or worse? And in terms of memory usage is it expected to be the
 same, better, or worse? I’m asking because I’m trying to decide how quickly
 to switch to 5.2 when it is officially released. If there are performance
 gains to be had I’ll want to move to it more quickly.

 It should be better marginally better on performance and memory. The only
 exception to this is usage of 'from', which now attempts to preserve state
 changes on modifications, which is heavier

 Mark



 Thanks,



 Nathan Bell


 ___
 rules-users mailing 
 listrules-users@lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/rules-users



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


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


Re: [rules-users] change of Rules Dyanmically

2011-05-23 Thread Leonardo Gomes
It will help if you share some code with us (java + drls).

Cheers,
Leo

On Fri, May 20, 2011 at 6:36 AM, Saurabh maheshwari.saurab...@gmail.comwrote:

 Hi mark ,

 Currently i am doing like that

 I am changing the drl file at runtime .
 I get all the Objects from memory into one collection , and reinsert that
 with new session .

 but i am facing two problems :

 1- First problem is that it will refire for already fired Object
 2- if my fact class is changed the earlier Objects are useless.


 am i doing in right manner , or there is another way of doing that .
 Plz help ..

 Thanks ,

 Saurabh



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/rules-users-change-of-Rules-Dyanmically-tp2960225p2964338.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

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


Re: [rules-users] viewing working memory

2011-05-23 Thread Leonardo Gomes
The audit works fine for me with stateless sessions. Did you tried the
WorkingMemoryFileLogger
?

Leo.

2011/5/23 Hezi Stern he...@delegatecom.com

 I am working with stateless session (Drools 5.1.1) and I wish to view the
 objects in the working memory (debug purposes)

 I understand that in stateless session the audit does not work (not working
 for me, on breakpoint I get the message “the selected working memory is
 empty” ).



 How can I view in breakpoint (or print in runtime) the working memory?



 Regards,

 Hezi



 ___
 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] Use of StatelessKnowledgeSession

2011-05-17 Thread Leonardo Gomes
Inserting new facts in the THEN clause (RHS) is possible in a stateless
session (except if you set it to run in sequential mode). You can also
create rules' conditions that operate on those inferred facts.

To get them back as results, you can either bind a global variable and add
the results to it or use:

org.drools.StatelessSession#
StatelessSessionResult executeWithResults(Collection collection);

Cheers,
Leo.



2011/5/17 Greg Stasica gstas...@pacemetrics.com

  hi,
 you can't use stateless session for your problem.


 http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html/ch02.html#d0e254
 A stateless session can be called like a function passing it some data
 and then receiving some results back

 the way i understand ...receiving some results back part is that facts
 can be updated (you can call methods on them) but inserting any new facts
 into session in WHEN section is not possible



 On 06/05/2011 20:05, Dean Whisnant wrote:

 This is not an answer to your question, but rather asking the same question 
 with a slight twist:

 I'm in the middle of trying to see if I can shift from stateful to stateless 
 in my project and the session.getObjects method is what we would use in 
 stateful as well to read back all of the new objects created during rules 
 execution.  My project seems to be much more geared towards stateless and 
 thus far testing has shown our time would benefit significantly from the 
 change.

 I see in the docs where ExecutionResults are used with the execute:

   ExecutionResults results = 
 ksession.execute(CommandFactory.newBatchExecution( cmds) );

 But even within results I do not see how to gather my objects from memory.

 Any thoughts on what I am missing here?

 Thanks

 Dean

 -Original Message-
 From: rules-users-boun...@lists.jboss.org 
 [mailto:rules-users-boun...@lists.jboss.org 
 rules-users-boun...@lists.jboss.org] On Behalf Of aminmc
 Sent: Saturday, April 16, 2011 2:31 PM
 To: rules-users@lists.jboss.org
 Subject: [rules-users] Use of StatelessKnowledgeSession

 Hi there

 I was wondering if someone might be able to help with what I am trying to do. 
  I have the following rule definition:

 rule open work item
 when
 Task ( status == OPEN)
 then
   insert(new Action(Take,take_task));
   insert(new Action(Complete,complete_task));
   insert(new Action(Close,close_task));

 end

 Basically I want to insert a Task and then get back a list of Actions that 
 are available for the Task (based on the status.  I have this working with a 
 statefulknowledgesession with the code:

  ListCommand commands = new ArrayListCommand();
 for (Task task : tasks) {
 commands.add(CommandFactory.newInsert(task));
 }
 session.execute(CommandFactory.newBatchExecution(commands));
 session.fireAllRules();
 session.dispose();

//this returns the actions
Collection objects = session.getObjects(new 
 ClassObjectFilter(Action.class));

 I was wondering whether it is possible to do this with a 
 statelessknowledgesession instead?  I could'nt see how to achieve this 
 without updating the task to include the actions.

 Any help would be appreciated.

 Cheers

 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/Use-of-StatelessKnowledgeSession-tp2828548p2828548.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing 
 listrules-users@lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/rules-users

 ___
 rules-users mailing 
 listrules-users@lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/rules-users


 --
 Greg Stasica

 PaceMetrics Ltd.
 T  +353 1 8849921

 PaceMetrics Limited is registered in Ireland as a private company limited by 
 shares, Registration  No.  298243,  Registered office:  PaceMetrics House, 
 East Point Business Park, Dublin 3. This e-mail may contain confidential, 
 proprietary or privileged information. If you are not the intended recipient 
 (or have received this e-mail in error) please destroy this e-mail and notify 
 the sender immediately by telephoning +353 1 8184000. Any unauthorized 
 copying, disclosure or distribution of the material in this e-mail is 
 strictly forbidden.


 ___
 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] FW: typical rules application

2011-05-16 Thread Leonardo Gomes
You might want to read this article:
http://herzberg.ca.sandia.gov/guidelines.shtml


2011/5/16 Abhay B. Chaware abhay.chaw...@kpitcummins.com

  Anyone ?
  --

 *From:* Abhay B. Chaware
 *Sent:* Friday, May 13, 2011 6:17 PM
 *To:* 'Rules Users List'
 *Subject:* typical rules application



 Hi

 I am just trying to get a feel of size of a typical rules application. How
 many low-to-medium complex rules a typical rules application will have ? I
 understand and agree that it totally depends upon the application and
 business needs, but I am trying to get a feel of if rules is the correct
 solution to a problem and if that can be determined by number of rules.

 e.g.

 if to satisfy a business need, I wrote a rules application and ended up
 writing say 20 medium-complex rules and in another case, I wrote a rules
 application and ended up writing say 10,000 low/medium complex rules

 which one of these two cases sound like real, logical candidate for a rules
 based app  and why ?  Is there a rule of thumb, that “x” number of rules is
 a good number for an application to qualify under rules technology ?



 -abhay

 This message contains information that may be privileged or confidential
 and is the property of the KPIT Cummins Infosystems Ltd. It is intended only
 for the person to whom it is addressed. If you are not the intended
 recipient, you are not authorized to read, print, retain copy, disseminate,
 distribute, or use this message or any part thereof. If you receive this
 message in error, please notify the sender immediately and delete all copies
 of this message. KPIT Cummins Infosystems Ltd. does not accept any liability
 for virus infected mails.

 ___
 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] Fw: Regarding Drools - Expert and Fusion

2011-05-05 Thread Leonardo Gomes
Old articles, but that should give you an idea regarding architecture:
http://www.infoq.com/articles/Rule-Engines

If you want to have a better and up-to-date view, you should probably have a
look at Bali's book:
http://www.amazon.com/Drools-JBoss-Rules-Developers-Guide/dp/1847195644/ref=pd_bxgy_b_img_b

Cheers,
Leo.

On Thu, May 5, 2011 at 11:22 AM, Sumeet Karawal sumeet.kara...@tcs.comwrote:

 Thanks a lot Mike for the help.

 Regards,
 Sumeet Karawal

 Mailto: sumeet.kara...@tcs.com



   From:   Michael Anstis michael.ans...@gmail.com

  To: Rules Users List rules-users@lists.jboss.org

  Date:   05/04/2011 04:03 PM

  Subject:Re: [rules-users] Fw: Regarding Drools - Expert and Fusion

  Sent by:rules-users-boun...@lists.jboss.org






 I don't know of any such links.

 Fusion depends upon Expert so they must coexist if you are to use Fusion.

 Fusion is really the CEP aspect of Expert, I don't believe it possible to
 install Expert without Fusion's extensions.

 An event based system would be one where you need to make temporal
 decisions relating to your facts; e.g. there have been 3 alarms in the last
 5 minutes etc.

 Such a system would still use rules; however they would have temporal
 constraints.

 With kind regards,

 Mike

 On 4 May 2011 11:20, Sumeet Karawal sumeet.kara...@tcs.com wrote:

  Hi ,

  I had posted this earlier :

   Could somebody please let me know about any link or document for Best
  Practices regarding JBoss Rules(Expert) and Fusion.
   Also any link or document regarding Technical Architecture of JBoss
  Rules
  (Expert) and JBoss Fusion Stack. 

  Also I have a query as how can Drools - Expert and Fusion coexist in an
  Application.  I have just started learning about Drools Fusion.
   What can qualify to go as a event driven system as opposed to rules
   based system ?

  It would be very helpful if somebody could let me know about the few
  things.

  Thanks  Regards,
  Sumeet Karawal
  Mailto: sumeet.kara...@tcs.com






   From:   Sumeet Karawal/MUM/TCS

   To: rules-users@lists.jboss.org

   Date:   05/03/2011 07:09 PM

   Subject:Regarding Drools - Expert and Fusion





  Hi,

   Could somebody please let me know about any link or document for Best
  Practices regarding JBoss Rules(Expert) and Fusion.
   Also any link or document regarding Technical Architecture of JBoss
  Rules
  (Expert) and JBoss Fusion Stack.

  Thanks  Regards,
  Sumeet Karawal

  Mailto: sumeet.kara...@tcs.com


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



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


Re: [rules-users] Memory issue with drools (using 10000 rules)

2011-04-27 Thread Leonardo Gomes
http://drools.46999.n3.nabble.com/maven-drools-plugin-to-compile-DRL-s-at-build-time-td725751.html

2011/4/27 Geoffrey De Smet ge0ffrey.s...@gmail.com

  there's a maven-drools-plugin out there in the wild to precompile your
 rules.

 Op 27-04-11 04:27, Edson Tirelli schreef:


 Besides all suggestions already made in other e-mails, it is also worth
 considering if you can pre-compile rules and just load them at runtime
 instead of compiling them at runtime.

 I.e, the method:

  knowledgeBuilder.add(resource, ResourceType.DRL);

 Will call the JDT compiler to compile your rules and that uses quite a
 lot of memory that is later disposed. Instead, you could compile the
 knowledge base at build time and serialize it, and at runtime all you do is
 deserialize you kbase and use it, saving the memory that was previously used
 for compilation.

 Edson



 2011/4/26 Shebs, Liron liron.sh...@hp.com

  Hello All,



 I’m working at HP Software RD and we are considering using drools in our
 product.

 Benchmarking tests showed that running 10,000 rules consumes 382mb.

 This is too high for our system requirements, and we would like to know
 how we can improve it.

 Technical details:

 -  Drools version: 5.1 with default configuration.

 -  All rules look like this:



 rule status-Fixed-Open

when

  event : FieldChangedEvent(fieldName ==
 status, oldValue == Fixed);

  entity : Entity(entityType == mock-entity);

  eval(((String)
 entity.getFieldValue(status)).equals(Open));

then

   do Something…

 end



 -  Loading code:



 KnowledgeBuilder knowledgeBuilder =
 KnowledgeBuilderFactory.newKnowledgeBuilder();

 for(all resources)

 {

 knowledgeBuilder.add(resource, ResourceType.DRL);

 }

 knowledgeBase = KnowledgeBaseFactory.newKnowledgeBase();


 knowledgeBase.addKnowledgePackages(knowledgeBuilder.getKnowledgePackages());



 Any insights are most appreciated.



 Thank You,

 Liron, HP Software RD







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




 --
   Edson Tirelli
   JBoss Drools Core Development
   JBoss by Red Hat @ www.jboss.com


 ___
 rules-users mailing 
 listrules-users@lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/rules-users


 --
 With kind regards,
 Geoffrey De Smet


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


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


Re: [rules-users] Memory issue with drools (using 10000 rules)

2011-04-27 Thread Leonardo Gomes
Hi Liron,

Are you planning on using a stateful or a stateless session afterwards? Do
you have the memory numbers for rules execution? How many facts?

-Leonardo.

2011/4/27 Shebs, Liron liron.sh...@hp.com

 Hi All,



 Thank you all for your responses and ideas.



 Here are some answers to questions raised by you

 · 10,000 rules is what we estimate a real system will contain.

 · The rules are similar to each other on the testing environment,
 but in the real system we expect more variance, making parameterized rules
 difficult to implement.

 · Measurements of memory consumption where done after the rules
 loading was completed + GC, so I’m sure pre-compiling will help.

 · When I say memory consumption I mean memory footprint
 (production memory).

 · Removing “eval” from the rules saved ~80mb (10,000 rules, same
 environment).



 Mark, reading all these clarifications, does 30kb per rule sound
 reasonable? Do you think that we can improve this number somehow?



 Thank you,

 -- Liron



 *From:* rules-users-boun...@lists.jboss.org [mailto:
 rules-users-boun...@lists.jboss.org] *On Behalf Of *Leonardo Gomes
 *Sent:* Wednesday, April 27, 2011 12:10 PM
 *To:* Rules Users List
 *Subject:* Re: [rules-users] Memory issue with drools (using 1 rules)




 http://drools.46999.n3.nabble.com/maven-drools-plugin-to-compile-DRL-s-at-build-time-td725751.html

 2011/4/27 Geoffrey De Smet ge0ffrey.s...@gmail.com

 there's a maven-drools-plugin out there in the wild to precompile your
 rules.

 Op 27-04-11 04:27, Edson Tirelli schreef:



Besides all suggestions already made in other e-mails, it is also worth
 considering if you can pre-compile rules and just load them at runtime
 instead of compiling them at runtime.



I.e, the method:



 knowledgeBuilder.add(resource, ResourceType.DRL);



Will call the JDT compiler to compile your rules and that uses quite a
 lot of memory that is later disposed. Instead, you could compile the
 knowledge base at build time and serialize it, and at runtime all you do is
 deserialize you kbase and use it, saving the memory that was previously used
 for compilation.



Edson







 2011/4/26 Shebs, Liron liron.sh...@hp.com

 Hello All,



 I’m working at HP Software RD and we are considering using drools in our
 product.

 Benchmarking tests showed that running 10,000 rules consumes 382mb.

 This is too high for our system requirements, and we would like to know how
 we can improve it.

 Technical details:

 -  Drools version: 5.1 with default configuration.

 -  All rules look like this:



 rule status-Fixed-Open

when

  event : FieldChangedEvent(fieldName ==
 status, oldValue == Fixed);

  entity : Entity(entityType == mock-entity);

  eval(((String)
 entity.getFieldValue(status)).equals(Open));

then

   do Something…

 end



 -  Loading code:



 KnowledgeBuilder knowledgeBuilder =
 KnowledgeBuilderFactory.newKnowledgeBuilder();

 for(all resources)

 {

 knowledgeBuilder.add(resource, ResourceType.DRL);

 }

 knowledgeBase = KnowledgeBaseFactory.newKnowledgeBase();


 knowledgeBase.addKnowledgePackages(knowledgeBuilder.getKnowledgePackages());



 Any insights are most appreciated.



 Thank You,

 Liron, HP Software RD








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




 --
   Edson Tirelli
   JBoss Drools Core Development
   JBoss by Red Hat @ www.jboss.com



 ___

 rules-users mailing list

 rules-users@lists.jboss.org

 https://lists.jboss.org/mailman/listinfo/rules-users



 --

 With kind regards,

 Geoffrey De Smet


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



 ___
 rules-users 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] Memory issue with drools (using 10000 rules)

2011-04-26 Thread Leonardo Gomes
Your eval, you could probably replace by something like this:


rule status-Fixed-Open

   when

 event : FieldChangedEvent(fieldName ==
status, oldValue == Fixed);

 entity : Entity(entityType == mock-entity,
field == status, value == Open);

   then

  do Something…

end





2011/4/26 Shebs, Liron liron.sh...@hp.com

 Hello All,



 I’m working at HP Software RD and we are considering using drools in our
 product.

 Benchmarking tests showed that running 10,000 rules consumes 382mb.

 This is too high for our system requirements, and we would like to know how
 we can improve it.

 Technical details:

 -  Drools version: 5.1 with default configuration.

 -  All rules look like this:



 rule status-Fixed-Open

when

  event : FieldChangedEvent(fieldName ==
 status, oldValue == Fixed);

  entity : Entity(entityType == mock-entity);

  eval(((String)
 entity.getFieldValue(status)).equals(Open));

then

   do Something…

 end



 -  Loading code:



 KnowledgeBuilder knowledgeBuilder =
 KnowledgeBuilderFactory.newKnowledgeBuilder();

 for(all resources)

 {

 knowledgeBuilder.add(resource, ResourceType.DRL);

 }

 knowledgeBase = KnowledgeBaseFactory.newKnowledgeBase();


 knowledgeBase.addKnowledgePackages(knowledgeBuilder.getKnowledgePackages());



 Any insights are most appreciated.



 Thank You,

 Liron, HP Software RD







 ___
 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] Memory issue with drools (using 10000 rules)

2011-04-26 Thread Leonardo Gomes

 Benchmarking tests showed that running 10,000 rules consumes 382mb.


Are you talking about the memory footprint of your KnowledgeBase when you
load it or is after the insertion of facts / execution of rules?

Do you have any more detailed profiling information to share with us? We
might be able to help with some experimental features if you provide more
details.



On Tue, Apr 26, 2011 at 6:16 PM, Leonardo Gomes
leonardo.f.go...@gmail.comwrote:

 Your eval, you could probably replace by something like this:


 rule status-Fixed-Open

when

  event : FieldChangedEvent(fieldName ==
 status, oldValue == Fixed);

  entity : Entity(entityType == mock-entity,
 field == status, value == Open);

then

   do Something…

 end





 2011/4/26 Shebs, Liron liron.sh...@hp.com

  Hello All,



 I’m working at HP Software RD and we are considering using drools in our
 product.

 Benchmarking tests showed that running 10,000 rules consumes 382mb.

 This is too high for our system requirements, and we would like to know
 how we can improve it.

 Technical details:

 -  Drools version: 5.1 with default configuration.

 -  All rules look like this:



 rule status-Fixed-Open

when

  event : FieldChangedEvent(fieldName ==
 status, oldValue == Fixed);

  entity : Entity(entityType == mock-entity);

  eval(((String)
 entity.getFieldValue(status)).equals(Open));

then

   do Something…

 end



 -  Loading code:



 KnowledgeBuilder knowledgeBuilder =
 KnowledgeBuilderFactory.newKnowledgeBuilder();

 for(all resources)

 {

 knowledgeBuilder.add(resource, ResourceType.DRL);

 }

 knowledgeBase = KnowledgeBaseFactory.newKnowledgeBase();


 knowledgeBase.addKnowledgePackages(knowledgeBuilder.getKnowledgePackages());



 Any insights are most appreciated.



 Thank You,

 Liron, HP Software RD







 ___
 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] Problem in DSL with Type constraints

2011-03-31 Thread Leonardo Gomes
Hi,

Given the following DSL definition:

[condition][RestrictedLocation]Is restricted by = ArrayList(size = 1) from
 collect(RestrictedLocation() from $restrictedLocationList)
 [condition][RestrictedLocation]- test=$test : test


and the following rule:

rule Test
 when
 Is restricted by
 - test
 then
 ...
 end


I'm getting the following DRL:


rule Test
 when
 ArrayList(size = 1) from collect( RestrictedLocation*(, $test : test
 ) *from $restrictedLocationList)
 then
 ...
 end


Note the comma before the restriction: ** (, **

Anyone would know how to fix that?

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


Re: [rules-users] Problem in DSL with Type constraints

2011-03-31 Thread Leonardo Gomes
Small correction.

This: [condition][RestrictedLocation]- test=$test : test

should actually be:

 [condition][RestrictedLocation]- test=$test == test


but I still have the problem :)


On Thu, Mar 31, 2011 at 6:02 PM, Leonardo Gomes
leonardo.f.go...@gmail.comwrote:

 Hi,

 Given the following DSL definition:

 [condition][RestrictedLocation]Is restricted by = ArrayList(size = 1) from
 collect(RestrictedLocation() from $restrictedLocationList)
 [condition][RestrictedLocation]- test=$test : test


 and the following rule:

 rule Test
 when
 Is restricted by
 - test
 then
 ...
 end


 I'm getting the following DRL:


 rule Test
 when
 ArrayList(size = 1) from collect( RestrictedLocation*(, $test : test
 ) *from $restrictedLocationList)
 then
 ...
 end


 Note the comma before the restriction: ** (, **

 Anyone would know how to fix that?

 Thanks a lot,
 Leonardo.


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


Re: [rules-users] execute Rules selectively

2011-03-25 Thread Leonardo Gomes
Hi Benson,

What exactly do you want to achieve? You want to execute rules in parallel?



On Fri, Mar 25, 2011 at 2:08 AM, Benson Fung benson.red...@gmail.comwrote:

 Hi,

 I have setup about 10 rules in the rulebase.  Can you tell me how I
 can execute more than one specific rule at the same time?  Please help


 Thanks
 Benson
 ___
 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] Misunderstanding salience?

2011-03-11 Thread Leonardo Gomes
I didn't actually read through all of the thread, but it sounds to me that
you're looking for drools.halt(), which is something that you can actually
call from the consequence part of your rules.

2011/3/9 Peter Ashford pet...@bestpractice.org.nz

 Ok, thanks.   I can see how asserting a control fact would work here – I
 only asked about a terminate option to be able to avoid having to check for
 the absence of the control fact in every rule, but that’s fine if that’s
 what I have to do.



 Thank s everyone for the help – it’s been excellent and very instructive
 :o)



 p.s.: No, I don’t use RuleFlow or jBPM.  We’re writing DRL’s by hand and
 it’s our expectation that we will have clinical content experts using Guvnor
 to author rules once we’ve got our new system up and running.  At this point
 I’m just trying to establish what best practice for our domain ought to be.



 Peter.



 *From:* rules-users-boun...@lists.jboss.org [mailto:
 rules-users-boun...@lists.jboss.org] *On Behalf Of *Michael Anstis
 *Sent:* Thursday, 10 March 2011 10:45 a.m.

 *To:* Rules Users List
 *Subject:* Re: [rules-users] Misunderstanding salience?



 I don't suppose you (Peter) use RuleFlow or jBPM?

 If not then remember rules' patterns are matched as facts are inserted into
 WM. The resulting activations are ordered by controlling semantics such as
 salience, no-loop, lock-on-active etc. Therefore should higher salience
 rules activations (that will be executed first) alter the state of WM lower
 salience rules' activations could be removed (by the presence of the control
 fact or non-null advice depending on what approach you take) and hence not
 be candidate for execution.

 This is why, IMO, people talk about considering all rules executing in
 parallel rather than sequentially.

 If you're using jBPM then fail-fast is an option, but not something I know
 much about.

 Cheers,

 Mike

 2011/3/9 Greg Barton greg_bar...@yahoo.com

 Control facts is a term for objects in working memory that are not
 directly derived from outside data, or used as output.  As their name
 implies, they're used to explicitly control flow of the rules.

 --- On *Wed, 3/9/11, Peter Ashford pet...@bestpractice.org.nz* wrote:


 From: Peter Ashford pet...@bestpractice.org.nz


 Subject: Re: [rules-users] Misunderstanding salience?

 To: Rules Users List rules-users@lists.jboss.org
 Date: Wednesday, March 9, 2011, 2:54 PM



 Working with Zombies?  No... although some of our clients



 A wrinkle we have is that sometimes an exception case should terminate the
 decision.  Usually that’s an emergency case and it will be something like
 “this patient needs to be admitted to hospital immediately”.  In other
 cases, we want to provide some advice which a clinician may or may not
 choose to heed. It sounds to me that the insertLogical mechanism might well
 work for those latter cases (was this what you were referring to when you
 talked about ‘control facts’?)  In the other case – an emergency when you
 need to give one element of critical advice then quit – is there an option
 to terminate the rules immediately and return the current result?



 Peter





 *From:* rules-users-boun...@lists.jboss.org [mailto:
 rules-users-boun...@lists.jboss.org] *On Behalf Of *Swindells, Thomas
 *Sent:* Wednesday, 9 March 2011 10:23 p.m.
 *To:* Rules Users List
 *Subject:* Re: [rules-users] Misunderstanding salience?



 I don’t think you even need it that complicated.

 Just have your constraints in the form

 Patient(advice == null, ...)



 This assumes you only give the patient one advice at a time – if not
 control facts would have to be the way to go.



 You also need to make sure you actually tell the rule engine you have
 modified the patient when you set their advice – you need to wrap the call
 with a modify(p) {...}.



 Hope you get your zombies under control soon,



 Thomas



 *From:* rules-users-boun...@lists.jboss.org [mailto:
 rules-users-boun...@lists.jboss.org] *On Behalf Of *Michael Anstis
 *Sent:* 09 March 2011 07:58
 *To:* Rules Users List
 *Subject:* Re: [rules-users] Misunderstanding salience?



 You had me fooled Peter, I thought you worked in a zombie related field ;-)

 Control Facts can also be used, which I think David eluded to with his use
 of null advice, such that:-

 *rule* General brain eating advice

*when*

   p : Patient(eatsBrains == *true*)

  not Diagnosis( patient == $p )

*then*

   p.setAdvice(Stop eating brains, or at least, try to cut
 down);

   insertLogical( new Diagnosis( $p ) );

 *end*



 *rule* Zombie exception to brain eating advice

*salience* -50

*when*

   p : Patient(eatsBrains == *true*, isZombie == *true*)

  not Diagnosis( patient == $p )

*then*

   p.setAdvice(Evidence suggests that the undead cannot
 contract Kuru or that the effects are irellevant given 

Re: [rules-users] Is Drools appropriate for this app scenario?

2011-01-26 Thread Leonardo Gomes
It's pretty old, but you've got some architectural diagrams here:
http://www.infoq.com/articles/Rule-Engines

On Wed, Jan 26, 2011 at 12:27 PM, Sebastien Chevalier 
sebastien.cheval...@web.de wrote:


 @plugtreelabs: First of all, thank you very much for your response and
 hints.

 @all: As I'm still not quire sure how to realize my scenario:
 Please, could someone provide me with some diagrams or architectural
 sketches of a typical rules-based e-commerce web application? -- Or at
 least
 point me to online resources on that topic, especially showing the
 integration of the RBMS in a web app?

 This would really help me out a lot at the moment.

 _Recap:
 The main goal is that endusers shall, on the one hand, define almost the
 whole set of entities and rules in an initial shop
 specification/configuration process, and on the other hand, this set shall
 be modifiable later on (primarily through enhancements, not restrictions).
 The entity set basically is: customer types, product categories, products,
 product packages, customer(type)-to-product(type) price assignments (i.e.
 pricing rules), and inter-product/package selection rules, ...all of these
 dynamically definable via a WebUI and in a manner appropriate for
 non-technical end-users (considering declarative programming a good
 approach
 for this(?)).

 The most dynamic parts will be the multi-dimensional pricing tables in
 terms
 of (a) their schema -- when new pricing parameters (=dimensions) like
 delivery distance are added -- and (b) their value contents -- when
 concrete
 prices change.
 Another quite dynamic part will be the inter-product selection rule
 specifications from which a smart e-catalog will be generated for the
 client-side. Such rules will state sth. like:
 Prod A must always be ordered with Prod B, Prod B can never be ordered
 when Package C is selected, and similar.
 --

 Currently, some high-level architectural layouts of a simple, rules-based
 e-commerce web app (Which components are necessary in which place? And
 which
 components are already delivered by Drools?) would be very helpful for me.

 Thank you very much for your help in advance.

 Best regards
  Sebastien

 --
 View this message in context:
 http://drools-java-rules-engine.46999.n3.nabble.com/Is-Drools-appropriate-for-this-app-scenario-tp2303204p2353169.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] Drools and mobile

2010-11-29 Thread Leonardo Gomes
Since I'm really a noobie on mobile development, this may be a stupid
question, but it doesn't hurt to ask: Does anybody here ever used Drools on
a mobile application? Would its dependencies allow it to be run on an
Android or Blackberry?

Basically, my idea is that with the CEP stuff added on Drools 5, it would be
interesting to capture events generated by the device and do some analysis.

Waiting on your feedback :)

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


Re: [rules-users] drools with IKVM

2010-11-21 Thread Leonardo Gomes
Do you have a stack trace or something like that?

2010/11/21 Piyush Goel piyush.g...@dealhunt.in

 We are using Drools engine on our client written in C#. We are using IKVM
 to convert the drools jar and our java beans into dll's using IKVM. We have
 a rule similar to this:-

 rule aggregate rule
 when
 $b : Bill(billAmount  100)
 $n : Number(doubleValue  100) from accumulate ( $l : LineItem()
 from $b.findItems(color, blue), sum($l.getSellingValue()))
 then
 VoucherSeries fact0 = new VoucherSeries();
 fact0.setSeriesCode( aggregate voucher );
 insert(fact0 );
 voucherlist.add(fact0);
 System.out.println(sum + $n);
 end


 This rule works fine when it is run with java based drools API's, but while
 running it with IKVM converted drools, it throws the following error:-

 Unable to cast object of type 'AccumulateMemory' to type 'FromMemory'.

 Any ideas on what might be going wrong ?

 thanks,
 piyush

 ___
 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] Get rid of redundant conditions in combined rules.

2010-10-12 Thread Leonardo Gomes
If your problem is performance, don't worry. Conditions evaluation is
shared, so in the second rule you won't re-evaluate the entire working
memory (to know more:http://www.drdobbs.com/184405218).

If you're worried about not having to repeat the conditions on the second
rule, I would create inferred facts when the first rule matches and use then
in the second rule + the additional conditions.

Something like:

Rule1:

when

customer:Customer(town==London)

then

insert new LondonCustomer( customer );



Rule2:

when

london : LondonCustomer(customer.job==TEACHER)

then

System.out.println(london.customer.getLname() +  is a
teacher);


2010/10/12 Dominik Hüttner d.huett...@tiq-solutions.de

  Hello everyone,

 I’ve got a question. I’m using drools-guvnor to execute some
 rule-scenarios. I have to solve the following problem: I have an amount of
 objects in my working memory and can’t remove objects from the working
 memory in the then-part of the rule. I want to combine two rules, the first
 rule selects some objects and the second rule checks only these selected
 objects for additional criteria. I have to use two rules, because I want to
 report the objects selected in the first rule, too. Now I have implemented
 this with two rules and in the second rule, the criterias of the first rule
 are copied to the second rule, my question is, is there a way to get rid of
 this redundandance?

 I have tried this with a rule flow, but the problem is, this always works
 on the whole working memory, but I can’t remove the not used objects from
 working memory for performance reasons. Is there another way to solve this
 problem?



 Here is an example for what I intend to do:



 Rule1:

 when

 customer:Customer(town==London)

 then

 System.out.println(customer.getLname() +  is inhabitant of
 London);



 Rule2:

 when

 customer:Customer(town==London,job==TEACHER)

 then

 System.out.println(customer.getLname() +  is a teacher);



 This example illustrates, with the first rule I want to get to know, how
 many customers are from London and in the second rule I want to know, how
 many of the London customers are teachers. I want to create a kind of
 statistics. I have quite a lot of conditions for the first rule, so I don’t
 want to have them redundantly.



 Greetings, Dominik

 ___
 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] Specifying time in date-effective

2010-09-29 Thread Leonardo Gomes
Hi Devyani,

You might have problems with the date format due to your system's settings.
There's the following remark in Drools 4 documentation:

 Date

 The date format dd-mmm- is supported by default. You can customize
 this by providing an alternative date format mask as a System property
 (drools.dateformat is the name of the property). If more control is
 required, use the inline-eval constraint.

The best thing is to set that system property to the exact format you want
to use. Something like this:

System.setProperty(drools.dateformat, dd-mmm- hh:mm);


-- 

I believe, that date-effective will simply check the system time before
firing a rule and, if the current time is before the specified time in the
rule, it won't fire the rule.

AFAIK, you can't make a rule be triggered at a certain time everyday, except
if you insert at that specified time a fact (or a set of facts) that will
make that rule fire..

Leo Gomes.


2010/9/29 devyani.sa...@wipro.com

  Hi All

 I am using 4.0. I have a requirement to execute a rule only during a
 specified time of a given day

 While going through the documentation I found that I could use the
 date-effective attribute to specify the date and time

*6.5.1.8. date-effective*

 *default value : N/A*

 *type : String, which contains a Date/Time definition*

 *A rule can only activate if the current date and time is after
 date-effective attribute.*

 But while trying out the same, the engine recognizes only the day and not
 the time. How do I specify the time? So far I have been using the std format
 HH:MM:SS , tried both 12-hr and 24 -hr format but no luck. Please help.

 Also, I would like to know how can I make a rule run on a specified time
 everyday. With date-effective specifying a date would be mandatory? Is thr a
 way or I need to put that in the rule condition part.



 Thanks

 Devyani

 * Please do not print this email unless it is absolutely necessary. *

 The information contained in this electronic message and any attachments to
 this message are intended for the exclusive use of the addressee(s) and may
 contain proprietary, confidential or privileged information. If you are not
 the intended recipient, you should not disseminate, distribute or copy this
 e-mail. Please notify the sender immediately and destroy all copies of this
 message and any attachments.

 WARNING: Computer viruses can be transmitted via email. The recipient
 should check this email and any attachments for the presence of viruses. The
 company accepts no liability for any damage caused by any virus transmitted
 by this email.

 www.wipro.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-dev] DroolsjBPM Boot Camps 2011 USA and EMEA (Rules, Workflow, Event Processing and Ontologies)

2010-09-27 Thread Leonardo Gomes
Hi Mark,

I would like to get involved as well. However, until the end of this year I
don't think I will be much available. I should have more free time from
mid-January on.

Anyway, JudCon Berlin is happening on October 2010, so I think that in
Europe it should be happening more at the end of 2011.

Keep us posted.

Cheers,
Leo.





2010/9/22 Mauricio Salatino sala...@gmail.com

 I would like to participate helping with organization and logistic and also
 I can do a talk about drools grid and some examples using the RIO impl. Let
 me know if I can start helping with something.


 On Wed, Sep 22, 2010 at 12:45 PM, Mark Proctor mproc...@codehaus.orgwrote:

  We are looking into an end of February date to do the next week long
 Boot Camp, location to be decided - proposals for USA so far are Chicago,
 Austin and Miami. The EMEA one will be Berlin, probably overlapping with the
 2011 JudCon.

 The last boot camp had a medical focus and was a huge success. We have
 more budget this year so hoping to build on that.

 We are thinking of doing a Monday optional 1 day pre-conference basics
 day, to avoid repeating the what is a process, what is a rule, what is an
 event type talks. This also means we don't bore returning people with
 repeated content and that everyone there has the basics.

 Then follow up with 2 days of applied industry talks split into vertical
 tracks. Because of the high level of interest and success last time, we
 will run a dedicated 2 day Medical/Healthcare track again. Whether we run
 dedicated or mixed tracks for other verticals depends on interest and
 people's willingness to present or organise and lead other verticals. I
 imagine initially we'd probably do mini tracks, say half a day per vertical.
 Some target verticals would be telecoms, commercial finance (trading),
 consumer finance (mortgage/insurance/loans), logistics.

 The 4th day would then be an organised workshop day. We'll provide
 bootable USB keys for all in attendance, so that we have a quick start off
 (previously we wasted hours getting everyone up and running with virtual
 images). The workshops will allow people to go through the very basic
 examples or the more advanced examples and infrastructure set-up with us on
 hand. Those that have their own projects and just want to work on that with
 us on hand to offer help can do so too.

 The 5th day will be more of an open floor. Some people will leave early,
 others will want to continue working through the basic examples and making
 sure they can configure and set everything up. Others will want dedicated
 discussion time to work on their own problems and ideas. In general it's the
 day where the developers will be on hand for what ever anyone wants – you'll
 get out of it what you put in.

 If you would like to present or even run and organise a vertical let me
 know. In the past I've found for a vertical to work it needs a well
 connected industry person to chair it, so we definitely need community
 people to take up the mantle here. Talks can either be What we did with
 Drools and/or jBPM or This is an industry problem use case that could be
 solved with Drools and/or jBPM or just something that we think will be of
 interest to the audience. The range of technologies covers (but not limited
 too) rules (expert systems and other derivatives domains), workflow, event
 processing and ontologies.

 The event will again be free for attendance. We are thinking of opening it
 up for sponsorship to help towards food and drink.

 So if you are interested in talking, organising, sponsoring or just have
 some general input then let us know - we want to progress in moving these
 events to a more industry focus and not pure technology, for that to happen
 we need YOU the community.

 Mark


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




 --
  - CTO @ http://www.plugtree.com
  - MyJourney @ http://salaboy.wordpress.com
  - Co-Founder @ 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


[rules-users] NPE in ClassFieldExtractor.getValue()

2010-09-24 Thread Leonardo Gomes
Hello Guys,

I'm having a NPE in the ClassFieldExtractor.getValue(InternalWorkingMemory,
Object) line: 127

It happens while executing the RHS of a rule that modifies one fact and then
updates one and retract another.

rule foo

when
...
then
// apply changes
PolicyHelper.makeInPolicy($room, $pRoom.getCompliantRuleId(),
$pRoom.getPrefLevel(), ProfileTypeEnum.COMPANY);

update($room);
retract($pRoom);
end

--

We're using good old 4.0.7, with ShadowFacts :(

I tracked down the problem to

FactHandleIndexHashTable$FieldIndexEntry.matches(ReteTuple, int) line:
 385


Where,

this.first.getFactHandle()


Returns an invalidated fact handle (a handle of a fact that has been
retracted before, I imagine). The NPE happens because invalidated handles
have their object attribute
set to null and the matches method mentioned above does:

public boolean matches(final ReteTuple tuple,
final int tupleHashCode) {
 return this.hashCode == tupleHashCode  this.index.equal( *
 this.first.getFactHandle().getObject()*,

 tuple );



Is there something I could do to workaround this problem? Any clue is
welcome.

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


Re: [rules-users] Is RETE algo optimizes the performance in a stateless session.

2010-09-24 Thread Leonardo Gomes
Have a look here: http://www.drdobbs.com/184405218

here: http://blog.athico.com/2007/07/sequential-rete.html

and here: http://herzberg.ca.sandia.gov/guidelines.shtml

The easy answer for your question is Yes ;-)

Cheers,
Leo.

2010/9/24 Harshit Bapna hrba...@gmail.com

 Hi All,

 In a scenario where lets say 10 rule are to be fired (in any order) in a
 stateless session than will I get the benefits of RETE algorithm (i.e
 increased performance).
 i.e Whether the engine will fire all the ten results in a parallel fashion
 or Whether the engine will file each rule one by one.

 How RETE algorithm will improve the performance of the engine for rules
 fired in stateless session ?


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


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


Re: [rules-users] Is RETE algo optimizes the performance in a stateless session.

2010-09-24 Thread Leonardo Gomes
Hello Harshit / Mark,

My reasoning behind the yes, is that:

- If you have 10 rules that won't necessarily always match, it's better to
use Rete, than sequentially match one-by-one. The tree structure with the
sharing of nodes for different rules seems to always be a better approach
for me, than sequentially testing one-by-one and, in some cases, retesting
the same condition on different rules (if that happens);

- You can write if-then-elses in a imperative language and perform better
than Rete, but if your rules are complicated and you have many of them, it's
likely that rete can do a better job; Also, if you need to change your rules
or add new ones, it will be easier to do that declaratively;

I first put the links, because you can use that to judge yourself whether or
not you might gain in performance in your own scenarios, with that material.


@Mark:

In general a stateless session is just a convenience api for stateful, it
 just wraps. So no performance gain at all.


I think here you're saying that there will be no performance gain compared
to a stateful session, but I believe that the question was more on the lines
of I know that with a stateful it's efficient, how about stateless. I
tried to say that, yes, it's also worth using Rete in stateless scenarios.

Cheers,
Leo.

2010/9/24 Mark Proctor mproc...@codehaus.org

  On 24/09/2010 16:18, Leonardo Gomes wrote:

 Have a look here: http://www.drdobbs.com/184405218

 here: http://blog.athico.com/2007/07/sequential-rete.html

 and here: http://herzberg.ca.sandia.gov/guidelines.shtml

 The easy answer for your question is Yes ;-)

 It depends :)

 In general a stateless session is just a convenience api for stateful, it
 just wraps. So no performance gain at all.

 There is a sequential mode, but in all honest you won't get any
 measurable perf gain. So I wouldn't use sequential mode for performance, the
 only reason to use it is if you want your rules to execute sequentially.

 Mark


 Cheers,
 Leo.

  2010/9/24 Harshit Bapna hrba...@gmail.com

 Hi All,

 In a scenario where lets say 10 rule are to be fired (in any order) in a
 stateless session than will I get the benefits of RETE algorithm (i.e
 increased performance).
 i.e Whether the engine will fire all the ten results in a parallel fashion
 or Whether the engine will file each rule one by one.

 How RETE algorithm will improve the performance of the engine for rules
 fired in stateless session ?


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



 ___
 rules-users mailing 
 listrules-us...@lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/rules-users



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


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


Re: [rules-users] rules priority

2010-09-22 Thread Leonardo Gomes
I think that you can explore the options already suggested:

- guard condition
- agenda group

and also:

- no-loop, if you happen to have any rule looping around itself
- drools.halt( ) in the consequence, if you want to completely halt the
execution when a given rule matches.

Cheers,
Leo.



2010/9/21 Esteban Aliverti esteban.alive...@gmail.com

 If what you need is to fire just a subset of all the activated rules, you
 could use agenda-group attribute instead of activation-group.

 Best,

 

 Esteban Aliverti
 - Developer @ http://www.plugtree.com
 - Blog @ http://ilesteban.wordpress.com


 2010/9/20 Michael Anstis michael.ans...@gmail.com

 You could consider using a guard condition e.g.

 rule 1
 when
 not Solved()
 Your rule 1
 then
 insert new Solved();
 
 end

 rule 2
 when
 not Solved()
 Your rule 2
 then
 insert new Solved();
 
 end


 If you only want one rule per group then have the grouping as a member
 of the guard condition.

 I'm not sure if you can cause the processing of activations to abort.

 2010/9/20 Nadav Hashimshony nad...@gmail.com

  Hi

 Im using drools 5 with Guvnor 5
 i set up 30 Technical rules and build a package to be used by my
 drools-sample application.

 my probelm is as followed, some rule may conflict, i want to set up a
 rule order and if one rule is caught then i want the drools to stop and not
 continue to try other rules.

 ive use salience but it hasnt really done the trick.

 example:
 my rules:

 rule Rule-01
 salience 100
 activation-group group1
 ...
 System.Out.Println(caught rule 1)
 

 rule Rule-02
 salience 100
 activation-group group1
 ...
 System.Out.Println(caught rule 2)
 

 rule Rule-03
 activation-group group2
 ...
 System.Out.Println(caught rule 3)
 


 rule Rule-04
 activation-group group2
 ...
 System.Out.Println(caught rule 4)
 


 actual result: lets say all 4 rules are cuaght, what i will see is as
 followed

 ACTIVATION CREATED rule:Rule-01 activationId:Rule-01 [1] declarations:
 BEFORE ACTIVATION FIRED
 caught rule 1
 ACTIVATION CANCELLED rule:Rule-2

 ACTIVATION CREATED rule:Rule-03 activationId:Rule-01 [1] declarations:
 BEFORE ACTIVATION FIRED
 caught rule 3
 ACTIVATION CANCELLED rule:Rule-3


 only one rule from each activation-group will be fired, and the first
 group with the higher salience will fire first.

 what i would like is it one rule was caught to stop trying? is it
 possible?

 Thanks, Nadav.








 ___
 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] Perfromance issues and memory leaks in Drools (Edson Tirelli)

2010-09-18 Thread Leonardo Gomes
Hi Nikhil,

If it's taking 5-6 seconds as you said, it means that you are compiling your
rules at runtime. To improve that, you could find a way to cache your
KnowledgeBase*s* - that would make your rules be compiled only once and
subsequent creation of stateless or stateful sessions would be pretty quick.
To go further, you could create the knowledge bases using precompiled rules.
For that, I use a maven plugin that compiles my drls at build time. I don't
have a link now, but you should be able to find it.

Sharing your knowledge bases and precompiling your rules will certainly make
a difference.

Hope that helps.

Leo.

On Sat, Sep 18, 2010 at 10:00 AM, Nikhil S. Kulkarni 
nikhil.kulka...@mastek.com wrote:

 Hi Edson,

 Thanks for the information.
 But now I want to ask you one thing. I have seen your post. The problem in
 application is mainly usage of memory
 You posted that Match 30,2010. I downloaded Drools 5.0 on August 2009 and I
 am using that.

 SO this True modify algorithm is implemented in Drools 5.1 only or it is
 even available in latest Drools 5.0

 If I use Drools 5.1 then Whether I will get any advantage.

In application we are using Rules Template ,Rule Flows and drls.
 When I am calling Rules from Java then it is taking more time compared to
 calling Java method from rules.


In addition to this can u suggest me how to write better rules
 Query.

 I am using very simple way of writing Rules Query like :-

 When
 Abc : ABC(condition==A)
 Then
  Call method
 End;



 Thanks  Regards,
 Nikhil S. Kulkarni





 -Original Message-
 From: rules-users-boun...@lists.jboss.org [mailto:
 rules-users-boun...@lists.jboss.org] On Behalf Of
 rules-users-requ...@lists.jboss.org
 Sent: Friday, September 17, 2010 9:30 PM
 To: rules-users@lists.jboss.org
 Subject: rules-users Digest, Vol 46, Issue 58

 Send rules-users mailing list submissions to
rules-users@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-requ...@lists.jboss.org

 You can reach the person managing the list at
rules-users-ow...@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. Re: Perfromance issues and memory leaks in Drools (Edson Tirelli)


 --

 Message: 1
 Date: Fri, 17 Sep 2010 11:04:55 -0400
 From: Edson Tirelli tire...@post.com
 Subject: Re: [rules-users] Perfromance issues and memory leaks in
Drools
 To: Rules Users List rules-users@lists.jboss.org
 Message-ID:

 aanlktinr2-+twt_myoijf1rc_waw7e6cvtwjpngkb...@mail.gmail.comaanlktinr2-%2btwt_myoijf1rc_waw7e6cvtwjpngkb...@mail.gmail.com
 
 Content-Type: text/plain; charset=windows-1252

Nikhil,

Maybe you are using the term memory leak loosely here, but otherwise,
 Drools 4.0.7 and Drools 5.0.1 were both tested to exhaustion for memory
 leaks and I can tell you that no memory leak was found, and I personally
 doubt there is one there on regular use. Also, FYI, Drools 5.x eliminates
 the need for shadow facts, what is a considerable memory save over 4.x, but
 adds some other overheads for performance improvement that kind of offset
 those gains. On the other hand, Drools 5.1.1 takes the algorithm to a new
 level, saving a lot of memory on systems that use modify actions on their
 rules.

 http://blog.athico.com/2010/03/drools-halves-memory-use-with-new-true.html

Regarding your performance, all I can tell you is that a rules engine is
 a relational engine that works pretty much like a database, and rules as
 databases queries. The same way you can write SQL queries that run fast or
 slow on a database, you can write rules that run fast or slow on a rules
 engine. It all depends on how the rules/queries are written, how your data
 model/domain model looks like, etc.

So, regarding your question, we can't tell you how to improve those
 metrics without knowing your domain model, rules and etc.

[]s
Edson

 2010/9/17 Nikhil S. Kulkarni nikhil.kulka...@mastek.com

   Hi,
 
 
 
  I have written 2 different Drools programs. One is with
  Using rule Base of Drools 4.0 and other is using Knowledge Base of Drools
  5.0.
 
  I was trying to check that is there any improvement in Drools 5.0. But I
  haven?t got any performance improvement in Drools 5.0 code compared to
  Drools 4.0.
 
 
 
  One more important thing is I am calling this drools code
  from  My application which itself is heavy application, when I am doing
  Performance tuning
 
  I got one point i.e. session.execute() method is taking around 6-7
 seconds
  to initialize rules and even the memory utilized by Rules is huge.
 
 
 
  So is there any way that we can reduce the Memory 

Re: [rules-users] [rules-dev] Technical Rules

2010-09-14 Thread Leonardo Gomes
I might be wrong, but I think DRL - BRL is still not possible.


Just had a look at org.drools.ide.common.server.util.BRDRLPersistence, and
we have the following:

public RuleModel unmarshal(String str) {
 throw new UnsupportedOperationException(
 Still not possible to convert pure DRL to RuleModel);
 }


Leo.

2010/9/14 Wolfgang Laun wolfgang.l...@gmail.com

 There is a short hint in the Expert Manual, subsection 4.11.3, where
 conversion between DRL and XML using classes such as DrlParser and XmlDumper
 is discussed. A .brk is just the native Drools XML format.

 -W


 On 14 September 2010 01:17, Leonardo Gomes leonardo.f.go...@gmail.comwrote:

 Hi Amisha,

 You should use the user's list: rules-users@lists.jboss.org for this
 sort of question.

 AFAIK, no you can't convert technical rules (manually written drl) to
 business rules (.brl) generated with the graphical editor using Guvnor.

 Cheers,
 Leo.


 On Mon, Sep 13, 2010 at 10:42 PM, apatel apa...@ondeckcapital.comwrote:


 Hi,

 Is it possible to port Technical Rules in Drools to Business Rules? Is
 the
 procedure posted somewhere?

 Also is it possible to apply Drools Categories to Technical Rules?

 Thanks for your help,
 Amisha
 --
 View this message in context:
 http://drools-java-rules-engine.46999.n3.nabble.com/Technical-Rules-tp1468563p1468563.html
 Sent from the Drools - Dev mailing list archive at Nabble.com.
 ___
 rules-dev mailing list
 rules-...@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-dev



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



 ___
 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-dev] Technical Rules

2010-09-14 Thread Leonardo Gomes
The thing is that, afaik, the DrlParser in itself doesn't give you something
that you can use to generate the BRL XML, even for a well-behaved DRL. You
would have to do some sort of model-to-model transformation that would have
RuleModel as an outcome. With the RuleModel at hand you can easily marshal
it to BRL XML.

There are visitors for the RuleModel that generate BRL XML (quite simple
with XStream) and pure DRL, and when you want to compile a BRL rule package
today, it uses the DRL visitor to generate the DRL that can be used to
compile.

BRL XML: hasn't evolved lately mainly because Mark and the others are
waiting for RuleML to become the canonical XML representation. I think that
the BRL Schema misses a lot of things that you have today in a DRL and
that's why nobody wanted to make the effort to have a DRL - BRL parser.
This part risk to be completely rewritten the day they decide to use RuleML.

Having said that, I still thing that I might be wrong since I haven't looked
much at the 5.x code except for the parts that I already knew from 4.0.7 :)

Cheers,
Leo.

On Tue, Sep 14, 2010 at 2:00 PM, Wolfgang Laun wolfgang.l...@gmail.comwrote:

 You are right, of course.  The BRL editor has its own XML format.

 I just wonder whether going through a DrlParser - DrlDumper cycle might
 produce a sufficiently well-behaved DRL text that could be easily enough
 transformed to the BRL XML. But nothing of this is in the stable API, so
 it would be wobbly in more than one way.

 -W


 2010/9/14 Leonardo Gomes leonardo.f.go...@gmail.com

 I might be wrong, but I think DRL - BRL is still not possible.


 Just had a look at org.drools.ide.common.server.util.BRDRLPersistence, and
 we have the following:

 public RuleModel unmarshal(String str) {
 throw new UnsupportedOperationException(
 Still not possible to convert pure DRL to RuleModel);
 }


 Leo.

 2010/9/14 Wolfgang Laun wolfgang.l...@gmail.com

 There is a short hint in the Expert Manual, subsection 4.11.3, where
 conversion between DRL and XML using classes such as DrlParser and XmlDumper
 is discussed. A .brk is just the native Drools XML format.

 -W


 On 14 September 2010 01:17, Leonardo Gomes 
 leonardo.f.go...@gmail.comwrote:

 Hi Amisha,

 You should use the user's list: rules-users@lists.jboss.org for this
 sort of question.

 AFAIK, no you can't convert technical rules (manually written drl) to
 business rules (.brl) generated with the graphical editor using Guvnor.

 Cheers,
 Leo.


 On Mon, Sep 13, 2010 at 10:42 PM, apatel apa...@ondeckcapital.comwrote:


 Hi,

 Is it possible to port Technical Rules in Drools to Business Rules? Is
 the
 procedure posted somewhere?

 Also is it possible to apply Drools Categories to Technical Rules?

 Thanks for your help,
 Amisha
 --
 View this message in context:
 http://drools-java-rules-engine.46999.n3.nabble.com/Technical-Rules-tp1468563p1468563.html
 Sent from the Drools - Dev mailing list archive at Nabble.com.
 ___
 rules-dev mailing list
 rules-...@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-dev



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



 ___
 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] Drools - business rules graphical editing at runtime

2010-09-13 Thread Leonardo Gomes
Hi Chander,

Have you already checked this:
http://www.jboss.org/drools/drools-guvnor.html#Why ?

Leo.

On Mon, Sep 13, 2010 at 8:55 AM, chuckys1106 tchande...@yahoo.com wrote:


 Hello,

 I have a requirement/investigation to be done in my project.
 It is about allowing the end user of our application(which uses DROOLS 5.0)
 to be able to edit the set of rules in a dynamic fashion, graphically...

 I have searched on the web so far, and didnt find any topic regarding
 runtime editing. Is this possible, any idea/advice on this.

 Thanks
 Chander
 --
 View this message in context:
 http://drools-java-rules-engine.46999.n3.nabble.com/Drools-business-rules-graphical-editing-at-runtime-tp1463922p1463922.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] Verify if an objects attribute exists

2010-09-13 Thread Leonardo Gomes
You could try to explain a bit more how the User class and the
isUserMatching method look like.

Leo.


On Fri, Sep 10, 2010 at 11:30 PM, lnguyen mzspd...@gmail.com wrote:


 I'm having difficulty writing this rule.

 Background information:
 A User can have a supervisor but it's not required.

 When viewing User information I want to verify that the logged in user is
 either the current user or the currentUser's supervisor but I throw an
 exception when the supervisor object is null on the currentUser.

 The target is the User being viewed and I have a global object that is the
 current user. How can I check to see if the supervisor exists before
 evaluating if the currentUser and the supervisor are equal?

 rule 'CanViewUserData'
 dialect 'mvel'
 when
$user : User()
$supervisor : User( ) from $user.userProfile.supervisor
$check: PermissionCheck(target == $user, action == viewUserData)
eval(isUserMatching($user)) || eval (isUserMatching($supervisor))
 then
System.out.println(The currentUser CanViewUserData);
$check.grant();
 end

 --
 View this message in context:
 http://drools-java-rules-engine.46999.n3.nabble.com/Verify-if-an-objects-attribute-exists-tp1455073p1455073.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] Virtual box dev environment

2010-09-09 Thread Leonardo Gomes
Hi Guys,

I'm trying to setup a drools developer environment and currently facing some
issues with missing dependencies.

Is it still worth to install the virtual box described here: *
http://blog.athico.com/2009/06/pre-installed-drools-development.html*
and do a svn update, etc.

Or is it completely outdated and will be harder do deal with than going
through the regular setup?

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


Re: [rules-users] Avoiding loops

2010-07-15 Thread Leonardo Gomes
Thanks for the feedback, guys.

Leonardo.

On Wed, Jul 14, 2010 at 8:41 AM, Wolfgang Laun wolfgang.l...@gmail.comwrote:

 Another option would be the addition of a single Trigger fact, inserted
 along
 with your regular facts, added as an additional pattern to all rules,
 and retracted
 in each RHS.

 You might also consider using Event processing to terminate the Engine's
 run after the first AfterActivationFiredEvent.

 -W


 2010/7/14 Mauricio Salatino sala...@gmail.com:
  you can also add an extra property to your facts to check and add
 condition
  to check that property. (like a processed flag)
  Greetings
 
 
  2010/7/13 Leonardo Gomes leonardo.f.go...@gmail.com
 
  Hi Droolers,
 
  I'm trying to avoid loops and looking at different possibilities
 (no-loop,
  activation-group, lock-on-active, etc.).
 
  Scenario I want to avoid:
 
  For example, the initial facts trigger *rule 1*, which inserts new facts
  that will trigger *rule 2*, which will then insert facts that would
  re-trigger *rule 1*.
 
  Possibilities I tried:
 
  no-loop - just prevents the re-activation of the same rule
  lock-on-active - I can't know which rules should have lock-on-active
 set
  to true, since I don't know what will be the initial facts.
 
  What I'm trying to achieve:
 
  All rules in my rule set should execute only once. So, a rule inserts
 new
  facts only rules that haven't executed so far, should be activated.
 
  Is there a way to do that, let's say 'out-of-the-box', with DRL?
 
  Thank you,
  Leo.
 
 
 
 
 
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
 
 
 
 
  --
   - CTO @ http://www.plugtree.com
   - MyJourney @ http://salaboy.wordpress.com
   - Co-Founder @ 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

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


[rules-users] Avoiding loops

2010-07-13 Thread Leonardo Gomes
Hi Droolers,

I'm trying to avoid loops and looking at different possibilities (no-loop,
activation-group, lock-on-active, etc.).

Scenario I want to avoid:

For example, the initial facts trigger *rule 1*, which inserts new facts
that will trigger *rule 2*, which will then insert facts that would
re-trigger *rule 1*.

Possibilities I tried:

no-loop - just prevents the re-activation of the same rule
lock-on-active - I can't know which rules should have lock-on-active set to
true, since I don't know what will be the initial facts.

What I'm trying to achieve:

All rules in my rule set should execute only once. So, a rule inserts new
facts only rules that haven't executed so far, should be activated.

Is there a way to do that, let's say 'out-of-the-box', with DRL?

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


Re: [rules-users] drools expert: memory issues

2010-04-07 Thread Leonardo Gomes
I'm still using good old Drools 4 and there's an ant task and a maven plugin
out there to compile your rules at build time. I'm pretty sure there's
something like that you could use as well.

Cheers,
Leonardo.

2010/4/1 miguel machado mls.mach...@gmail.com

 hi again,

 2010/4/1 Edson Tirelli ed.tire...@gmail.com


Hmm, let me complement Wolfgang's comment:

  After you have taken the compiled packages from the KB and checked for
 errors, the KB has done his duty the KB MUST go :-)


 I agree! But i don't exactly know how to do so... i mean, i call this
 method which creates the KB from a DRL file and then the kbase and returns
 the ksession, the KB object declaration scope is just that exact method, and
 once it reaches 300MB+ in memory, it just stays there... the KB object is no
 longer in use (or is it?) but memory keeps high.

 I've tried setting KB to null and then invoking the jvm garbage
 collector, but to no avail. I wish there was a simple way i could just
 destroy a particular object sigh



The above emphasis is mine. KnowledgeBuilder is a higher level object
 designed to encapsulate the parsing+compilation steps of resources. It is
 **not** designed to be reused and doing so might create inconsistencies. The
 memory spike you see when using the kbuilder is due to the java compiler...


 I understand that, and i'll have that if i must, but the thing is it's not
 just a spike, it is prolonged throughout execution, it doesn't reduce
 afterwards.


 Drools itself does not do anything fancy in there other than generate some
 code (quite inexpensive memory wise) and compile it using either JDT or
 JANINO (both quite expensive memory wise, when compared to the other steps).


So, I strongly discourage you keeping the KB around and as mentioned by
 Wolfgang, doing so might keep unnecessary objects in memory.


 Like i said earlier, it's not that i want to keep KB around, i just can't
 remove it.



Also, just to clarify, deserializing a compiled package means the
 compiler will not be called (obviously, as everything is already compiled)
 and that is why it should save you memory.


 Thanks for clarifying that! I've tested with a separate application to
 build a compiled file and then load it in the main system and it really
 makes a difference! it's gone to 100MB wow! However, this was just a
 proof-of-concept, as i'm not sure how i could apply the same technique to
 the main standalone application. Do i really have to create a separate
 process/application just for building/compiling the rules, to make sure the
 compilation-object-junk doesn't stay in memory along with the rest?

 Thanks for all the feedback and input so far.
 _ miguel


 --
 To understand what is recursion you must first understand recursion

 ___
 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] Eclipse plugin with latest Galileo

2009-12-03 Thread Leonardo Gomes
I've seen about three posts about that lately (including mine) and no one
seemed to have solved it yet.

What's the URL for hudson?

Thanks,
Leo.

2009/12/3 Ross H ross...@gmail.com

 I think there was a previous post on this. Try the latest from Hudson and
 see if that works.

 2009/12/3 chris richmond richmond...@gmail.com

 Is anyone successfully using the IDE plugin with the latest Galileo
 version of Eclipse. I cannot get it to debug using Galileo(my previous post
 concerning debug as)  I tested instlaling the IDE plugin by using the IDE
 update site link on the following versions.  I normally use the Galileo, but
 tried the other for troubleshooting this

 Galileo standard
 Galileo EE
 Ganymede Standard


 The plugin appears to install just fine with all three, and the
 DroolsTest.java that is added when I create a new Drools project runs fine
 in all three.  However, I am only able to debug as Drools application using
 Ganymede.So is it simply not possible to use the IDE update link with
 the latest Eclipse(Galileo)?

 Thanks,
 Chris

 ___
 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] Debug as within Eclipse

2009-12-02 Thread Leonardo Gomes
I've been experiencing the same problem, have already tried on both windows
and ubuntu and also experienced that. The problem seems to be related to
Galileo and I was thinking that maybe more specifically the JEE version, but
haven't had the time to test it, so far...  Are you using the standard
Galileo?

Leo.

2009/12/2 chris richmond richmond...@gmail.com

 I used the upate site to update my Eclipse Galileo IDE with the drools
 tools, created a new drools project, had it add the hello/goodbye test class
 and pointed my workspace to the 5.1M binaries.  It runs fine, but when I
 Debug As - Drools Application I get the following errors.  I get this error
 for any drools project I try to debug as Drools application within Eclipse.
 Any ideas?

 Thanks,
 CHris


 FATAL ERROR in native method: JDWP No transports initialized,
 jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)

 ERROR: transport error 202: connect failed: Connection refused

 ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)

 JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized
 [../../../src/share/back/debugInit.c:690]

 ___
 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] Regarding Drools Rules Engine

2009-12-02 Thread Leonardo Gomes
Hi Ravi,

I'll quote Greg Barton on a recent post here:
*
*

 *You can also implement various listeners, (WorkingMemoryListener,
 AgendaEventListener, and other such goodies in package org.drools.event)
 register them with your session, and make assertions over the execution data
 they gather.  You can track such things as:

 Did rule A fire?  How many times?

 Did rule A fire on fact B?

 You can even go down to the level of did rule sequence A fire in the right
 order? assertions, but usually such tests are too brittle, and miss the
 point of rules anyway. :)*


My other answers are below.

Leo.

2009/12/2 Anupindi RaviShankar iamrav...@gmail.com

 Hi All,

 We are evaluating Drools rules engine for one of the clients. The client
 has given some parameters based on which evaluation needs to be done.
 We were not able to get this information from Drools site. So need your
 help in getting this information.

 • Number of transactions Drools Engine can support. Can it support around
 1-1.5 million transactions.

** I'd say it will depend on the characteristics of your system: complexity
of rules, # of rules, # of facts, if you'll use stateless or stateful
sessions, etc. You could also have a look here:
http://www.jessrules.com/guidelines.shtml. Even if it's not drools-specific,
it applies for rule engines in general.

 • How can we introduce enforcement levels, overriding authority etc.?

** I think you're talking about something drools call salience and
agenda-groups here. Look for these words in the docs.


 • How can the controlling class get to know which rule was fired and which
 was overridden ?

** Go to the beginning of my answer.

 • Does the rule engine support the tracking of different rule types?

** I don't exactly what you'd like to achieve, but I think the different
listeners could help you with that.

 Can you please provide your updates on the same.

 Thanks
 Ravi

Cheers,
Leo.



 ___
 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] Stateful session and non-existence of Facts

2009-11-30 Thread Leonardo Gomes
Hi Wolfgang,

Thanks for the reply.

Leo.

On Fri, Nov 27, 2009 at 7:38 AM, Wolfgang Laun wolfgang.l...@gmail.comwrote:

 2009/11/26 Leonardo Gomes leonardo.f.go...@gmail.com



 On Tue, Nov 24, 2009 at 10:42 PM, Leonardo Gomes 
 leonardo.f.go...@gmail.com wrote:

 H

 Now, let's say FactA(1) indicates a fact of type FactA and id = 1.

 - Then, in the beginning, I insert FactA(1) and FactA(2) in my working
 memory and fire the rules.

 rule test non existence
 when
 not FactA( id == 4 )
 then
 output.add(there's no FactA id 4);

 - This rule is fired and the message is added to my output object.

 Later on, I have a notification that a FactA has changed, then I:
 - retract all FactAs from my working memory
 - clear all FactA-related messages from my output object
 - reload FactAs (let's say now I have FactA(1), FactA(3), but NOT
 FactA(4))
 - reinsert them in the WM
 - fire the rules

 The rule that checks that there's no FactA(4) doesn't refire.


 Why should it? The truth of the non-existance of FactA(4) has been
 established, and this truth never changed, certainly not by removing any
 FactA(n) and also not by inserting any FactA(x) with x!= 4.

 As a solution, you could
 - establish an explicit fact, asserted in rule test non existence and
 retracted by a rule checking the negated condition;
 - add a Trigger fact to rule test non existence which you modify after
 each reload of the FactA set
 - do something else which I'm not clever enough to think about at the
 moment

 -W





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


Re: [rules-users] Problems debugging on Eclipse 3.5

2009-11-26 Thread Leonardo Gomes
My answers below..

On Tue, Nov 24, 2009 at 3:18 PM, Kris Verlaenen 
kris.verlae...@cs.kuleuven.be wrote:

 Do you only have this when you run this using Debug as Drools JUnit
 test and not when you debug this as a normal JUnit test?

Normal unit-tests run fine, I just can't put a breakpoint on my rules.



 And if you
 turn this into a normal class with a main method, do you still have this
 when using Debug as Drools application and/or Debug as Java
 application.

I got that behaviour at work, but now I just tried at home and had the same
problem.

Here I'm on Ubuntu 9.10, jdk 6, Drools 5 and Eclipse 3.5 .


 And no firewall turned on that could cause this connection refused?


Not really.


 Kris


I actually installed Drools plugin via Eclipse's dropin folder. I'll remove
it from there and try to install it via the regular update site to see what
happens.

Thanks, Kris.



 Quoting Leonardo Gomes leonardo.f.go...@gmail.com:

  Hi Guys,
 
  I'm having the following exception while trying to lauch Debug as
  Drools
  JUnit Test:
 
  FATAL ERROR in native method: JDWP No transports initialized,
  jvmtiError=JVMTI_ERROR_INTERNAL(113)
  ERROR: transport error 202: connect failed: Connection refused
  [transport.c,L41]
  ERROR: JDWP Transport dt_socket failed to initialize,
  TRANSPORT_INIT(510)
  [debugInit.c,L500]
  JDWP exit error JVMTI_ERROR_INTERNAL(113): No transports initialized
 
 
  I'm using:
 
  * Eclipse 3.5.0
  * Drools Eclipse Plugin 5.0.1
  * jdk1.5.0_18
 
 
  Any ideas?
 
  Thank you,
  Leo.
 




 Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

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


Re: [rules-users] Stateful session and non-existence of Facts

2009-11-26 Thread Leonardo Gomes
The email is big just because I tried to big as clear as possible, but it's
a quick reading, I promise!

No one?

Cheers,
Leo.

On Tue, Nov 24, 2009 at 10:42 PM, Leonardo Gomes leonardo.f.go...@gmail.com
 wrote:

 Hello,

 Regarding the session recreation, you're absolutely right, thanks!

 Anyway, I still have a problem and I believe it's more a design thing. Let
 me try to clarify it.

 I have different types of facts, let's say:

 * Types: FactA, FactB, FactC;
 * A stateful session with rules operating on them;
 * And a global variable, called output, which is a list of messages
 generated as consequences of those rules;
 * From time to time, I get notified that a fact of type FactA changed, then
 I have to:
   - retract all facts of type FactA from my working memory
   - reload them from the database (with java beans being created)
   - reinsert them in that stateful session

 Now, let's say FactA(1) indicates a fact of type FactA and id = 1.

 - Then, in the beginning, I insert FactA(1) and FactA(2) in my working
 memory and fire the rules.
 - I have several rules operating on different types of facts, but I'm
 interested in one rule in particular which operates against FactA and reads
 something like:

 rule test non existence
 when
 not FactA( id == 4 )
 then
 output.add(there's no FactA id 4);

 - This rule is fired and the message is added to my output object.

 Later on, I have a notification that a FactA has changed, then I:
 - retract all FactAs from my working memory
 - clear all FactA-related messages from my output object
 - reload FactAs (let's say now I have FactA(1), FactA(3), but NOT FactA(4))
 - reinsert them in the WM
 - fire the rules

 The rule that checks that there's no FactA(4) doesn't refire. All other
 rules operating against FactA do, and since I had removed all FactA-related
 messages from my output object, this time I don't get the there no FactA id
 4 message in my output.

 It sounds like a situation for a stateless session, but I actually have
 several different rules, operating on different types of facts and don't
 want to refire all rules, just because a fact of type A changed.

 Maybe I should have an strategy of creating different sets of stateless
 sessions. I'm not sure. Advice is really welcome!

 Thanks again.

 Leo.










 2009/11/17 Edson Tirelli ed.tire...@gmail.com


Leonardo,

First, I believer there is a misconception in your reasoning: creating
 sessions is supposed to be much much cheaper than retracting all facts.
 Creating a rulebase is heavier, because it requires compilation, but
 creating a session is supposed to be very light by design. So, first thing
 you should do is change that.

Regarding your question, if you insert:


 SiteLanguage(language : languageCode)
 t : SiteSpecialServiceType(type : specialServiceType)

The rule will activate and fire. If you don't, then the rule will not
 match. That is how it is supposed to work.

Edson

 2009/11/17 Leonardo Gomes leonardo.f.go...@gmail.com

  Hi Guys,

 I have the following situation while running a stateful session with
 Drools 4.0.7:

 - I want to test that a fact with a given state doesn't exist;
 - It works fine
 - At a certain point I have to retract all facts and reinsert them at the
 stateful session - some of them actually changed and I don't want to
 recreate the session b/c it's expensive
 - Again the fact that didn't exist when I first created the session still
 doesn't exist

 ** Problem: This time the rule that verified the non-existence is not
 fired because I didn't insert any fact that would retrigger it.

 Rule example:

 rule 022

 when

 SiteLanguage(language : languageCode)
 t : SiteSpecialServiceType(type : specialServiceType)
 not SiteLanguageSpecialServiceType(specialServiceType == type,
 languageCode == language)
 then
 consequence
 end

 How could I solve or workaround that?


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




 --
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com

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



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


Re: [rules-users] Problems debugging on Eclipse 3.5

2009-11-26 Thread Leonardo Gomes
Well, it keeps failing even after installing through the update site :(

FATAL ERROR in native method: JDWP No transports initialized,
jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
ERROR: transport error 202: connect failed: Connection refused
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized
[../../../src/share/back/debugInit.c:690]


On Thu, Nov 26, 2009 at 8:48 PM, Leonardo Gomes
leonardo.f.go...@gmail.comwrote:

 My answers below..

 On Tue, Nov 24, 2009 at 3:18 PM, Kris Verlaenen 
 kris.verlae...@cs.kuleuven.be wrote:

 Do you only have this when you run this using Debug as Drools JUnit
 test and not when you debug this as a normal JUnit test?

 Normal unit-tests run fine, I just can't put a breakpoint on my rules.



 And if you
 turn this into a normal class with a main method, do you still have this
 when using Debug as Drools application and/or Debug as Java
 application.

 I got that behaviour at work, but now I just tried at home and had the same
 problem.

 Here I'm on Ubuntu 9.10, jdk 6, Drools 5 and Eclipse 3.5 .


 And no firewall turned on that could cause this connection refused?


 Not really.


 Kris


 I actually installed Drools plugin via Eclipse's dropin folder. I'll remove
 it from there and try to install it via the regular update site to see what
 happens.

 Thanks, Kris.



 Quoting Leonardo Gomes leonardo.f.go...@gmail.com:

  Hi Guys,
 
  I'm having the following exception while trying to lauch Debug as
  Drools
  JUnit Test:
 
  FATAL ERROR in native method: JDWP No transports initialized,
  jvmtiError=JVMTI_ERROR_INTERNAL(113)
  ERROR: transport error 202: connect failed: Connection refused
  [transport.c,L41]
  ERROR: JDWP Transport dt_socket failed to initialize,
  TRANSPORT_INIT(510)
  [debugInit.c,L500]
  JDWP exit error JVMTI_ERROR_INTERNAL(113): No transports initialized
 
 
  I'm using:
 
  * Eclipse 3.5.0
  * Drools Eclipse Plugin 5.0.1
  * jdk1.5.0_18
 
 
  Any ideas?
 
  Thank you,
  Leo.
 




 Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm



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


[rules-users] Problems debugging on Eclipse 3.5

2009-11-24 Thread Leonardo Gomes
Hi Guys,

I'm having the following exception while trying to lauch Debug as Drools
JUnit Test:

FATAL ERROR in native method: JDWP No transports initialized,
jvmtiError=JVMTI_ERROR_INTERNAL(113)
ERROR: transport error 202: connect failed: Connection refused
[transport.c,L41]
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
[debugInit.c,L500]
JDWP exit error JVMTI_ERROR_INTERNAL(113): No transports initialized


I'm using:

* Eclipse 3.5.0
* Drools Eclipse Plugin 5.0.1
* jdk1.5.0_18


Any ideas?

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


Re: [rules-users] Stateful session and non-existence of Facts

2009-11-24 Thread Leonardo Gomes
Hello,

Regarding the session recreation, you're absolutely right, thanks!

Anyway, I still have a problem and I believe it's more a design thing. Let
me try to clarify it.

I have different types of facts, let's say:

* Types: FactA, FactB, FactC;
* A stateful session with rules operating on them;
* And a global variable, called output, which is a list of messages
generated as consequences of those rules;
* From time to time, I get notified that a fact of type FactA changed, then
I have to:
  - retract all facts of type FactA from my working memory
  - reload them from the database (with java beans being created)
  - reinsert them in that stateful session

Now, let's say FactA(1) indicates a fact of type FactA and id = 1.

- Then, in the beginning, I insert FactA(1) and FactA(2) in my working
memory and fire the rules.
- I have several rules operating on different types of facts, but I'm
interested in one rule in particular which operates against FactA and reads
something like:

rule test non existence
when
not FactA( id == 4 )
then
output.add(there's no FactA id 4);

- This rule is fired and the message is added to my output object.

Later on, I have a notification that a FactA has changed, then I:
- retract all FactAs from my working memory
- clear all FactA-related messages from my output object
- reload FactAs (let's say now I have FactA(1), FactA(3), but NOT FactA(4))
- reinsert them in the WM
- fire the rules

The rule that checks that there's no FactA(4) doesn't refire. All other
rules operating against FactA do, and since I had removed all FactA-related
messages from my output object, this time I don't get the there no FactA id
4 message in my output.

It sounds like a situation for a stateless session, but I actually have
several different rules, operating on different types of facts and don't
want to refire all rules, just because a fact of type A changed.

Maybe I should have an strategy of creating different sets of stateless
sessions. I'm not sure. Advice is really welcome!

Thanks again.

Leo.










2009/11/17 Edson Tirelli ed.tire...@gmail.com


Leonardo,

First, I believer there is a misconception in your reasoning: creating
 sessions is supposed to be much much cheaper than retracting all facts.
 Creating a rulebase is heavier, because it requires compilation, but
 creating a session is supposed to be very light by design. So, first thing
 you should do is change that.

Regarding your question, if you insert:


 SiteLanguage(language : languageCode)
 t : SiteSpecialServiceType(type : specialServiceType)

The rule will activate and fire. If you don't, then the rule will not
 match. That is how it is supposed to work.

Edson

 2009/11/17 Leonardo Gomes leonardo.f.go...@gmail.com

 Hi Guys,

 I have the following situation while running a stateful session with
 Drools 4.0.7:

 - I want to test that a fact with a given state doesn't exist;
 - It works fine
 - At a certain point I have to retract all facts and reinsert them at the
 stateful session - some of them actually changed and I don't want to
 recreate the session b/c it's expensive
 - Again the fact that didn't exist when I first created the session still
 doesn't exist

 ** Problem: This time the rule that verified the non-existence is not
 fired because I didn't insert any fact that would retrigger it.

 Rule example:

 rule 022

 when

 SiteLanguage(language : languageCode)
 t : SiteSpecialServiceType(type : specialServiceType)
 not SiteLanguageSpecialServiceType(specialServiceType == type,
 languageCode == language)
 then
 consequence
 end

 How could I solve or workaround that?


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




 --
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com

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


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


[rules-users] Stateful session and non-existence of Facts

2009-11-17 Thread Leonardo Gomes
Hi Guys,

I have the following situation while running a stateful session with Drools
4.0.7:

- I want to test that a fact with a given state doesn't exist;
- It works fine
- At a certain point I have to retract all facts and reinsert them at the
stateful session - some of them actually changed and I don't want to
recreate the session b/c it's expensive
- Again the fact that didn't exist when I first created the session still
doesn't exist

** Problem: This time the rule that verified the non-existence is not fired
because I didn't insert any fact that would retrigger it.

Rule example:

rule 022

when

SiteLanguage(language : languageCode)
t : SiteSpecialServiceType(type : specialServiceType)
not SiteLanguageSpecialServiceType(specialServiceType == type, languageCode
== language)
then
consequence
end

How could I solve or workaround that?


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


Re: [rules-users] What is inference and how does it facilitate good rule design and maintenance

2009-11-10 Thread Leonardo Gomes
I think I missed something on that post. Just posted a reply.

Cheers,
Leo.

On Tue, Nov 10, 2009 at 3:05 AM, Mark Proctor mproc...@codehaus.org wrote:
 Just published this, where I'm trying to explain good rule design in
 terms more familiar to software developers.
 http://blog.athico.com/2009/11/what-is-inference-and-how-does-it.html

 Let me know what you think, and hopefully people have other ideas they
 can add back in.

 Mark

 ___
 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] Class loader problem

2009-11-09 Thread Leonardo Gomes
Hi Hemanth,

If you're looking for dynamic creation of Facts, you should have a look here:

http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/drools-expert/html_single/index.html#d0e3350

HTH,
Leo.


On Mon, Nov 9, 2009 at 8:37 AM, Hemanth kumar hema...@saha.in wrote:

 Hi swapnil thanx for the reply
 I think there is no error in url path.for a week i was not active in my
 project.
 Im sending my sample project

 Here is my sample application
 -
 main java class
 http://old.nabble.com/file/p26262304/ruleTest.txt ruleTest.txt

 sample rule

 http://old.nabble.com/file/p26262304/Sample.drl Sample.drl

 tomcat console

 http://old.nabble.com/file/p26262304/console1.PNG console1.PNG


 Added following jars in tomcat/lib
 ( actual path : C:\Program Files\Apache Software Foundation\Tomcat
 6.0\webapps\JStudio\WEB-INF\lib)

 antlr-runtime-3.1.1.jar
 core-3.4.2.v_883_R34x.jar
 drools-api-5.0.1.jar
 drools-compiler-5.0.1.jar
 drools-core-5.0.1.jar
 drools-jsr94-5.0.1.jar
 drools-decisiontables-5.0.1.jar
 mvel2-2.0.14.jar
 xstream-1.3.1.jar

 suggest me any ideas
 --
 View this message in context: 
 http://old.nabble.com/Class-loader-problem-tp26160051p26262304.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] MVEL and Maps

2009-11-08 Thread Leonardo Gomes
Hi Wolfgang,

Here's the context:

We're replacing a very basic home-made rule engine with drools. Today,
fact data can be added dynamically b/c for all rules our fact is
nothing more than a Map and we can register new fact data through an
UI where you say what's the key and what's the type of the value.
Rules can also be created dynamically and operate against those newly
created attributes of my fact.

Incoming requests are key / value structures and we have a service
that will look at the list of registered fact data and try to find
that information in the incoming request by looking for the keys and
getting the corresponding values, then populating the Map I just
talked about which will be injected in the working memory for
evaluation against our rules.

That's why, in Drools, I need to have my rules accessing data from a
Map. By using MVEL, as I said, it works fine with strings, integers
and list of strings, but I'm having problems with dates and would like
some advice on that case.

Here's another example of things that work:

rule test rule
when
Map ( this[airportCode] == GIG
, this[numberOfPassengers]  1
, this[class] in (BUSINESS, FIRST CLASS) )
then
m.addMessage(rule matched);
end

And here's where I have problems,

Map ( this[departureDate] ) == 07-Jan-2009 )


Thanks a lot,
Leo.



On Sun, Nov 8, 2009 at 10:56 AM, Wolfgang Laun wolfgang.l...@gmail.com wrote:
 On Sat, Nov 7, 2009 at 6:00 PM, Leonardo Gomes leonardo.f.go...@gmail.com
 wrote:

 Hello,

 I'm feeding my working memory with Maps (unfortunately, this is a
 requirement and I can't use beans).


 Before people start racking their brains to overcome all the resulting
 difficulties: Could you please explain what this requirement is meant to
 achieve?
 -W



 To access the values in this maps I use the following MVEL expression :

                Map ( this[airportCode] == GIG
                        , this[numberOfPassengers]  1
                        , this[class] memberOf (BUSINESS, FIRST) )

 And it works fine, except for dates where I get a ClassCastException,
 even tough I'm using the right pattern:

 Map ( this[departureDate]  07-Nov-2009 )   --- fails

 Is there anything I need to do to make the dynamic cast of dates work,
 in this particular case?

 --

 Morever, I get NPEs if there's no value for a given key. For example,
 the expression Map ( this [name] == 'Leonardo' ) would fail if
 there's no entry with name as the key.

 Any help is welcome!

 Thanks in advance,
 Leo.
 ___
 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] MVEL and Maps

2009-11-07 Thread Leonardo Gomes
Hello,

I'm feeding my working memory with Maps (unfortunately, this is a
requirement and I can't use beans).

To access the values in this maps I use the following MVEL expression :

Map ( this[airportCode] == GIG
, this[numberOfPassengers]  1
, this[class] memberOf (BUSINESS, FIRST) )

And it works fine, except for dates where I get a ClassCastException,
even tough I'm using the right pattern:

Map ( this[departureDate]  07-Nov-2009 )   --- fails

Is there anything I need to do to make the dynamic cast of dates work,
in this particular case?

--

Morever, I get NPEs if there's no value for a given key. For example,
the expression Map ( this [name] == 'Leonardo' ) would fail if
there's no entry with name as the key.

Any help is welcome!

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


Re: [rules-users] Drools engine not working

2009-10-22 Thread Leonardo Gomes
Hi Hemanth,

Assuming that you've already tried debugging it... could you share your Fact
definition and test rule with us?

The jars are correct.

Leo.

On Thu, Oct 22, 2009 at 7:06 AM, Hemanth kumar hema...@saha.in wrote:


 hi,
 Im working on Drools project.here is my project scenario.

 front end : Adobe Flex 3.0 application
 server : tomcat 6.x
 Drools : 5.0

 from flex application i was invoking java class which isin the server
 DroolsTest.java .

 In this i was  dynamically creating a class ( Fact ) ,compiling it and
 creating a rule ( a simple test rule).

 To run the Rule i also created StatefulKnowledgeSession in that i added
 facts from dynamically compiled class.

 up to this point i was succeded.

 now when i call ksession.fireAllRules() it is not displaying any message
 from rule engine.i have done several trails and no luck...

 Added the following JARS in WEB-INF\lib

 antlr-runtime-3.1.1.jar
 core-3.4.2.v_883_R34x.jar
 drools-api-5.0.1.jar
 drools-core-5.0.1.jar
 drools-decisiontables-5.0.1.jar
 mvel2-2.0.10.jar
 drools-compiler-5.0.1.jar
 xstream-1.3.1.jar




 suggest me any ideas .

 regards
 Hemanth
 --
 View this message in context:
 http://www.nabble.com/Drools-engine-not-working-tp26004131p26004131.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] JDT, JCI and Janino

2009-10-21 Thread Leonardo Gomes
Hi Guys,

I was wondering why am I limited to JDT and Janino compiler (using Drools
4.0.7)?

Using JCI I would theoretically be able to plug another compiler (javac?),
wouldn't I?

I had a look at the JavaDialectConfiguration and it doesn't allow anything
other than:

- org.eclipse.jdt.internal.compiler.Compiler
- org.codehaus.janino.Parser

Thanks in advance!

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


[rules-users] Creating rules from an UI

2009-10-19 Thread Leonardo Gomes
Hi Guys,
I have an UI that allows users to create rules in admin interface of my
application. I'm thinking about generating drl text out of the UI state (I'd
have an object model that would be populated by it), but was wondering if
there would be a way to programmatically create the rules instead of having
this object-drl step.

Advice is welcome!

Thanks in advance.

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


[rules-users] Guvnor and Drools 4.0.7

2009-08-20 Thread Leonardo Gomes
Hi All -

Is Guvnor meant to work only with Drools 5?

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