Drools upgrade from 5.1.0 to 5.5.0.Final
by SuchitraKrishna
Hello,
I am trying to upgrade our project to jdk7 and in the process,
upgrading from drools 5.1.0 to drools 5.5.0.Final and I have a few
questions.
1. Is 5.5.0.Final compatible with jdk7 and is it the production version?
2. When I compile our code with 5.5.0.Final, I see the following
compilation error
/drools/util/DroolsRuleHandler.java:[58,25]
setClassLoader(java.lang.ClassLoader...) has private access in
org.drools.compiler.PackageBuilderConfiguration
DroolsRuleHandler.java has this piece of code
PackageBuilderConfiguration builderCfg = new PackageBuilderConfiguration();
builderCfg.setClassLoader( this.getClass().getClassLoader() );
In the new version of drools, this setClassLoader is private whereas in
5.1.0 this used to be public. Is there a way to get around this error? I
would be most grateful if you could point me in the right direction. I have
looked at the archives since 2011 and could not find anything in there. Is
there a drools migration page somewhere that I missed? Thanks a lot for
your help.
13 years, 4 months
Anyone using JSR94?
by Mark Proctor
I've asked this on the developer list, thought I'd ask it here too.
Is anyone using JSR94, anyone think we should not nuke it?
Mark
13 years, 4 months
What is the correct approach towards using Drools?
by mohdejaz74
Hello,
I'm working on a project which uses Drools as a component. It is connected
to a web server. Every time a request arrives to web server, it in turn
loads the facts and invokes fireAllRules. Facts do change over time but
rules do not ... I'm bit concerned that this may not be correct of using
Drools, since we are constantly doing setup /tear down.
Keep facts in memory and updating them when necessary - that requires major
change in the architecture of the application.
I want to know - has anyone done something similar? Does it lead major
problems in future? Performance Issues?
Regards
Ejaz
--
View this message in context: http://drools.46999.n3.nabble.com/What-is-the-correct-approach-towards-us...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 4 months
Query on web services and database stuff
by starfish15
Hello All,
I am starting up on a project which requires Drools rules. I have been asked
certain basic Q's. Am jotting them below
1. *Can the Drools Rule engine communicate to a DB *
I know by default, drools does use the *Apache JackRabbit DB* to store
respective assets and there are means to use other DBs as well. Not sure
what else this Q could mean. So would really appreciate if some light can be
thrown on this. What else things which could be achieved through the rules
and DB connection
2. *Can the Drools Rule engine do web service calls to other system*
I am not sure if this can be achieved through Drools. Would appreciate if
some assistance could be provided on this and some working examples as well
if this can actually be achieved.
Regards,
starfish
--
View this message in context: http://drools.46999.n3.nabble.com/Query-on-web-services-and-database-stuf...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 4 months
Questions about Drools runtime & Guvnor
by Charles Moulliard
Hi,
I have different questions concerning drools & guvnor.
Q1 : How can Drools runtime (Knowledge builder / base) gets/collects
*.brl, .drl files from Guvnor (using REST api, ....) ?
Q2 : How can drools runtime being informed that rules have been modified
in Guvnor Repo ?
Q2 : Is there a document describing best practices to setup knowledge
base (how many rules / base, ...) and sessions to be created ?
Q3 : Is it a good practice to access Guvnor from Drools runtime or
better to export from Guvnor a package and import it in Drools runtime
(Can we import guvnor package in Drools runtime) ?
Regards,
--
Ir. Charles Moulliard
Sr. Enterprise Architect / Apache Committer | RedHat, Inc
FuseSource is now part of Red Hat
cmoullia(a)redhat.com | mobile: +32 473 604 014 | RedHat.com
<http://www.redhat.com>
skype: cmoulliard | twitter: @cmoulliard
blog: cmoulliard.blogspot.com <http://cmoulliard.blogspot.com>
13 years, 4 months
NPE at distribution [Planner]
by André Fróes
Hello, I am getting an NPE when trying to solve a simple problem with 3
workorder and 3 engineers.
------------
Exception in thread "main" java.lang.NullPointerException
at java.util.ArrayList.addAll(Unknown Source)
at
org.drools.planner.core.domain.solution.SolutionDescriptor.getAllFacts(SolutionDescriptor.java:178)
at
org.drools.planner.core.score.director.drools.DroolsScoreDirector.getWorkingFacts(DroolsScoreDirector.java:88)
at
org.drools.planner.core.score.director.drools.DroolsScoreDirector.resetWorkingMemory(DroolsScoreDirector.java:81)
at
org.drools.planner.core.score.director.drools.DroolsScoreDirector.setWorkingSolution(DroolsScoreDirector.java:70)
at
org.drools.planner.core.solver.scope.DefaultSolverScope.setWorkingSolutionFromBestSolution(DefaultSolverScope.java:158)
at
org.drools.planner.core.solver.DefaultSolver.solvingStarted(DefaultSolver.java:176)
at
org.drools.planner.core.solver.DefaultSolver.solve(DefaultSolver.java:154)
at com.swa.planner.snap1.app.SortWorkOrder.main(SortWorkOrder.java:41)
-----------------
the rule for it is simple (adapted from cloudbalancing):
----------
rule "requiredWorkTimeTotal"
when
$engineer : Engineer($worktime : worktime )
$requiredEngineerWorktimeTotal : Number(intValue > $worktime) from
accumulate(
WorkOrder(
engineer == $engineer,
$requiredWorktime : requiredWorktime ),
sum($requiredWorktime)
)
then
insertLogical(new IntConstraintOccurrence("requiredWorkTimeTotal",
ConstraintType.NEGATIVE_HARD,
$requiredEngineerWorktimeTotal.intValue() - $worktime,
$engineer));
end
----------
I'm rebuilding the app bit by bit and then evolve it. The skill is not
considered yet to make the comparison, just worktime. This is the data i'm
working with right now:
-----------
List<Engineer> engineerList = new ArrayList<Engineer>();
engineerList.add(new Engineer(1l, 8, ABC1, "Fabio"));
engineerList.add(new Engineer(2l, 8, ABC2, "Qwert"));
engineerList.add(new Engineer(3l, 8, ABC3, "Trewq"));
List<WorkOrder> workOrderList = new ArrayList<WorkOrder>();
workOrderList.add(new WorkOrder(101l, 8, ABC1));
workOrderList.add(new WorkOrder(102L, 8, ABC2));
workOrderList.add(new WorkOrder(103L, 8, ABC3));
-----------
13 years, 4 months
Check a set of objects for a value?
by Patrick
Hello,
This is my current drool rule:
rule "RULE1"
when
context : StaticTaskContext(
taskToPerform.name == "TRANSFER",
deallocatedOrder == true,
currentTask != null
)
then
context.setRuleResult("STAYPUT");
end
What I need to do is check to see if the predecessor task is of a certain
value.
ie:
currentTask.getPredecessorTaskChains().iterate().next().getPredecessorTask.getTaskType()
== "VALUE"
The predecessorTaskChain is declared as:
private Set<TaskChain> predecessorTaskChains;
How can I go through all the task chains on the current task?
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Check-a-set-of-objects-for-a-value-tp40...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 4 months
MavenImporter from GuvnorIntegrationTest
by MaverickDrools
Hi,
Any idea about this exception? Tried to google it up, but didn't get
anything satisfactory.
java.lang.RuntimeException: Could not invoke deployment method: public
static org.jboss.shrinkwrap.api.spec.WebArchive
org.drools.guvnor.server.test.GuvnorIntegrationTest.createDeployment()
at
org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.invoke(AnnotationDeploymentScenarioGenerator.java:160)
at
org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.generateDeployment(AnnotationDeploymentScenarioGenerator.java:94)
at
org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.generate(AnnotationDeploymentScenarioGenerator.java:57)
at
org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.generateDeployment(DeploymentGenerator.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at
org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
at
org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
at
org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:100)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at
org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
at
org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
at
org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at
org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at
org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at
org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
at
org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:80)
at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:182)
at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)
at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)
at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.invoke(AnnotationDeploymentScenarioGenerator.java:156)
... 50 more
Caused by: java.lang.NoClassDefFoundError:
org/jboss/shrinkwrap/resolver/api/maven/MavenImporter
at
org.drools.guvnor.server.test.GuvnorIntegrationTest.createDeployment(GuvnorIntegrationTest.java:60)
... 55 more
Caused by: java.lang.ClassNotFoundException:
org.jboss.shrinkwrap.resolver.api.maven.MavenImporter
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 56 more
I have the following dependency in my project pom:
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-api-maven-archive</artifactId>
<version>2.0.0-alpha-7</version>
</dependency>
But it seems like the jar doesn't have that class anymore. Any thoughts?
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/MavenImporter-from-GuvnorIntegrationTes...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 4 months
Drools Planner Chaining/Cloning Documentation Suggestion
by Trails
Hi all,
I'm new to drools planner and liking it a lot!
I spent some hours last night cracking my head on something. I have
switched my domain from planning variable pointing to planning facts to
using chained planning variables.
I ran into a problem with score corruption, which was surprising as I am
still using a Simple Score Calculator.
It turns out my problem was when cloning the solution the planning variable
(now chained) was still pointing to entities in the old solution. I was
following along the user guide when I fell over this.
I'd like to humbly suggest that the drools planner user guide include a
note/warning/something in the chained variable section about ensuring that
when cloning the solution, the chained planning variables are updated to
point to the cloned planning entities. There is currently no mention of
solution cloning in this section, and the code included in the doc does not
mention this either.
This is illustrated in the examples, e.g. TSP, but it's in the Solution, not
the planning entities.
Just hoping to save others the head scratching.
Thanks!
Taylor
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Planner-Chaining-Cloning-Documen...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 4 months