What project I should be looking to use
by Kishore Chintoju
Hi Guys,
We are incorporating rules engine into our project.
As part of this we will building a web based rules UI to be used by our
customers to create/edit rules (aka Guvnor, but not as generic and full
fledged) . All of the rules will be persisted to DB.
We have prototyped the getting the rules of of DB and invoking rules engine
on the loaded rules part, which was working.
Now I'm prototyping the create and persist rule to DB part.
I was looking through the *drools-compiler* and *drools-template *APIs to
see the classes I should be using to do this.
I have the following questions.
1. We have decided to save the rules into the DB as DRL, is this the
right approach
2. Which of *drools-compiler *and *drools-template *has the appropriate
API for creating a rule element in memory and parse it into DRL (to be
stored in DB),
1. Am I looking at the right projects for the job or should I be
looking somewhere else?
2. I'm looking through the api, but any pointers/articles which will
help me through will be appreciated.
Cheers
Kishore
15 years, 4 months
Re: [rules-users] Drools5 in tomcat 5
by Rubén Marrero
Oh!
I'm tempted to ask _why_ did anyone think that having a great web interface where you can create, test, store & version (I would think that at least exposing and securing) business tulers simply should fall short of _executing_ said rules? If Guvnor (or some other component, I'm learning here) could help me outsource my business rules, I could use in no matter what platform/ language. All the java coders could embed it and the rest of us could just execute it.
But I won't ask :)
Instead let me rephrase my original question. What's the best way to setup a remote server, that can receive my data, go through the rules, and return a response? That does not involve java coding? drools-server?
Thanks,
Rubén
De: "Esteban Aliverti" <esteban.aliverti(a)gmail.com>
Para: "Rules Users List" <rules-users(a)lists.jboss.org>
CC: "Diego Fabian Lopez Ruiz" <diego(a)lingo.mx>
Enviados: Viernes, 14 de Mayo 2010 12:09:35
Asunto: Re: [rules-users] Drools5 in tomcat 5
Bad news! Guvnor doesn't execute the rules! It only acts as a repository! You can create your rules, test your rules and versioning them too, but if you want to execute them in a real business scenario, you have to code it. I know Drools already has some modules to do what you are trying to achieve, they are drools-pipeline (Which can use camel) or even drools-server (which is a simple servlet that executes commands). Unfortunately I'm not an expert on those modules, but you can always ask here for help.
Best,
2010/5/14 Rubén Marrero < ruben(a)lingo.mx >
The idea is to use Guvnor as a REST-accessible BRMS.
We'll design, edit, test rules in guvnor, then execute them from the PHP web app in the background (with cURL or something ) or maybe we'll use proper webservices, as long as we can keep thing simple.
Since we are already using tomcat 5 as our reporting endpoint, we'd like to just add the guvnor as a web app, as long as guvnor can execute the rules we setup in the nice web interface and respond with a json package to a REST json request.
Guvnor _does_ execute rules, right? :-)
I'll try removing the jars you mention and then report back.
Thx,
Rubén
De: "Esteban Aliverti" < esteban.aliverti(a)gmail.com >
Para: "Rules Users List" < rules-users(a)lists.jboss.org >
Enviados: Viernes, 14 de Mayo 2010 6:49:53
Asunto: Re: [rules-users] Drools5 in tomcat 5
I didn't test Guvnor in Tomcat 5, but I did it in Tomcat 6. The only thing you need to do is to remove el-ri-xxx.jar and el-api-xxx.jar from Guvnors libraries (open the war file, browse to WEB-INF/lib and remove the files). This is because Tomcat already provides this libraries. That is the only thing I have to do when I want to use Guvnor deployed in a Tomcat.
And remember that Drools is just a framework (a bunch of jars if you want), so you can use it everywhere: console app, desktop app, web app. Guvnor is a BRMS that you can use to create your rules, manage their life cycle and set as main repository (You can do more things too). It is important to make this distinction, maybe you just want to use drools expert/flow/fusion and not Guvnor.
Best,
2010/5/14 Rubén Marrero < ruben(a)lingo.mx >
Hi all:
I want to add drools to a php application. Currently we are using Tomcat 5 to execute BIRT reports and works great.
We want to keep using Tomcat (this version in particular) and just drop the Drools WAR so to disturb as little as possible our current setup.
Is Tomcat 5 a supported platform to run Drools 5? any pointers to current docs?
Thanks in advance,
Rubén
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
15 years, 4 months
help in date time format
by Sudhir M
Hi,
My requirement is to compare two dates one a date object and the other
a date literal. In comparison it should also consider time. There is
format given for date literal (dd-mmm-yyy) but how can we add time to
it? I tried adding time it doesn't complain but seems to ignore the
time part in the date literal.
below is the example
Exam(name=="Math", examDate<="13-may-2010") this is my pattern.
tried
Exam(name=="Math", examDate<="15-may-2010 17:00:00") but time ignored
while executing.
Is there any format for DateTime?
Thanks,
sudhir.
15 years, 4 months
Reg : class cast error when use "from collect " key word
by dilip
Hi All,
I am getting the following eror when i use "from collect" key word. Help me to resolve this.Thanks in advance to all.
my rule is....
Rule "test"
when
$inputObj : QuotationSearchFormObject( extensions != null )
QuotationLineExt( $locFrmLabel:label == 'Location From' , value != null , $locFromValue : value ) from $inputObj.getExtensions()
i : ArrayList( size > 0 ) from collect ( QuotationLine( extensions != null ) from $totList);
then
System.out.println("success");
end
Error marked in red colour line.
java.lang.ClassCastException: org.drools.reteoo.CollectNode$CollectMemory cannot be cast to org.drools.reteoo.FromNode$FromMemory
at org.drools.reteoo.FromNode.assertLeftTuple(FromNode.java:93)
at org.drools.reteoo.CompositeLeftTupleSinkAdapter.doPropagateAssertLeftTuple(CompositeLeftTupleSinkAdapter.java:145)
at org.drools.reteoo.CompositeLeftTupleSinkAdapter.createAndPropagateAssertLeftTuple(CompositeLeftTupleSinkAdapter.java:57)
at org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:142)
Thanks
Dilip.
15 years, 4 months
Schedule Rules to Fire in Drools Expert
by andre.fonseca@mail.com
Hi all,
It's possible to schedule (and reschedule) rules to fire in Drools Expert?
As my understood the Agenda is a kind of TODO list right? Can I reorder the priority of that list so?
Could someone give-me and idea (a pseudo-code or something like that) to show that concept?
Thanks In Advance!
15 years, 4 months
Re: [rules-users] Drools5 in tomcat 5
by Rubén Marrero
The idea is to use Guvnor as a REST-accessible BRMS.
We'll design, edit, test rules in guvnor, then execute them from the PHP web app in the background (with cURL or something ) or maybe we'll use proper webservices, as long as we can keep thing simple.
Since we are already using tomcat 5 as our reporting endpoint, we'd like to just add the guvnor as a web app, as long as guvnor can execute the rules we setup in the nice web interface and respond with a json package to a REST json request.
Guvnor _does_ execute rules, right? :-)
I'll try removing the jars you mention and then report back.
Thx,
Rubén
De: "Esteban Aliverti" <esteban.aliverti(a)gmail.com>
Para: "Rules Users List" <rules-users(a)lists.jboss.org>
Enviados: Viernes, 14 de Mayo 2010 6:49:53
Asunto: Re: [rules-users] Drools5 in tomcat 5
I didn't test Guvnor in Tomcat 5, but I did it in Tomcat 6. The only thing you need to do is to remove el-ri-xxx.jar and el-api-xxx.jar from Guvnors libraries (open the war file, browse to WEB-INF/lib and remove the files). This is because Tomcat already provides this libraries. That is the only thing I have to do when I want to use Guvnor deployed in a Tomcat.
And remember that Drools is just a framework (a bunch of jars if you want), so you can use it everywhere: console app, desktop app, web app. Guvnor is a BRMS that you can use to create your rules, manage their life cycle and set as main repository (You can do more things too). It is important to make this distinction, maybe you just want to use drools expert/flow/fusion and not Guvnor.
Best,
2010/5/14 Rubén Marrero < ruben(a)lingo.mx >
Hi all:
I want to add drools to a php application. Currently we are using Tomcat 5 to execute BIRT reports and works great.
We want to keep using Tomcat (this version in particular) and just drop the Drools WAR so to disturb as little as possible our current setup.
Is Tomcat 5 a supported platform to run Drools 5? any pointers to current docs?
Thanks in advance,
Rubén
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
15 years, 4 months
issue with 'forall'
by Michal Bali
Hi,
I have encountered the following problem with the latest Drools 5.1 SNAPSHOT
I've created a sample Drools project and replaced the Sample.drl with the
following:
--Sample.drl--------------------------------------
package com.sample
import com.sample.DroolsTest.Message;
rule "Hello World"
when
forall( Message( )
Message() )
then
System.out.println("executed");
end
--------------------------------------------
If I run the sample application like this everything is fine - "executed"
is printed. However, if I modify the main method and insert some additional
fact just before the message fact is inserted, like this:
--DroolsTest.java-----------------------------------
.....
ksession.insert(new Object());
ksession.insert(message);
.....
-----------------------------------------------------------
then the rule won't fire any more.
Please note that if you change the fact insertion order (first the message
then the Object) it will work as expected.
Is this a bug or am I missing something? I can file a JIRA if needed.
Thank you!
Best regards,
Michal
15 years, 4 months
ClassCastException: org.drools.reteoo.RuleTerminalNode$TerminalNodeMemory cannot be cast to org.drools.reteoo.EvalConditionNode$EvalMemory
by Paul Ryan
Hi all,
We're receiving some error messages that we don't understand from rules that had conditionals that worked and now don't (no upgrade or anything like that, they just stopped working), any clues as to what kinds of things to look for when we get an error like the following? (if not we can try to pair down to an a test case)
org.drools.runtime.rule.ConsequenceException: java.lang.ClassCastException: org.drools.reteoo.RuleTerminalNode$TerminalNodeMemory cannot be cast to org.drools.reteoo.EvalConditionNode$EvalMemory
at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:23)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:943)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:885)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1086)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:660)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:627)
at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:183)
at com.infotrustgroup.rules.engine.RulesManager.runRules(RulesManager.java:353)
at com.infotrustgroup.util.rules.RuleFileUtil.runRules(RuleFileUtil.java:406)
at com.infotrustgroup.util.rules.RuleFileUtil.runRules(RuleFileUtil.java:370)
at com.infotrustgroup.util.rules.RuleRunner.run(RuleRunner.java:395)
at com.infotrustgroup.util.rules.RuleRunner.call(RuleRunner.java:193)
at com.infotrustgroup.jobs.services.auth.EditionsRulesJobRunner.runRules(EditionsRulesJobRunner.java:87)
Caused by: java.lang.ClassCastException: org.drools.reteoo.RuleTerminalNode$TerminalNodeMemory cannot be cast to org.drools.reteoo.EvalConditionNode$EvalMemory
at org.drools.reteoo.EvalConditionNode.retractLeftTuple(EvalConditionNode.java:199)
at org.drools.reteoo.CompositeLeftTupleSinkAdapter.doPropagateRetractLeftTuple(CompositeLeftTupleSinkAdapter.java:159)
at org.drools.reteoo.CompositeLeftTupleSinkAdapter.propagateRetractLeftTuple(CompositeLeftTupleSinkAdapter.java:68)
at org.drools.reteoo.JoinNode.retractLeftTuple(JoinNode.java:231)
at org.drools.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:239)
at org.drools.reteoo.EntryPointNode.retractObject(EntryPointNode.java:195)
at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1416)
at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1360)
at org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:141)
at org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:154)
at com.infotrustgroup.what.Rule_Transform_SGML_to_XML_0.consequence(Rule_Transform_SGML_to_XML_0.java:48)
at com.infotrustgroup.what.Rule_Transform_SGML_to_XML_0ConsequenceInvoker.evaluate(Rule_Transform_SGML_to_XML_0ConsequenceInvoker.java:34)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:934)
... 11 more
Thanks in advance for your help with this,
-- Paul Ryan
15 years, 4 months
Guvnor meant for business users?
by nxg912
Hello All,
We are evaluating Drools for our production implementation with special
focus on the fact that it would let less technical people be able to work
effectively with business logic (once developers provide them with a data
model). We are relatively new to Drools and our impression has not been too
good specially around Guvnor (given that DRL is meant for developers and DSL
is nothing but a simple extension for DRL which business analyst won't be
able to use). Has anyone here used Guvnor or DSL effectively for a
reasonable size implementation?
With Guvnor we are facing some issue which are very basic and Guvnor comes
across as a immature web application from the UI perspective (Because of
being less user friendly, incomplete messages for error situations etc).
Also, its difficult to find help on some simple scenario like the following,
We have a "Customer" class and a "Agreement" class with one to many
relationship. We are trying to build a simple rule that if an "Agreement"
has missed payment (indicated by a boolean inside Agreement class), mark
that "Customer" as bad customer by setting the boolean field inside the
"Customer" class. Its a simple scenario to be build in DRL but how to we
implement this under 'WHEN' and 'THEN' section in guided editor without
using the DRL free forms? It shows an error message that access/write
property for Customer not available in Agreement.
Any thoughts or help in these matters will be really helpful. Also, if there
are some helpful links around Drools that would help getting started with
the implementation, that would be great!
Thanks in advance.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Guvnor-meant-for-busi...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 4 months
Plugtree’s training course for Drools(tm) in June
by Esteban Aliverti
Hi people! I’m glad to announce that we (Plug Tree: http://plugtree.com)
are preparing a Plugtree’s training course for Drools(tm) during June in
Boston and/or NY the week after the Redhat(tm) Summit.
These courses are going to cover all the Drools(tm) juicy parts from the
insider perspective of a group of community project committers ;-).
We need to know ASAP who is interested, so we can arrange all the details.
Here you can find more information about the event:
http://plugtree.eventbrite.com/
http://plugtree-ny.eventbrite.com/
Plugtree is not associated in any way with Redhat(tm). Drools is a community
project sponsored by JBoss (tm)
--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti
15 years, 4 months