no-loop and 6.0 : DROOLS-353
by Mark Proctor
We’ve just found (and fixed) a no-loop bug.
https://issues.jboss.org/browse/DROOLS-353
In general we recommend @PropertyReactive over no-loop (and lock-on-active), for best practice.
If you hit this bug, which is caused by a modify, and you cannot migrate your stuff to @PropertyReactive you can fall back to using ReteOO mode for your execution. Or use our latest SNAPSHOT builds from master.
As mentioned this is fixed and will be in the next binary release - but that will not likely happen until january(guesstimate) now, as our time is focused on preparing the BRMS 6.0 product release.
Mark
11 years
drools 5.5 property reactive issue
by gboro54
I am seeing a weird pattern(or at least unexpected one) when running drools
5.5 in property reactive mode. I have to rules such as:
rule "Rule 1"
when
$order:Order(orderType=="A", orderVolume>1000)
then
insert(new Charge($order,"code1",-.25));
end
rule "Rule 2"
when
$order:Order(orderType=="A")
then
insert(new Charge($order,"code2",-.24));
end
rule "Set best price"
when
$order:Order($id:id, $setCharge:charge)
$charge:Charge(orderId=$id,$setCharge==null ||
chargeAmount<$setCharge.chargeAmount)
then
modify($order){setCharge($charge)};
end
If I insert and Order of 1001 I see all 3 activations get created, Rule 2
fires first thus triggering set price rule and the activation of Rule 1 is
cancelled. If I add a @watch(charge) to the end of the rules or set up
salience Rule 1 fires.
Could someone help me understand why the firing of Rule 2 and thus the set
best price rule cause rule 1 to get cancelled without the @watch?
--
View this message in context: http://drools.46999.n3.nabble.com/drools-5-5-property-reactive-issue-tp40...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years
Drools templates header arguments
by petert
I am working on a project, using templates to generate all my rules. I have
one problem though, I wanna parse my arguments to the template as a
ArrayList, and do somthing like this:
template header
ruleId
args
package dk.prks
import com.poc.entity.Bill;
import com.poc.entity.BillLine;
import com.poc.entity.Description;
import java.util.ArrayList;
template "01"
rule "@{ruleId}_(a){row.rowNumber}"
dialect "mvel"
when
$bill : Bill ($line : lines) and
BillLine( service == @{args.get(0)}, $lineNr : lineNr) from $line and
BillLine( service == @{args.get(1)}, lineNr < $lineNr) from $line
then
$bill.setColor(1);
end
end template
However, this is not possible. Furthermore I want to stretch that
performance is an issue, and i want the generated file to only contain the
values from the list, and not make any look ups in the array when running my
rules
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-templates-header-arguments-tp402...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years
Drools 6 getting started
by captainrhino
Basically I have a web app in which I would like to run some drools rules
from the new KIW-WB objects. e.g. KieContainer objects
Does anyone have a link to an idiots guide to getting started to Drools 6?
I'm looking to build a drools 6 maven project from one of the standard
example KIE-WB projects. What do i need MAven , GIthub etc and how do I
build it?
I then need to be able to use this project within a non-maven project, i.e.
build a jar from within the maven project that can then be used by my
non-maven java project. With the old deprecated KnowledgeBase classes I
used to be able to do this really easily.
Any suggestions would be most welcome and appreciated.
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-6-getting-started-tp4026911.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years
Exception when uploading JAR without POM in 6.0.0-Final
by SrjTx
If you try to upload a JAR without a pom.xml, it requests GAV info and then
throws the exception included at the bottom of the list.
I'm thinking that at line 141 in FileServlet.java, gav is not null and
therefore fileData is not converted to a BufferedInputStream at line 146,
which cause line 174 to throw the exception.
This is on CentOS 6.4
Work-around is to make sure you always have pom.xml in META-INF/maven
09:29:27,273 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/guvnor].[M2RepoFileServlet]]
(http-localhost/127.0.0.1:8080-4) JBWEB000236: Servlet.service() for servlet
M2RepoFileServlet threw exception:
org.guvnor.common.services.shared.exceptions.GenericPortableException:
mark/reset not supported
at
org.guvnor.common.services.backend.exceptions.ExceptionUtilities.handleException(ExceptionUtilities.java:24)
[guvnor-services-api-6.0.0.Final.jar:6.0.0.Final]
at
org.guvnor.m2repo.backend.server.FileServlet.uploadFile(FileServlet.java:180)
[guvnor-m2repo-editor-backend-6.0.0.Final.jar:6.0.0.Final]
at
org.guvnor.m2repo.backend.server.FileServlet.processUpload(FileServlet.java:84)
[guvnor-m2repo-editor-backend-6.0.0.Final.jar:6.0.0.Final]
at
org.guvnor.m2repo.backend.server.FileServlet.doPost(FileServlet.java:70)
[guvnor-m2repo-editor-backend-6.0.0.Final.jar:6.0.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
[jboss-servlet-api_3.0_spec-1.0.2.Final.jar:1.0.2.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
[jboss-servlet-api_3.0_spec-1.0.2.Final.jar:1.0.2.Final]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
[jbossweb-7.2.0.Final.jar:7.2.0.Final]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
[jbossweb-7.2.0.Final.jar:7.2.0.Final]
at
org.uberfire.security.server.UberFireSecurityFilter.doFilter(UberFireSecurityFilter.java:266)
[uberfire-security-server-0.3.0.Final.jar:0.3.0.Final]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
[jbossweb-7.2.0.Final.jar:7.2.0.Final]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
[jbossweb-7.2.0.Final.jar:7.2.0.Final]
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
[jbossweb-7.2.0.Final.jar:7.2.0.Final]
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)
[jbossweb-7.2.0.Final.jar:7.2.0.Final]
at
org.jboss.as.web.session.ClusteredSessionValve.handleRequest(ClusteredSessionValve.java:134)
[jboss-as-web-7.2.0.Final.jar:7.2.0.Final]
at
org.jboss.as.web.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:99)
[jboss-as-web-7.2.0.Final.jar:7.2.0.Final]
at
org.jboss.as.web.session.JvmRouteValve.invoke(JvmRouteValve.java:92)
[jboss-as-web-7.2.0.Final.jar:7.2.0.Final]
at
org.jboss.as.web.session.LockingValve.invoke(LockingValve.java:64)
[jboss-as-web-7.2.0.Final.jar:7.2.0.Final]
at
org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)
[jboss-as-web-7.2.0.Final.jar:7.2.0.Final]
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145)
[jbossweb-7.2.0.Final.jar:7.2.0.Final]
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
[jbossweb-7.2.0.Final.jar:7.2.0.Final]
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)
[jbossweb-7.2.0.Final.jar:7.2.0.Final]
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336)
[jbossweb-7.2.0.Final.jar:7.2.0.Final]
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
[jbossweb-7.2.0.Final.jar:7.2.0.Final]
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
[jbossweb-7.2.0.Final.jar:7.2.0.Final]
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920)
[jbossweb-7.2.0.Final.jar:7.2.0.Final]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_10]
--
View this message in context: http://drools.46999.n3.nabble.com/Exception-when-uploading-JAR-without-PO...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years
Drools 6 Unable to build index of kmodule.xml
by captainrhino
I have a non maven project which I think I have included all the relevant
dependencies manually into
I run the following code
KieServices ks = KieServices.Factory.get();
KieContainer kContainer = ks.getKieClasspathContainer();
KieBase kieBase = kContainer.getKieBase();
StatelessKieSession session = kContainer.newStatelessKieSession();
session.execute("test");
and get the following error message. Is there anything obvious anyone can
suggest? kmodule.xml is in a META_INF folder on the classpath.
SLF4J: Actual binding is of type [org.slf4j.impl.JDK14LoggerFactory]
15-Nov-2013 16:12:41
org.drools.compiler.kie.builder.impl.ClasspathKieProject discoverKieModules
INFO: Found kmodule:
file:/C:/eclipse%20workspace/Sales/build/classes/META-INF/kmodule.xml
15-Nov-2013 16:12:41
org.drools.compiler.kie.builder.impl.ClasspathKieProject getPomProperties
WARNING: Unable to load pom.properties tried recursing down from/eclipse
workspace/Sales/build/classes
null
15-Nov-2013 16:12:41
org.drools.compiler.kie.builder.impl.ClasspathKieProject discoverKieModules
SEVERE: Unable to build index of kmodule.xml
url=file:/C:/eclipse%20workspace/Sales/build/classes/META-INF/kmodule.xml
null
Exception in thread "main" java.lang.RuntimeException: Cannot find a default
KieBase
at
org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:160)
at com.axa.travel.drools.DroolsSalesTest.go(DroolsSalesTest.java:82)
at com.axa.travel.drools.DroolsSalesTest.main(DroolsSalesTest.java:26)l
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-6-Unable-to-build-index-of-kmodu...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years
Drools Problems
by Kumarshorav
Hi All,
I have deployed the rest service in Tomcat 7. When I am hitting the resource through browser; resulting is coming. But when I am sending continuous hit for the resource through CTRL+F5 or through Apache J Meter; it is throwing Exception:
Some errors exists in packageBuilder
[DialectError message='Unable to wire compiled classes, probably related to compilation failures:null']
Or some times -
Some errors exists in packageBuilder
[DialectError message='Unable to wire compiled classes, probably related to compilation failures:JavaDialect ']
But when I added "core-3.4.2.v_883_R34x.jar" in the class path; first error message come up frequently.
I am using DroolsInitializer java class where different way of executing rules method is written. I am also using some of your method; where in both cases same exception is coming up.
Please look on this.
Love
Kumar Shorav
11 years
SolutionInitializer for Nullable Planning Variable
by newbie
I created a custom solver which assign planning variables to planning
entities. I have a simple rule checking if there are no assign variable
that adds negative soft constraint. But when I assigned my planning variable
it increases the negative score instead of reducing it. I have for example
12 entities and my starting score was
0/-12.But when I initialized it with 4 variables it increases to 0/-16.
rule "null variable"
when
$myEntity : Entity( variable == null )
then
scoreHolder.addSoftConstraintMatch(kcontext, 0, -1);
end
--
View this message in context: http://drools.46999.n3.nabble.com/SolutionInitializer-for-Nullable-Planni...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years
Inquiring about Online Drools Training quality ...
by profversaggi
I'm curious about the experiences anyone has had investing in the online
training offerings for Drools. I've seen a lot of offerings coming from many
different directions, with equally disparate price tags, and originating
from different places on the globe. This immediately brings up a question of
quality.
I'm one who would rather forage my way through the 3 recommended books, and
the online docs, free tutorials, etc to get a solid foundation before
embarking on anything more, but I do appreciate opportunities to shorten up
the learning curve if it's good quality stuff.
I'm soliciting opinions please, your thoughts?
--
View this message in context: http://drools.46999.n3.nabble.com/Inquiring-about-Online-Drools-Training-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years
Compiling drools-examples
by baloodevil
Newbie question. I've imported drools-examples project into Eclipse (Kepler)
(which has GEF installed). I resolved build path errors by creating folders
src/test/java and src/test/resources. I resolved another issue by adding an
External JAR of org.eclipse.jdt.core_3.10.0.v20131029-1755.jar to the
project. (Those two changes allow me to create a new Drools Hello World
project and execute, however no such luck with complete examples) There are
hundreds of Drools Errors and hundreds of Java Problems, which I assume can
only be because of setup issues. The first Drools error is
"ArrayList is a raw type. References to generic type ArrayList<E> should be
parameterized AdventureFrame.java
/drools-examples/src/main/java/org/drools/games/adventures". That file
shows an import problem with
"import net.miginfocom.layout.ConstraintParser;" and "import
net.miginfocom.swing.MigLayout;". Those are referenced in the pom.xml file
in...
<dependency>
<groupId>com.miglayout</groupId>
<artifactId>miglayout</artifactId>
<version>3.7.4</version>
</dependency>
I don't know where to go next. Complete Drools newbie, and also fumbling
around with Eclipse.
--
View this message in context: http://drools.46999.n3.nabble.com/Compiling-drools-examples-tp4026895.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years