Declaration of Metadata tags for External Data Models in Guvnor.
by Meyer, David A
I have a set of externally defined java beans that are utilized elsewhere in
the overarching application, and would like to declare these external
classes as events within drools. I am able declare these objects as events,
and compile a drools DRL file, and execute the rules. When the same DRL is
imported into the Guvnor, the resulting package "PKG" issues an "unable to
define Type Declaration class {object}" exception error. Preliminary
investigation has turned up JIRA #'s GUVNOR-379
<https://jira.jboss.org/jira/browse/GUVNOR-379>, and BRMS-144
<https://jira.jboss.org/jira/browse/BRMS-144>, that indicate this behavior
has been identified, but no solution is presented. The Drools documentation
for both the expert and fusion component functionality indicates that
metadata can be declared with or without actually declaring fields. This
capability is key to allowing the utilization of externally defined data
model objects within drools.
Example DRL declaration section that works as specified when the DRL file is
built into a knowledge base, but does not work when the Guvnor package is
built in to a knowledge base. I am currently utilizing Drools 5.0.1 in both
the IDE development environment as well as the Guvnor deployment
environment.
begin data model fragment .
Import com.datamodel.MyEvent;
Declare MyEvent
@role(event)
@timestamp(eventDate)
end
. end data model fragment
Seems that the data model definition shown above should produce the same
results whether using the DRL resource type, or the PKG resource produced by
the Guvnor package builder. Are these JIRA's closed in 5.1 or are they
still pending. The system utilizing the Guvnor should allow deployment of
DRLs to the GUVNOR without change, this bug does not allow that.
David A. Meyer
System Engineer
I&SS Mission Operations - Colorado
Boeing Defense, Space & Security
The Boeing Company
Telephone 303-307-5836
15 years, 11 months
Drools Expert (Rule Engine) - Performance Tips
by andre.fonseca@mail.com
Hi all,
I need to perform a test in the Drools Rule Engine. This test is intended to discover the SLA for Rule Processing.
The scenario that I have is:
- My Knowledge Database will have almost 200 million records.
- There will be a full monthly charge and a short diary charge in this KD.
- The Rules are not so complex. (6 or 7 levels at most)
How can I perform this test? Could you please give me some advices?
Another question: How Drools integrate with the Knowledge Database assuming this is already created? (Actually this KD will be created using a ETL process)
Thanks for your support, any advice will be appreciated.
=
15 years, 11 months
RuntimeDroolsException as Solver concludes execution
by dweppenaar
Hi.
I am experiencing the following exception:
org.drools.RuntimeDroolsException: Exception executing ReturnValue
constraint org.drools.rule.ReturnValueRestriction@a5f6c234 :
java.lang.NullPointerException.
The rule that is causing the exception to occur is the following:
rule "spreadOvertime"
when
$violatingTask :
MaintenanceTask(eval(maintenanceSlot.getAvailability() == 1), motor != null,
maintenanceTechnician != null, $overtimeTaskID : id);
ArrayList( $numberOfViolations : size ) from collect(
MaintenanceTask(
id == ($overtimeTaskID + 1) ||
id == ($overtimeTaskID + 2) ||
id == ($overtimeTaskID - 1) ||
id == ($overtimeTaskID - 2),
eval(maintenanceSlot.getAvailability() >= 1) ) );
then
insertLogical(new IntConstraintOccurrence("spreadOvertime",
ConstraintType.NEGATIVE_SOFT,
$numberOfViolations, $violatingTask, $numberOfViolations));
//System.out.println("Rule Fired: spreadOvertime ( number of
violations:" + $numberOfViolations + " for task " + $violatingTask + ")");
end
The purpose of the rule is to spread the closer to normal maintenance
shifts.
Just to clarrify what the objects are:
MaintenanceTask: Consists of a MaintenanceSlot, MaintenanceTechnician and
Motor
MaintenanceSlot: Day, Timeslot, Availability and Index
The 'availability' of a MaintenanceSlot specifies whether it is considered
Overtime, ProductionTime or Normal Maintenance
This exception is thrown at the end of solving as the solver (I presume) is
supposed to return the best solution. The score is calculating and updating
but at the end of the specified step count, this exception occurs.
If I comment this rule out, no exception.
Any help would be appreciated!
Regards,
De Ville
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/RuntimeDroolsExceptio...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 11 months
Running Sub-process only once in rule flow
by Adeyinka Timi
Hi,
Is it possible to set some kind of RUN-ONLY-ONCE restriction on a
sub-process in a rule flow, to avoid running this process multiple times in
the case of a cycle in the rule-flow?
-Ade
15 years, 11 months
Load balancing, fail-over, replication
by Bertrand Grottier
Hello,
I am evaluating the possible use of Drools to implement a pricing engine. Until now, I have developped my prototypes on my own computer; everything was fine.
However, if Drools is retained, it will be used in a shared environment. More precisely, a shared platform is provided for different customers, each one having its own set of rules. This raises issues such as load balancing, replication and so on.
Which architecture is recommended ? How can these issues be addressed ?
This is very fuzzy to me. I am not even sure that they are Drools related...
Thank you in advance for your help.
Regards,
Benoît
_________________________________________________________________
Consultez vos emails Orange, Gmail, Yahoo!, Free ... directement depuis HOTMAIL !
http://www.windowslive.fr/hotmail/agregation/
15 years, 11 months
Drools3 syntax fails in Drools5
by agopalkr
I am trying to migrate from Drools3 to Drools
There is one particular syntax which works in Drools3 but not in Drools5.
rule "Test Long2"
when
//Gives error in D5
m : MyLongValue(id1)
then
System.out.println("did it2:::::" + m);
end
The question I have is
1. What is the meaning of the syntax MyLongValue(id1) ?
2. What is the equivalent syntax in Drools5?
MyLongValue {
private Long id1;
public void setId1(Long x) {
id1 = x;
}
public Long getId1() {
return id1;
}
}
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools3-syntax-fails-...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 11 months
RPC call exception with drools guvnor
by Dominik Hüttner
Hi,
I use drools guvnor first version 5.1.0, but now I have to use 5.0.1.
On the PC, it has to work on, the following error is produced, when I enter
the drools webpage:
22.04.2010 14:24:03 org.apache.catalina.core.ApplicationContext log
SCHWERWIEGEND: Exception while dispatching incoming RPC call
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.extract(
ServerSerializationStreamReader.java:617)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.readInt(
ServerSerializationStreamReader.java:432)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.prepar
eToRead(AbstractSerializationStreamReader.java:38)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.prepareT
oRead(ServerSerializationStreamReader.java:383)
at
com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:234)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServic
eServlet.java:163)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServ
let.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:206)
at
org.jboss.seam.web.ContextFilter$1.process(ContextFilter.java:42)
at
org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServle
tRequest.java:53)
at
org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:37)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128
)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102
)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http
11Protocol.java:583)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:619)
That computer has Windows XP Prof SP3, Tomcat 6.0.20, Java jdk 6.0 update
17. The same error occurs with the jboss standalone. Version 5.1.0 works
fine.
On another computer, that is configured nearly the same (WinXP prof SP3,
Tomcat 6.0.20, java jdk 6.0 update 7) all works fine.
Maybe someone can even give me an advise, what could be the problem, or
maybe have a solution.
Kind regards,
Dominik
15 years, 11 months
Newbie on drools and servlets
by kuena
Hi,
I know a question has been asked before about drools and servlets, so I
apologise in advance. May someone please advice me on the best way of making
Drools and servlets friends in my application ;-) I want to use drools to
re-implement the servlet shown below. I have also attached the flow.
In brief my scenario works as follows:
User submits a form to request info; result map is returned; if size >3
refine else return results. Refine will require a page to be generated
asking user how to refine. The user answer will then be used to generate
result.
I have a feeling I might just need to add another node (e.g. event wait or
human task) between the refine action and the rule flow group node. Would
want to avoid that but not sure how will resume flow after refine. I would
be grateful for any pointers.
http://n3.nabble.com/forum/FileDownload.jtp?type=n&id=742273&name=flow.png
public class GeneratorServlet extends HttpServlet {
//declarations
protected void processRequest(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
//declarations
if(request.getAttribute("resultsMap") != null){
map = (Map) request.getAttribute("resultsMap");
//Render results i.e. present results to user if list is
short
if(map.size() <= maxOutput){
htmlPage.render(map, out, templatePath);
}
//list is long, ask how to shorten the list
else if (map.size() > maxOutput){
dialogSession.setAttribute("storedResultsMap", map);
htmlPage.refine(map, out, templatePath);
}
}
else{ // resultsMap is null
if(dialogSession.getAttribute("storedResultsMap")!= null){
map = (Map)
dialogSession.getAttribute("storedResultsMap");
String criteriaSelection =
request.getParameter("refineChoice");
if(criteriaSelection.equalsIgnoreCase("choice1")){
htmlPage.render(choice1Map, out, templatePath);
}
else if(criteriaSelection.equalsIgnoreCase("choice2")){
htmlPage.render(choice2Map, out, templatePath);
}
else {
htmlPage.render(map, out, templatePath);
}
}
}
}
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Newbie-on-drools-and-...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 11 months
NullPointerException during removing knowledge packages
by Piotr Jedrychowski
Hello.
I have a problem with removing knowledge packages. During running this
source code
Collection<KnowledgePackage> knowledgePackages =
knowledgeBase.getKnowledgePackages();
if (knowledgePackages != null) {
List<String> packageNames = new ArrayList<String>();
for (KnowledgePackage singlePackage : knowledgePackages) {
packageNames.add(singlePackage.getName());
}
for (String singlePackageName : packageNames) {
knowledgeBase.removeKnowledgePackage(singlePackageName);
}
}
I'm getting NullPointerException with this StackTrace:
java.lang.NullPointerException
at org.drools.reteoo.ReteooBuilder.removeRule(ReteooBuilder.java:235)
at org.drools.reteoo.ReteooRuleBase.removeRule(ReteooRuleBase.java:366)
at
org.drools.common.AbstractRuleBase.removeRule(AbstractRuleBase.java:712)
at
org.drools.common.AbstractRuleBase.removePackage(AbstractRuleBase.java:640)
at
org.drools.impl.KnowledgeBaseImpl.removeKnowledgePackage(KnowledgeBaseImpl.java:166)
I found this links in Internet:
http://seamframework.org/Community/DroolsGuvnorCacheIssue
http://lists.jboss.org/pipermail/rules-users/2007-November/003917.html
Maybe someone had similar problem and could help me?
I'm using:
* JBoss 4.2.3.GA
* Drools 5.0
Regards,
Piotr
15 years, 11 months