Re: [rules-users] DROOLS PLANNER - getting started

2011-06-07 Thread ge0ffrey
Take a look at the manual on how to get started:
 
http://docs.jboss.org/drools/release/5.2.0.CR1/drools-planner-docs/html_single/index.html#d0e137

To get started in Eclipse, either just download the zip and add the jar
binaries to your classpath.
(Or better: use maven (with optionally m2eclipse), ivy, gradle to depend on
our artifacts declaratively)

Then just build a solver:
 
http://docs.jboss.org/drools/release/5.2.0.CR1/drools-planner-docs/html_single/index.html#d0e1279
and learn from the NQueens and curriculum course example.

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


Re: [rules-users] DROOLS PLANNER - getting started

2011-06-07 Thread ge0ffrey
 Do I need Guvnor also for defining rules?

No, that's an optional improvement you can try to use later. Start with
using plain drl files like in the examples.

The integration between Guvnor and Planner is still very raw, but it's
possible via *SolverConfig.setRuleBase().

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


Re: [rules-users] Exception Handling in the rule

2011-06-07 Thread Swindells, Thomas
Firstly evals have to evaluate true or false - what you have here appears to 
return a string -
presumably you are actually comparing this to some value?

One, not particularly elegant or efficient method is to do the check within 
your eval, eg:

eval(ClaimsHistoryHelper.getClaimDrug(drugRefNo) == null ? false : drugName == 
(ClaimsHistoryHelper.getClaimDrug(drugRefNo)).getDrugName())

If your ClaimsHistoryHelper is doing a time consuming operation (eg going to a 
db  etc), you can probably make a very quick and simple efficiency saving by 
having it cache the last result it searched for/returned (or depending on how 
many drugRefNo you are looking up a more complete caching solution).

Thomas
 -Original Message-
 From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
 boun...@lists.jboss.org] On Behalf Of sdinoo
 Sent: 07 June 2011 06:22
 To: rules-users@lists.jboss.org
 Subject: [rules-users] Exception Handling in the rule

 Hi,

 In my when clause I have an eval statement like this

 eval((ClaimsHistoryHelper.getClaimDrug(drugRefNo)).getDrugName())

 For some reason, there is no DrugRecord for the given drugRefNo and hence
 I get javaNullPointer exceptions I do want to rule to continue evaluation and
 not stop with the error and hence I dont want to handle exception at
 fireAllRules catch block

 How can I handle the exception in the DRL ?





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


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

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

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


[rules-users] Out of Memory Exception While Running Rule

2011-06-07 Thread Satyendra Sharma
I uploaded a decision table with 2200 rules in a package and when I tried to
build the package it throws Exception : java.lang.OutOfMemoryError: PermGen
space
while its working fine with 1200 rules.

Heap size is set to max 1536 (as JBoss in my pc is not accepting more than
that size). 

Please let me know how I deal with this error at the time of building
package, as my requirement is to have around 13000 rules in a single
package.

-
Satyendra Sharma
--
View this message in context: 
http://drools.46999.n3.nabble.com/Out-of-Memory-Exception-While-Running-Rule-tp3033829p3033829.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Out of Memory Exception While Running Rule

2011-06-07 Thread Swindells, Thomas
You may need to increase the perm gen space not the heap size
-XX:MaxPermSize=512m

Thomas
 -Original Message-
 From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
 boun...@lists.jboss.org] On Behalf Of Satyendra Sharma
 Sent: 07 June 2011 10:51
 To: rules-users@lists.jboss.org
 Subject: [rules-users] Out of Memory Exception While Running Rule

 I uploaded a decision table with 2200 rules in a package and when I tried to
 build the package it throws Exception : java.lang.OutOfMemoryError:
 PermGen space
 while its working fine with 1200 rules.

 Heap size is set to max 1536 (as JBoss in my pc is not accepting more than 
 that
 size).

 Please let me know how I deal with this error at the time of building package,
 as my requirement is to have around 13000 rules in a single package.

 -
 Satyendra Sharma
 --
 View this message in context: http://drools.46999.n3.nabble.com/Out-of-
 Memory-Exception-While-Running-Rule-tp3033829p3033829.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users


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

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

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


