Use Knowledge Agent
by java.developer.researcher
Hello,
I am trying of integrate Drools Guvnor with an java web application. I am
using KnowledgeAgent, but occurs the next exception when execute the code:
java.lang.RuntimeException: java.io.IOException: Server returned HTTP
response code: 401 for URL:
http://localhost:8383/drools-guvnor/org.drools.guvnor.Guvnor/package/org....
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:559)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:25)
at
org.examples.test.TestKnowledgeAgent.getKnowledgeBase(TestKnowledgeAgent.java:63)
at
org.examples.test.TestKnowledgeAgent.main(TestKnowledgeAgent.java:28)
Caused by: java.io.IOException: Server returned HTTP response code: 401 for
URL:
http://localhost:8383/drools-guvnor/org.drools.guvnor.Guvnor/package/org....
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at
org.drools.io.impl.UrlResource.getInputStream(UrlResource.java:76)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:512)
... 3 more
Exception in thread "main" java.lang.NullPointerException
at
org.examples.test.TestKnowledgeAgent.main(TestKnowledgeAgent.java:37)
What is the cause of this exception? How can I solved it?
Any help is welcome.
Regards,
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Use-Knowledge-Agent-t...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 6 months
Starting a process in Guvnor with ruleflow-group
by John Peterson
Hi all,
I'm doing some experimentation for a business problem and I've hit a
snag when it comes to Guvnor and Ruleflow-Groups.
I'm using Guvnor 5.0.1 and Drools 5.0.1.
I've uploaded a simple 4 step (plus start and end) ruleflow-group to
Guvnor. I've added ruleflow-group attributes to all my rules,
associating them to one of the four steps in my ruleflow. My code for
the execution is as follows:
cmds.add(CommandFactory.newInsertElements(recordsToRun));
try {
KnowledgeBase kbase = readKnowledgeBase();
StatelessKnowledgeSession ksession =
kbase.newStatelessKnowledgeSession();
ExecutionResults results =
ksession.execute(CommandFactory.newBatchExecution(cmds));
} catch(Exception e) {
System.out.println("Exception in readKnowledgeBase: " +
e.getMessage());
}
I've seen in other documentation that a "startProcess" is in order (e.g.
ksession.startProcess("ruleflowname")), however, startProcess is not
available for StatelessKnowledgeSession and the process is in Guvnor
already, not locally. I'm guessing it is something simple I've
overlooked, but it isn't clicking for me at this point and my search
online for answers hasn't found one yet. Any suggestions would be
appreciated.
Thanks!
15 years, 6 months
Activate/Deactivate parts of the rule sets
by Tina Vießmann
Hi,
I'm thinking about how to activate/deactivate parts of the rule set
during runtime. I'm doing some brainstorming about that and would be
happy, if I could get more experienced input. ;-)
What I want to do:
I have several rules where I process 4 different objects separate and
some rules processing combinations of the 4 objects. Now I want to be
able to activate/decativate the processing of e.g. one of the objects at
runtime when my application receives a specific command.
How can I do that?
My thoughts:
1.) I thought about maybe inserting a fact that states if the processing
of a object is disabled. If I'm including the fact in the rules
conditions, the rules including the specific object are prevent from
firing. But I could imagine that is results in performance costs because
its always checked in every rule condition if the specific processing is
(de)activated.
2.) Is it possible to (de)activate the execution of rules for a specific
object using some grouping...
3.) Is it possible to rebuild the knowledge base during runtime using
templates and incremental change-set processing. Or something alike...
(Because the separate processing of the 4 objects is kind of identical.)
Thanks for any input! :)
Tina
15 years, 6 months
Blurring the lines of jBPM and Drools
by keithnielsen
I have been researching both jBPM and Drools for sometime now and am
wondering what the future holds for jBPM. This is based on my research of
Drools 5, which is bringing what I would consider more BPM constructs into
the core engine, things such as Wait States, Human Tasks, etc. One of the
main things I don't see yet is the whole persistence and support of long
running processes. My question is will the trend with Drools continue,
eventually consuming jBPM?
I must say that my perception is that Drools is more active which makes me
wonder if I should go with Drools hoping that it builds out more BPM
features going forward.
Thanks
--
View this message in context: http://www.nabble.com/Blurring-the-lines-of-jBPM-and-Drools-tp20099731p20...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 6 months
Reuse statless session
by espen
Hi,
we have an application with a lot of rules in a cached rulebase. When we
profile our application we see that about 30% of the time is used in
rulebase.newStatlessSession(). The time is basically used loading classes.
The question is, is it possible to create a pool of StalessSessions and
reuse them, or will this create problems.
Regards
Espen
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Reuse-statless-sessio...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 6 months
How to write a rule like this
by 赵侃侃
Hello,
I'm still quite new to the drools stuffs just getting the examples running.
I'm sorry if my question is too basic.
I have a system that will continuously to receive events sent from some
other system. Basically I have two types of events, eventA and eventB.
Both eventA and eventB have two properties, index and timestamp.
What I want is to capture a pattern to meet the following conditions
1. every 3 consecutive eventsA without any eventB in between having a same
index value ordering by their timestamp.
2. all events in a matched pattern will have the same value of property
index.
3. if a pattern is matched, any of the events in this pattern should not be
used again for a new matching.
there are some examples below, the number after a colon stands for the value
of its index number and assume those events are already ordered by their
timestamp.
eventB:2 eventA:1 eventA:1 eventA:1 eventB:3 --------- one
successful match, we have three eventA with same index value 1 in a row
eventB:2 eventA:1 eventA:1 eventB:1 eventA:1 --------- no
match because there's an eventB in between
eventB:2 eventA:1 eventA:1 eventB:2 eventA:1 --------- one
successful match because the in-between eventB has a different index value
eventA:1 eventA:1 eventA:1 eventA:1 eventA:1 --------- only
one match, because once matched, the events can not be used for a second
match again.
I just don't know how to write a rule like this. Is there anyone who can
shed some lights on?
Best Regards,
Kevin
15 years, 6 months