Decision Tree input?
by Wilson O Ojwang
All,
Is there something in the works to support Decision Tree Inputs in
addition to Decision Table?
Regards
Wilson
14 years, 4 months
ANT Compile issues
by Bhamidi, Krishna
Hi,
I am using DROOLs 5.0.0 CR1 and use the compiler from Drools-Ant. When I attempt to execute the rules using a rule agent, I get an exception that in part reads
java.lang.NullPointerException
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1820)
(Full stack follows this e-mail.) However, when I download the pkg file for the same ruleset from Guvnor and use it in the rule agent, it runs fine.
I use the following for building -
<taskdef name="compiler" classname="org.drools.contrib.DroolsCompilerAntTask" classpathref="compiler.classpath" />
<compiler srcdir="../${rulesDirectory}" tofile="../${buildDirectory}/${projectName}_rules.pkg"
classpath="../${buildDirectory}/${projectName}_rules.jar"
binformat="package">
<include name="*.drl" />
<include name="*.brl" />
<include name="*.xml" />
<include name="*.dslr" />
<include name="*.xls" />
</compiler>
What I should do to compile correctly?
Full Stack
java.lang.NullPointerException
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1820)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at org.drools.rule.DialectRuntimeRegistry.readExternal(DialectRuntimeRegistry.java:41)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1755)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1717)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at org.drools.rule.Package.readExternal(Package.java:197)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1755)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1717)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at org.drools.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:189)
at org.drools.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:158)
at org.drools.agent.FileScanner.readPackage(FileScanner.java:136)
at org.drools.agent.FileScanner.getChangeSet(FileScanner.java:82)
at org.drools.agent.FileScanner.loadPackageChanges(FileScanner.java:56)
at org.drools.agent.DirectoryScanner.loadPackageChanges(DirectoryScanner.java:69)
at org.drools.agent.RuleAgent.checkForChanges(RuleAgent.java:410)
at org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:362)
at org.drools.agent.RuleAgent.configure(RuleAgent.java:347)
at org.drools.agent.RuleAgent.init(RuleAgent.java:247)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:187)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:147)
14 years, 6 months
Performance of compiler
by Christian Nedregård
Hi.
My environment: Win XP SP3, 2x2.13 GHz cpu, 3GB RAM, Drools 4.0.7, JDK
1.4.2_11, java compiler: JANINO, dialect: java.
We have about 850 drl's with 5 - 10 conditions in each. 0 -2 evals in each.
The drl's only contain one rule each.
We are using Drools programatically by compiling the drls using
PackageBuilder.addPackageFromDrl and adding them to a RuleBase using
RuleBase.addPackage(PackageBuilder.getPackage())
When we are building our rule base we are never able to compile more than 1
-2 rules per second, which means we need over 10 minutes (at 100% cpu) to
build our rulebase.
Profiling shows 68% cpu time in
org.drools.rule.builder.GroupElementBuilder.build and 18% cpu time in
org.codehaus.janino.Compiler.compile.
We have experimented by changing the compiler to ECLIPSE and the dialect to
mvel but the results are the same.
We have experimented using one PackageBuilder instance per drl or grouping
drls by package and sharing a builder per package. Same result in both
scenarios.
We have also expermimented with compiling concurrently in serveral threads.
Again, about the same result.
My question is: Is this the performance we can expect from the compiler or
are we doing something fundamentally wrong?
Below is an example of one of our drls. This one contains no evals, but
still takes more than 1 second to compile. If anyone can spot some issues
with the way we are doing things the feedback would be much apreciated :)
------------------------------------
package domain.core.productoffer.rules.subscriptiontype
import type.productoffer.ProductOfferRuleEvent
import domain.core.subscription.Subscription
import domain.core.subscription.SubscribedService
import type.subscription.ActionTypeEnum
import domain.core.productoffer.ProductOffer
import domain.rules.RuleEvent
global domain.core.productoffer.RuleValidationReport validationResult
rule "RequiredVProducts"
when
ProductOfferRuleEvent(id == '3')
ProductOffer(id.value == 31963)
$subscription:Subscription()
not ( SubscribedService(status != ActionTypeEnum.REMOVE_CANCEL &&
productId.value in (57, 69) ) from
$subscription.getAllChildSubscribedServices())
then
validationResult.addValidationMessage("2069", "For product offer
rule event with id '3' and product offer with id=31963 subscription must
have one of the following VProducts: 57, 69.");
end
------------------------------------
Regards
Christian Nedregård
14 years, 8 months
Conversion from Normal Decision Tables to Web-Based Tables and vice-versa
by Vikrant Yagnick
Hi All,
I am wondering if anyone has had a requirement where they would need to convert their normal decision tables into web-based decision tables(or vice-versa).
If someone has already done this, can they share either some code or pointers to how this can be done? (I guess it will involving parsing the Excel and creating the XML for the decision table).
Will this be a useful feature to have?
Cheers,
Vikrant
MASTEK LTD.
Mastek is in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCOMASTEK
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 years, 1 month
loading rules dynamically
by techy
Hi,
If the rules,conditions,consequences have to loaded from the database. I
can think of following two approach. what would be right approach( I will
have upto 1200 rules in the db)
1. Programmatically inject the rules into rule engine using drools API.
2. Read the rules from the database and create drl or dsl file for them and
inject into rule engine.
Thanks
--
View this message in context: http://www.nabble.com/loading-rules-dynamically-tp20274919p20274919.html
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 2 months
Why is a flat object recommended?
by Christie, Blair
In the documents this is dicussed briefly:
"). Object models can often have complex relationships and hierarchies
in them - for rules you will want to simplify and flatten the model
where possible, and let the rule engine infer relationships (as it
provides future flexibility."
What does it mean that the rule engine can infer relationships?
Are there performance reasons for having a flat model?
Cheers,
Blair
15 years, 3 months
impossible to dispose tomcat devloader when i reload context (drools keep reference)...
by Emmanuel GREFFET (France)
Hello
I'm Emmanuel from France. (sorry for my English)
We use drools 4.0.7 in a hospital application.
We load drools and our programs (services) with tomcat Devloader (5.5.9)
We use drools in statefullsession (retract and insert facts by rules in a
ruleFlow).
everything is perfect for us, except a little problem of "dispose" with
tomcat due to drools.
Through the Tomcat console when we try to restart our webapp, tomcat can't
dispose the old Devloader
(in Eclipse we can see that many drools class use class attribute
ClassLoader without any dispose ???)
In production, we used different webapps in a Tomcat, so we can't easely
stop Tomcat, so until we stop tomcat, the reload of the webapps is longer
and longer ... (many devloader(s) can't dispose)...
anyone has had this problem ?
Thank you.
Emmanuel
--
View this message in context: http://www.nabble.com/impossible-to-dispose-tomcat-devloader-when-i-reloa...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 4 months
Problems setting MySQL for the human task process server....
by Cristiano Gavião
Hi,
I was trying to change the persistence settings for human task process
server for using MySQL instead of H2DB.
I was following the Drools Flows Documentation on chapter 5.1.3.:
Configuring Persistence.(https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBui...
#d0e1157)
I read on docs that I should override the persistence.xml of the
drools-process-enterprise.jar, create the drools.session.conf with
some contents (i don`t undestand` what it is...) and put them on my
project META-INF directory... ok?
I created the files as stated on docs but it didn't work... My
example runned ok, but using the H2DB and not my MYSQL.
// Use persistence.xml configuration
emf =
Persistence.createEntityManagerFactory("org.drools.persistence.jpa");
taskService = new TaskService(emf);
taskSession = taskService.createSession();
server = new MinaTaskServer(taskService);
Thread thread = new Thread(server);
thread.start();
Thread.sleep(500);
System.out.println("Server started ...");
<properties>
<property name="hibernate.dialect"
value="org.hibernate.dialect.MySQL5Dialect" />
<property name="hibernate.connection.driver_class"
value="com.mysql.jdbc.Driver" />
<property name="hibernate.connection.url" value="jdbc:mysql://
localhost/drools" />
<property name="hibernate.connection.username" value="root" />
<property name="hibernate.connection.password" value="" />
<property name="hibernate.connection.autocommit" value="false" />
<property name="hibernate.max_fetch_depth" value="3" />
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
<property name="hibernate.show_sql" value="true" />
</properties>
After some investigation I could see that the example recommended by
Mark Proctor (TaskLifeCycleTest.java, and others that use
MinaTaskServer) use <persistence-unit name = "org.drools.task"> that
is setting on drools-process-task.jar and not the
"org.drools.persistence.jpa" on drools-process-enterprise.jar as
stated on documentation...
First question, which one should I use for use the Drools Flows Server
and Client?
emf =
Persistence.createEntityManagerFactory( "org.drools.task" );
emf =
Persistence.createEntityManagerFactory("org.drools.persistence.jpa");
I test the first option. I changed the persistence.xml file and use
the code below:
// Use persistence.xml configuration
emf = Persistence.createEntityManagerFactory("org.drools.task");
taskService = new TaskService(emf);
taskSession = taskService.createSession();
server = new MinaTaskServer(taskService);
Thread thread = new Thread(server);
thread.start();
Thread.sleep(500);
System.out.println("Server started ...");
Hummm.... It runs and connect well to my MySQL. but now it brings me a
error...
java.lang.IllegalArgumentException: Named query not found:
UnescalatedDeadlines
at
org
.hibernate
.ejb
.AbstractEntityManagerImpl
.createNamedQuery(AbstractEntityManagerImpl.java:108)
at org.drools.task.service.TaskService.<init>(TaskService.java:84)
at org.drools.task.service.TaskService.<init>(TaskService.java:68)
It sounds like it was not possible to find orm.xml that is on META-INF
of drools-process-task.jar.
But when I copy the orm.xml file to my project META-INF it works ok....
Could someone give some ideas how can I solve this problem..
Thanks a lot
Cristiano
15 years, 4 months
Customize the UI
by Rads2029
Hi,
Can anyone give me an example of what exactly needs to be done if I need to
use my own custom UI for rule creation etc. ( In this case my UI is Flex)
As per the rules documentation , we need to to use the ServiceImplementation
class which implements the RepositoryService. ( both of these are in the
package structure org.drools.guvnor.server)
However I could not find any jar where these classes are readily available.
:-((
It would be great if i can get pointers to the jar location and also a small
end to end example of how to plug in custom UI to call the drools guvnor (
brms) service.
Thanks,
Radha
--
View this message in context: http://www.nabble.com/Customize-the-UI-tp23132164p23132164.html
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 4 months
Drools Flow Trigger process by ruleset
by Garrett Conaty
I've seen in the latest docs on trunk that it's possible to set some
constraints on a start node so that a process would execute when the
appropriate rules matched.
However I can't see an example of this, nor can I edit the properties
through the Eclipse UI.
Is it possible to define a condition under which the process will
execute and then have the process start when the rule matches. Is
this done external to the rule file or can it be done on the rulefile
itself? I could see a few ways of doing this and am looking for some
guidance towards the correct (read as easiest for biz users) method.
1) Kick off a process that the first node after the start is a
ruleflow group (serving basically as a gate)
2) Deploy a rule that when it matches starts up the process (separate
rule file and separate ruleflow file)
3) Define a start condition in the rule file and deploy the process.
Then whenever the rule matches, a process instance is started.
Personally I like #3 and the docs seem to imply it's possible, but I
can't see how.
Thanks,
Garrett
15 years, 6 months