[rules-users] Need Drools 5.1 in .NET

2011-06-07 Thread yashgt
Hi,

We are trying to use the Drools 5.1 engine in a .NET application and hence
have been trying to convert the JAR files to DLLs. We use IKVM 0.46.* for
the conversion.

We have added all the JARs from the drools 5.1 package to the CLASSPATH. We
run the command:

ikvmc -target:library drools-api-5.1.1.jar

The output we get is similar to:
Note IKVMC0002: output file is drools-api-5.1.1.dll
Warning IKVMC0100: class org.quartz.Calendar not found
Warning IKVMC0111: emitted java.lang.NoClassDefFoundError in
org.drools.runtime
.help.QuartzHelper$QuartzCalendarAdapter.isTimeIncluded(J)Z
Warning IKVMC0100: class com.sun.tools.xjc.Options not found
Warning IKVMC0105: unable to compile class
org.drools.osgi.api.Activator$Drools
(org.quartz.Calendar)
Warning IKVMC0100: class com.thoughtworks.xstream.XStream not found
ServiceTracker
(missing class org.osgi.util.tracker.ServiceTrackerCustomizer)
Warning IKVMC0105: unable to compile class org.drools.osgi.api.Activator
(missing class org.osgi.framework.BundleActivator)
Warning IKVMC0100: class org.osgi.framework.BundleContext not found
Warning IKVMC0100: class org.osgi.framework.ServiceReference not found
Warning IKVMC0100: class org.drools.osgi.api.Activator not found
Warning IKVMC0111: emitted java.lang.NoClassDefFoundError in
org.drools.osgi.ap
i.Activator$BundleContextInstantiator.call()Ljava.lang.Object;
(org.osgi.framework.BundleContext)

We have done the above process for all the JAR files in the drools folder.

The DLLs do get created and we are able to compile our .NET application to
use the classes. But during execution at:
 KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();

We get the exception that says:
- IllegalArgumentException : Unable to instantiate service for Class
'org.drools.builder.KnowledgeBuilderFactoryService 
- ClassNotFoundException:
org.drools.builder.impl.KnowledgeBuilderFactoryServiceImpl

The jar files are already in the CLASSPATH when we run the .NET app .

I am not sure whether these errors are due to the Warnings we see during
conversion. 

If anyone has been successful in obtaining a DLL from drools 5.1, kindly let
me know the steps.

Thanks and regards,
Yash

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


Re: [rules-users] Need Drools 5.1 in .NET

2011-06-07 Thread Esteban Aliverti
Have you also converted drools-compiler-x.jar?

Best Regards,



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


On Tue, Jun 7, 2011 at 9:41 AM, yashgt yas...@gmail.com wrote:

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


Re: [rules-users] Need Drools 5.1 in .NET

2011-06-07 Thread Mark Proctor
You will need ot do this for all the transititive dependencies too. 
Quartz is an optional dependency JAR, seems IKVM is insisting those are 
available on the .net classpath.

Maven will output a graph of transititive dependencies for you to view.

Once you get this working, please post details online :)
http://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html


