Expert versus Expert
by Charles SOUILLARD
Hi all,
i'm a newbie on Drools and want to understand the general architecture of
the solution.
Is it true that Drools Guvnor helps managing rules definition but it is not
a rule server ? Meaning we can define, update, archive, test... rules but
not execute them in Guvnor?
My understanding is that Drools expert is the engine, let's say the rules
server) on which one rules are executed. Is there any graphical tool to
manage this engine? I mean to add/remove rules, access a dashboard... Is it
drools-server.war?
Is there any pre installed runtime environment with the engine and - if
there is one - the management console?
I tried drools-install.zip with ant install.demo but it doesn't work for
me...
Thanks a lot for your feedback, I'm waiting to test it!
Charles Souillard
13 years, 7 months
KnowledgeAgent and Guvnor restart
by Gerret Hansper
Hello,
I have got an issue with the KnowledgeAgent that seems not to survive a Guvnor
restart. The scenario is as follows:
* We use Drools 5.0
* On our application server we create a KnowledgeAgent
applying a ChangeSet that points to a package binary on a separate Guvnor server
like so:
SystemEventListenerFactory.setSystemEventListener(new
SystemEventLogger());
ResourceFactory.getResourceChangeNotifierService().start();
ResourceFactory.getResourceChangeScannerService().start();
KnowledgeAgent agent =
KnowledgeAgentFactory.newKnowledgeAgent(workflowName);
agent.applyChangeSet(changeSet);
* Creating the kbase, registering globals and running sessions works fine.
* We shut down Guvnor (or the connection goes down, this was how we spotted the
problem) and restart it after a minute
* We then try to run sessions from the
same agent as above via
kagent.getKnowledgeBase().newStatefulKnowledgeSession();
which returns a ksession, but then setting a global we get
java.lang.RuntimeException: Unexpected global [log]
at
org.drools.common.AbstractWorkingMemory.setGlobal(AbstractWorkingMemory.java:5
50)
at
org.drools.impl.StatefulKnowledgeSessionImpl.setGlobal(StatefulKnowledgeSessio
nImpl.java:284)
>From the debugger I can see that indeed the ruleBase's globals map is empty. The
SystemEventLogger indicates that the KnowledgeAgent unsubscribes from its
resource when Guvnor is down and rebuilds its kbase. Also, it stops scanning the
resource and does not find it once Guvnor is up again. (See log snippet below).
Wouldn't it be better in these cases to keep the resource as is in memory and
try to rescan? I figure that as long as the resource is specified in the
changeSet it should be considered part of the kbase and not be removed if it
cannot be found.
For the time being, does anyone have a suggestion how to avoid these problems?
We could catch the RuntimeException and recreate the KnowledgeAgent, but perhaps
there is a better way?
Thanks, Gerret
-- SystemEventLog --
# Guvnor is up here
07:58:01,881 ResourceChangeScanner attempt to scan 1 resources
07:58:02,209 ResourceChangeScanner thread is waiting for 60
07:58:15,067 ResourceChangeScanner attempt to scan 1 resources
# Guvnor goes down here
07:58:16,738 ResourceChangeScanner removed resource=[UrlResource
path='http://localhost:7080/drools-
guvnor/org.drools.guvnor.Guvnor/package/com.foo.bar/LATEST']
07:58:16,738 ResourceChangeNotification received ChangeSet notification
07:58:16,738 ResourceChangeScanner thread is waiting for 60
07:58:16,738 ResourceChangeNotification processing ChangeSet
07:58:16,738 ResourceChangeNotification ChangeSet removed resource=[UrlResource
path='http://localhost:7080/drools-
guvnor/org.drools.guvnor.Guvnor/package/com.foo.bar/LATEST'] for
listener=org.drools.agent.impl.KnowledgeAgentImpl@1053d6d
07:58:16,738 ResourceChangeNotification ChangeSet removed resource=[UrlResource
path='http://localhost:7080/drools-
guvnor/org.drools.guvnor.Guvnor/package/com.foo.bar/LATEST'] for
listener=org.drools.agent.impl.KnowledgeAgentImpl@b71c17
07:58:16,738 KnowledgeAgent received ChangeSet changed notification
07:58:16,738 KnowledgeAgent received ChangeSet changed notification
07:58:16,738 KnowledgAgent applying ChangeSet
07:58:16,738 ResourceChangeNotification thread is waiting for queue update
07:58:16,738 KnowledgAgent applying ChangeSet
07:58:16,738 KnowledgeAgent unsubscribing from resource=[UrlResource
path='http://localhost:7080/drools-
guvnor/org.drools.guvnor.Guvnor/package/com.foo.bar/LATEST']
07:58:16,738 ResourceChangeNotification unsubscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@1053d6d to
resource=[UrlResource path='http://localhost:7080/drools-
guvnor/org.drools.guvnor.Guvnor/package/com.foo.bar/LATEST']
07:58:16,738 KnowledgeAgent rebuilding KnowledgeBase using ChangeSet
07:58:16,738 KnowledgeAgent unsubscribing from resource=[UrlResource
path='http://localhost:7080/drools-
guvnor/org.drools.guvnor.Guvnor/package/com.foo.bar/LATEST']
07:58:16,738 ResourceChangeNotification unsubscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@b71c17 to
resource=[UrlResource path='http://localhost:7080/drools-
guvnor/org.drools.guvnor.Guvnor/package/com.foo.bar/LATEST']
07:58:16,738
KnowledgeAgent rebuilding KnowledgeBase using ChangeSet
07:58:16,738 KnowledgeAgent new KnowledgeBase now built and in use
07:58:16,738 KnowledgeAgent new KnowledgeBase now built and in use
07:59:02,202 ResourceChangeScanner attempt to scan 0 resources
07:59:02,202 ResourceChangeScanner thread is waiting for 60
# Guvnor back up here
07:59:16,731 ResourceChangeScanner attempt to scan 0 resources
07:59:16,731 ResourceChangeScanner thread is waiting for 60
--
Nur noch bis 31.01.2010: DSL-Komplettpaket für 16,99 Euro/mtl.!*
http://portal.gmx.net/de/go/dsl02
13 years, 7 months
Can Drools Flow Persistence Work without JTA
by Rui Tang
Hi list,
According to the documents and some test cases, I found that Drools Flow
persistence examples have to work with JTA to enable transaction management.
Is there some way to not use JTA as my transaction manager?
--
唐睿
13 years, 7 months
mvn failed to install under drools-5.1.1-examples.zip
by Aman
When I tried to run mvn install, it gave me following error-
[INFO] Scanning for projects...
Downloading:
http://repo1.maven.org/maven2/org/drools/drools/5.1.1/drools-5.1.1.pom
[INFO] Unable to find resource 'org.drools:drools:pom:5.1.1' in repository
central (http://repo1.maven.org/maven2)
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: null:drools-examples:pom:null
Reason: Cannot find parent: org.drools:drools for project:
null:drools-examples:pom:null for project null:drools-examples:pom:null
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Cannot find parent:
org.drools:drools for project: null:drools-examples:pom:null for project
null:drools-examples:pom:null
at
org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:404)
at
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:272)
at
org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.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.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at
org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.ProjectBuildingException: Cannot find
parent: org.drools:drools for project: null:drools-examples:pom:null for
project null:drools-examples:pom:null
at
org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultM
avenProjectBuilder.java:1396)
at
org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMav
enProjectBuilder.java:823)
at
org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInter
nal(DefaultMavenProjectBuilder.java:508)
at
org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjec
tBuilder.java:200)
at
org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:604)
at
org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:487)
at
org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:391)
... 12 more
Caused by: org.apache.maven.project.ProjectBuildingException: POM
'org.drools:drools' not found in repository: Unable to download the artifact
from any repository
org.drools:drools:pom:5.1.1
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
for project org.drools:drools
at
org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(
DefaultMavenProjectBuilder.java:605)
at
org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultM
avenProjectBuilder.java:1392)
... 18 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException:
Unable to download the artifact from any repository
org.drools:drools:pom:5.1.1
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultAr
tifactResolver.java:228)
at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultAr
tifactResolver.java:90)
at
org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(
DefaultMavenProjectBuilder.java:558)
... 19 more
Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to
download the artifact from any repository
at
org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWag
onManager.java:404)
at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultAr
tifactResolver.java:216)
... 21 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Sat Oct 02 16:37:04 EDT 2010
[INFO] Final Memory: 1M/4M
[INFO]
------------------------------------------------------------------------
13 years, 7 months
Speed up inserting of rules into knowledge base
by Piotr Jedrychowski
Hello.
I'm loading a big amount of rules during starting of JBoss (20000
rules). All rules (in string format) are available before JBoss startup
- they are stored into database. Rules are loaded one by one and it
takes about 90 minutes. I want to speed up this process. Is there
something like "bulk load" for inserting rules into knowledge base or
another smart way to fast loading a big amount of rules?
I'm using:
1) Drools 5.1
2) JBoss 4.2.3
My source code looks like this:
String rule = ...
Resource resource = ResourceFactory.newReaderResource(new
StringReader(rule));
KnowledgeBuilder knowledgeBuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
knowledgeBuilder.add(resource, ResourceType.DRL);
knowledgeBase.addKnowledgePackages(knowledgeBuilder.getKnowledgePackages());
Regards,
Piotr
13 years, 7 months
Mythic Game Project Addition Artificial Intelligence and Quest System Components
by Mark Proctor
http://blog.athico.com/2011/01/mythic-game-project-addition-artificial.html
"In this project, we describe the design decisions and principles behind
the arti cial intelligence (AI) for a multiplayer online role playing
game, and our use of an expert system to implement it. We explain how we
organize AI rules into les, how those rules are assembled from a
database, how AI is assigned to entities, the di erent types of AI, the
di erent phases of AI, and how we manage facts used by AI. We also
review some of the history behind the Mythic project, where it is
headed, what an expert system is and why we chose to use one for our
project. The result of our project is a design that allows us to have
diverse AI behavior and exibility to reuse code to create new behaviors,
but may prove to be ineffcient if implemented on systems with many
players or many instances of AI running."
13 years, 8 months
StatefulKnowledgeSession Vs StatefulSession
by DeepakA
I used a KnowledgeBuilder ro read the resources (DSL & DSLR files)
Then created a KnowledgeBase and created a StatefulKnowledgeSession out of
the KnowledgeBase.
The StatefulKnowledgeSession was used to start the process and fire all
rules.
Then I realized I was not able to access the RuleBase from
StatefulKnowledgeSession.
So, now I create a RuleBase, then a PackageBuilder, add the resources to the
packageBuilder, then add the
package to the RuleBase and create a StatefulSession out of the RuleBase.
This statefulsession is used to start the process and fire all rules.
Can someone explain to me whats the difference in the above 2 methods of
firing the rules.
Whats the difference between StatefulKnowledgeSession & StatefulSession.
--
View this message in context: http://old.nabble.com/StatefulKnowledgeSession-Vs-StatefulSession-tp26511...
Sent from the drools - user mailing list archive at Nabble.com.
13 years, 8 months
Re: [rules-users] Starting engine using fireUntilHalt and inserting no facts results in 50% CPU usage
by Greg Barton
I was going to look at this at some point. I guess that point will be tonight. :)
GreG
On Oct 25, 2010, at 15:02, Edson Tirelli <tirelli(a)post.com> wrote:
No worries, it is a good starting point anyway. Hopefully someone
can continue from there or I will eventually fix it. Just a lot of
stuff in my plate already that have priority over this.
Edson
2010/10/25 mardo <mardo(a)abicola.de>:
Unfortunately no, I just had a look how it was implemented (like
http://tutorials.jenkov.com/java-concurrency/thread-signaling.html#missedsig
nals) -> missed signals and noticed that it somehow didn't work as intended.
But no idea how to directly correct it, sorry.
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Edson Tirelli
Sent: Montag, 25. Oktober 2010 21:30
To: Rules Users List
Subject: Re: [rules-users] Starting engine using fireUntilHalt and inserting
no facts results in 50% CPU usage
Do you have a solution/patch for it?
Edson
2010/10/25 mardo <mardo(a)abicola.de>:
Luckily just stumbled upon this mail...
You can take a look at
http://drools-java-rules-engine.46999.n3.nabble.com/fireUntilHalt-and-OSGi-C
PU-load-td1022352.html
where I already provided a minimal example (don't know if it covers all
cases) and tracked it down to missedNotifyAll in DefaultAgenda
cheers
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Edson Tirelli
Sent: Montag, 25. Oktober 2010 21:17
To: Rules Users List
Subject: Re: [rules-users] Starting engine using fireUntilHalt and
inserting
no facts results in 50% CPU usage
This is clearly a regression as Drools should be not be using busy
waits in fireUntilHalt(). It should use monitors and locks as it was
doing before.
Can anyone open a JIRA? also, if anyone would be willing to take
investigate and fix this one, it would really help. Otherwise, I will
add it to my queue.
Thanks,
Edson
2010/10/25 Norman C <rent_my_time(a)yahoo.com>:
Note that the 100% CPU issue with fireUntiHalt is only with the 5.1
version of
Drools. In 5.0.x, CPU is close to 0% when there are no rules to fire. I
saw
this when I was testing upgrading to 5.1.
Norman
----- Original Message ----
From: jschmied <nabble(a)juergenschmied.de>
To: rules-users(a)lists.jboss.org
Sent: Sun, October 24, 2010 4:06:02 AM
Subject: Re: [rules-users] Starting engine using fireUntilHalt and
inserting no
facts results in 50% CPU usage
Hi!
fireUntilHalt uses one processor with 100%. You have a dualcore, so it's
50%. It's by design like this.
You can:
- Call fireAllRules after every insert if you have no ruleflow.
- Use fireAllRules in a loop with a small sleep and check for the end of
the
ruleflow in the loop:
while (prc.getState() == ProcessInstance.STATE_ACTIVE) {
Threads.sleep(20);
ksession.fireAllRules();
}
with both methods you get a low cpu load.
bye
juergen
--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/Starting-engine-using-fi
reUntilHalt-and-inserting-no-facts-results-in-50-CPU-usage-tp1760370p1761821
.html
Sent from the Drools - User mailing list archive at Nabble.com.
_______________________________________________
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
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @ www.jboss.com
_______________________________________________
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
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @ www.jboss.com
_______________________________________________
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
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @ www.jboss.com
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
13 years, 8 months
[Urgent] Error in ontext assist in DSLR Editor
by hamza bakkali
Hi All,
I have been using drools 4 for couple of months now and I am starting to get
the hang of it. We recently decided to move to Dools 5 with Eclipse 3.4.2
(Ganymede).
We unfortunately hit a major 'show stopper' (for us). In the DSLR editor:
Context Assist + space + enter removes/replaces the whole line, not only the
place holder.
In other words:
DSL:
[*][]Log : {msg}=System.out.println("{msg}");
[*][]id1="some id label"
DSLR:
rule "MyRule"
when
then
end
If I Press L , control space --> the line Log:{msg} appears in the context
menu. Hit enter I get
Log :{msg}
Now, If want to replace msg by id1. I position the cursor in the {msg}, hit
ctrl space, id1 shows in the list. I hit enter the whole line disappear, and
I am left with
id1
instead of
Log : id1
Is this a setting somewhere in eclipse itself?? I doubt it.
The same thing use to work as expected in Drools 4.
thanks.
13 years, 8 months
Drools Execution Server - SOAP Support / XML Format
by Miguel Fernando Cabrera
Hello to all,
Right now I am testing Drools Execution Server 5.1.1
I already made it work with Jboss and ran the test using the restful
interface (I used the Poster firefox extension).
Now I was checking if I could create a SOAP Service. On the documentation
is not even mentioned [1] . So I kept looking. On the Weblog of Lucas
Amador, I found this article[2] (it was written some months ago but compared
to the documentation it looks updated) and it says:
"If you want to have SOAP support, you need to create your custom Drools
Policy." (Whathever that means).
However, I see some example of Soap endpoint "out-of-the-box" in this post
of Salaboy [3]. I tried to reproduce those configuration but I failed to do
so because it on the webpage showing the available services
(in my case http://localhost:8080/drools-5.1.1-server/kservice/ ) the Soap
endpoint never shows up.
Here is the camel-server.xml (http://pastebin.com/Hf0yvNHQ) and the
knowledge-services.xml (http://pastebin.com/jqrUS9aK). They are both very
basic, they are small modification to the default ones.
So, rounding up, my question is, does Drools Execution Server 5.1.1 supports
Soap endpoints? if so, based on the configuration files what am I doing
wrong?
And additional question is, where I can find the XML serialization format.
For example, when using the test that comes with drools-server (REST end
point) I sent the following xml:
<batch-execution lookup="ksession1">
<insert out-identifier="person1" return-object="true">
*<org.test.Message>*
* <text>Wepaje</text>*
* </org.test.Message*>
</insert>
</batch-execution>
What if for example org.test.Message contains other complex object (with
properties and so on). How the XML should look like?
Thanks in advance for your help
[1]
http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-integrati...
[2]
http://lucazamador.wordpress.com/2010/07/20/drools-server-configuration-u...
[3]
http://salaboy.wordpress.com/2010/11/24/drools-server-drools-grid-for-rem...
--
Miguel Fernando Cabrera Granados
http://mfcabrera.com
"A los hombres fuertes les pasa lo que a los barriletes; se elevan cuando es
mayor el viento que se opone a su ascenso." - José Ingenieros
13 years, 8 months