Mark
On 07/06/2011 13:41, yashgt wrote:
 Hi,

 We are trying to use the Drools 5.1 engine in a .NET application and hence
 have been trying to convert the JAR files to DLLs. We use IKVM 0.46.* for
 the conversion.

 We have added all the JARs from the drools 5.1 package to the CLASSPATH. We
 run the command:

 ikvmc -target:library drools-api-5.1.1.jar

 The output we get is similar to:
 Note IKVMC0002: output file is drools-api-5.1.1.dll
 Warning IKVMC0100: class org.quartz.Calendar not found
 Warning IKVMC0111: emitted java.lang.NoClassDefFoundError in
 org.drools.runtime
 .help.QuartzHelper$QuartzCalendarAdapter.isTimeIncluded(J)Z
 Warning IKVMC0100: class com.sun.tools.xjc.Options not found
 Warning IKVMC0105: unable to compile class
 org.drools.osgi.api.Activator$Drools
 (org.quartz.Calendar)
 Warning IKVMC0100: class com.thoughtworks.xstream.XStream not found
 ServiceTracker
 (missing class org.osgi.util.tracker.ServiceTrackerCustomizer)
 Warning IKVMC0105: unable to compile class org.drools.osgi.api.Activator
 (missing class org.osgi.framework.BundleActivator)
 Warning IKVMC0100: class org.osgi.framework.BundleContext not found
 Warning IKVMC0100: class org.osgi.framework.ServiceReference not found
 Warning IKVMC0100: class org.drools.osgi.api.Activator not found
 Warning IKVMC0111: emitted java.lang.NoClassDefFoundError in
 org.drools.osgi.ap
 i.Activator$BundleContextInstantiator.call()Ljava.lang.Object;
 (org.osgi.framework.BundleContext)

 We have done the above process for all the JAR files in the drools folder.

 The DLLs do get created and we are able to compile our .NET application to
 use the classes. But during execution at:
   KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();

 We get the exception that says:
  - IllegalArgumentException : Unable to instantiate service for Class
 'org.drools.builder.KnowledgeBuilderFactoryService
  - ClassNotFoundException:
 org.drools.builder.impl.KnowledgeBuilderFactoryServiceImpl
   
 The jar files are already in the CLASSPATH when we run the .NET app   .

 I am not sure whether these errors are due to the Warnings we see during
 conversion.   

 If anyone has been successful in obtaining a DLL from drools 5.1, kindly let
 me know the steps.

 Thanks and regards,
 Yash

 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/Need-Drools-5-1-in-NET-tp3034264p3034264.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] Out of Memory Exception While Running Rule

2011-06-07 Thread Mark Proctor
On 07/06/2011 11:46, Swindells, Thomas wrote:
 You may need to increase the perm gen space not the heap size
 -XX:MaxPermSize=512m
you can also try using the MVEL dialect instead.

Mark
 Thomas
 -Original Message-
 From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
 boun...@lists.jboss.org] On Behalf Of Satyendra Sharma
 Sent: 07 June 2011 10:51
 To: rules-users@lists.jboss.org
 Subject: [rules-users] Out of Memory Exception While Running Rule

 I uploaded a decision table with 2200 rules in a package and when I tried to
 build the package it throws Exception : java.lang.OutOfMemoryError:
 PermGen space
 while its working fine with 1200 rules.

 Heap size is set to max 1536 (as JBoss in my pc is not accepting more than 
 that
 size).

 Please let me know how I deal with this error at the time of building 
 package,
 as my requirement is to have around 13000 rules in a single package.

 -
 Satyendra Sharma
 --
 View this message in context: http://drools.46999.n3.nabble.com/Out-of-
 Memory-Exception-While-Running-Rule-tp3033829p3033829.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

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

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

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




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


Re: [rules-users] Need Drools 5.1 in .NET

2011-06-07 Thread yashgt
The compile-x.jar has also been converted.

In fact all the jar files have been converted. 

IKVMC does the conversion. I would assume that as long as all the original
JARs are in the classpath, IKVMC should not have any issue in the conversion
and things should go through smoothly.

Am I getting the error because the conversion had warnings or because the of
something else?

Regards,
Yash

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


Re: [rules-users] Out of Memory Exception While Running Rule

2011-06-07 Thread drdaveg
I have run several times this number of rules with Drools.  Mark is right
that adding Permgen space will help, but you can also reduce the size of
your identifiers to use less Permgen memory.   

The harder issue to handle is running out of heap memory if you run a few
thousand more rules: at some point the time required for compiling rules and
inserting objects goes up dramatically due to thrashing.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Out-of-Memory-Exception-While-Running-Rule-tp3033829p3035881.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] Lazy (Just-In-Time) Loading of Facts

2011-06-07 Thread danny.robinson
I'm new to Drools, and really need to know if the engine can support lazy
loading of fact objects using declared types.  Maybe I'm coming at this
wrong, but I want to avoid retrieval for attributes that are not referenced
during rule execution, and only retrieve attributes as the first time they
are used in the current evaluation as some objects could come from database
or other systems.

In coding terms:

if x==false  y==true

then, I should never need to retrieve 'y'.

In addition, I cannot use pojo's at design time, as my data structures are
defined by the business and loaded at runtime, so I tried looking at
declared types, but I'm not certain these will support lazy loading.

Thanks,

Danny



--
View this message in context: 
http://drools.46999.n3.nabble.com/Lazy-Just-In-Time-Loading-of-Facts-tp3036267p3036267.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] TimerService vs TimeMachine and date-effective

2011-06-07 Thread Mark Proctor
On 07/06/2011 21:35, David Goldstein wrote:
 Mark,

 Thanks.  Based upon your discussion and the manuals, I was looking for
 the Quartz jars but haven't been seeing them.  Are they bundled?  From
 the org.drools.runtime I am wondering if I should be instead
 implemeting org,drools.runtime.Calendars?
Drools doesn't use quartz scheduler. What we do allow is a quartz 
calender to be used. We have our own calendar interface, but provide an 
adapter so our scheduler can work with a quartz calendar.

Mark

 By the way, often in Drools I see an API to get from a list or hashmap
 of something (e.g., calendars, working memories,
 workingmemoryinstances).  However, if you have only one of the things
 (like one calendar or one session) what should I pass to the
 .get(string) method to access the one item?

 Also, the source code includes SCenarioRunner.java which seems to be
 no longer valid.

 Thanks.

 David


 On Mon, Jun 6, 2011 at 10:41 AM, Mark Proctormproc...@codehaus.org  wrote:
 On 06/06/2011 15:32, drda...@gmail.com wrote:
 Mark,

 I thought I had submitted a follow-up to this, but perhaps not.  I'm
 sending this to you instead of the list to avoid generating excess traffic.

 I looked at CR1 and am going to look at it's source today.  But neither
 the examples in the Drools PDF or Quartz look compatible for a clock that
 would work with date-expires and date-effective of rules.  Quartz looks
 great for rules, processes and events that run on heatbeats (e.g., a cron
 schedule) but it looks so foreign for use as a system clock I wonder if
 date-expires and date-effective have been tested with the clock?  Might you
 have an example or JUnit for this setup?

 I will look for one in Guvnor's source code today, where rule testing with
 a simulated date should have a JUnit.
 This is in Rule and shows how effective dating works.
 Calendar now = Calendar.getInstance();
 now.setTimeInMillis(
 workingMemory.getSessionClock().getCurrentTime() );

 if ( this.dateEffective != null  this.dateExpires != null ) {
 return (now.after( this.dateEffective )  now.before(
 this.dateExpires ));
 } else if ( this.dateEffective != null ) {
 return (now.after( this.dateEffective ));
 } else {
 return (now.before( this.dateExpires ));
 }

 Unit testing should use the Pseduo clock, for the session clock, where you
 can manually set the time.

 Mark
 Thanks!

 David Goldstein

 quote author='Mark Proctor'
 On 01/06/2011 21:37, drdaveg wrote:
 A common issue that I am looking into is setting the execution date to
 test
 future or legacy rules (i.e., with dates that are not the system date.)
   A
 number of users have posted about TimeMachine, TimeServices and the
 perils
 of setting the system date - but a JIRA lists TimeMachine as being remove
 and TimeServices doesn't look like it has a setter for the execution
 time.

 What is the API for simulating the date to be compared against effective
 and
 expiration dates of rules that can be used by stateful sessions?
 in upcoming drools 5.2, see CR1. TimeMachine was removed. Everything
 should now work around the session clock, where it can use the system
 clock or a pseudo clock.

 Mark
 --
 View this message in context:

 http://drools.46999.n3.nabble.com/TimerService-vs-TimeMachine-and-date-effective-tp3012560p3012560.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

 /quote
 Quoted from:

 http://drools.46999.n3.nabble.com/TimerService-vs-TimeMachine-and-date-effective-tp3012560p3012634.html







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