Drools Guvnor API information?
by Vikas Hazrati
Hi,
I am looking at using Guvnor for our project where users would be creating
rules using our UI. For this i need to add / modify rule or any asset for
that matter using an api.
Unfortunately, i could not find enough documentation to suggest the best way
to use the REST api, which I guess is provided by Guvnor. Could someone let
me know the location of where i can get some information for this api. I
also see that the issue GUVNOR-1080
(https://issues.jboss.org/browse/GUVNOR-1080) is marked resolved so the api
should exist right? or that we cannot access it remotely until we have the
Atom Pub Interface done?
Help appreciated .
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Guvnor-API-inf...
Sent from the Drools - User mailing list archive at Nabble.com.
12 years
Debug rule functions ?
by ipeshev
Hello,
could some give me some tips for debugging *functions* in .drl ?
by now I'm not able to debug *inside the functions* which are called by the
rule sequence.
I follow the
http://docs.jboss.org/tools/3.0.0.GA/en/drools_tools_ref_guide/html_singl...
JBoss Drools Tools Reference Guide but what is show there is how to debug a
very simple *rule sequence*. I have no problem with that - following the
guide everything is ok.
BUT
There is nothing shown about a more complex case when there are functions
(java-like) in the .drl file and the rule calls one or more of these
functions. And one function calls another etc. (just like in normal
programming)
When a put a breakpoint inside functions I cannot debug them.
I can only debug the *rule* ("then" section)
Any help would be appreciated?
Or any official info if this supported at all.
versions etc.
Best Regards
Ivan
--
View this message in context: http://drools.46999.n3.nabble.com/Debug-rule-functions-tp3689774p3689774....
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years
java.lang.OutOfMemoryError: Java heap space
by vdelbart
Hello,
In my tests of the 4.0.3, I have some : java.lang.OutOfMemoryError.
So, I try a simple test with 10.000 sequential execution of 1 rule with no
context and just a workingmemorylogger and I have the error :
java.lang.OutOfMemoryError: Java heap space
My code is :
public class ExecReglesMemotyTest
{
private static final Reader DRL = new
InputStreamReader(ExecReglesMemotyTest.class
.getResourceAsStream("/rules/exemple.drl"));
private static final String FICHIER_LOG = "session";
/**
* @param args
*/
public static void main(String[] args)
{
try
{
PackageBuilder builder = new PackageBuilder();
builder.addPackageFromDrl(DRL);
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage(builder.getPackage());
for (int i = 0; i < 10000; i++)
{
StatefulSession session = ruleBase.newStatefulSession();
WorkingMemoryFileLogger logger = new WorkingMemoryFileLogger(session);
logger.setFileName(FICHIER_LOG);
session.fireAllRules();
logger.writeToDisk();
session.dispose();
}
}
catch (Exception e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
with this rule (doesn't matter):
#created on: Fri Nov 09 15:48:45 CET 2007
package initPackage
#list any import classes here.
rule "ERG9"
when
then
end
I try this in 4.0.1, and it's working (no OutOfMemoryError)
What's the problem ?
thanks for any information,
V.
--
View this message in context: http://www.nabble.com/java.lang.OutOfMemoryError%3A-Java-heap-space-tf477...
Sent from the drools - user mailing list archive at Nabble.com.
12 years, 1 month
getting mismatched '==' error
by zeeshan
Hi !
Please find my attached Decision Table. I am getting following error...
log4j:WARN No appenders could be found for logger (com.sample.RuleRunner).
log4j:WARN Please initialize the log4j system properly.
Warning: Cell at E20 not present - adding a blank
Warning: Cannot read name ranges for Excel_BuiltIn__FilterDatabase_1 -
setting to empty
Warning: Cannot read name ranges for Excel_BuiltIn__FilterDatabase_1 -
setting to empty
Warning: Cannot read name ranges for Excel_BuiltIn__FilterDatabase_1 -
setting to empty
Exception in thread "main" org.drools.rule.InvalidRulePackage: [10,9]: [ERR
102] Line 10:9 mismatched input '==' in rule "Distribution Cost Rules_11"
[23,9]: [ERR 102] Line 23:9 mismatched input '==' in rule "Distribution Cost
Rules_12"
[36,9]: [ERR 102] Line 36:9 mismatched input '==' in rule "Distribution Cost
Rules_13"
[49,9]: [ERR 102] Line 49:9 mismatched input '==' in rule "Distribution Cost
Rules_14"
[62,9]: [ERR 102] Line 62:9 mismatched input '==' in rule "Distribution Cost
Rules_15"
[75,9]: [ERR 102] Line 75:9 mismatched input '==' in rule "Distribution Cost
Rules_16"
[88,9]: [ERR 102] Line 88:9 mismatched input '==' in rule "Distribution Cost
Rules_17"
[101,9]: [ERR 102] Line 101:9 mismatched input '==' in rule "Distribution
Cost Rules_18"
[114,9]: [ERR 102] Line 114:9 mismatched input '==' in rule "Distribution
Cost Rules_19"
[127,9]: [ERR 102] Line 127:9 mismatched input '==' in rule "Distribution
Cost Rules_20"
[140,9]: [ERR 102] Line 140:9 mismatched input '==' in rule "Distribution
Cost Rules_21"
[153,9]: [ERR 102] Line 153:9 mismatched input '==' in rule "Distribution
Cost Rules_22"
[166,9]: [ERR 102] Line 166:9 mismatched input '==' in rule "Distribution
Cost Rules_23"
[179,9]: [ERR 102] Line 179:9 mismatched input '==' in rule "Distribution
Cost Rules_24"
[192,9]: [ERR 102] Line 192:9 mismatched input '==' in rule "Distribution
Cost Rules_25"
[205,9]: [ERR 102] Line 205:9 mismatched input '==' in rule "Distribution
Cost Rules_26"
[218,9]: [ERR 102] Line 218:9 mismatched input '==' in rule "Distribution
Cost Rules_27"
[231,9]: [ERR 102] Line 231:9 mismatched input '==' in rule "Distribution
Cost Rules_28"
[244,9]: [ERR 102] Line 244:9 mismatched input '==' in rule "Distribution
Cost Rules_29"
[257,9]: [ERR 102] Line 257:9 mismatched input '==' in rule "Distribution
Cost Rules_30"
[270,9]: [ERR 102] Line 270:9 mismatched input '==' in rule "Distribution
Cost Rules_31"
[283,9]: [ERR 102] Line 283:9 mismatched input '==' in rule "Distribution
Cost Rules_32"
[296,9]: [ERR 102] Line 296:9 mismatched input '==' in rule "Distribution
Cost Rules_33"
[309,9]: [ERR 102] Line 309:9 mismatched input '==' in rule "Distribution
Cost Rules_34"
[0,0]: Parser returned a null Package
at org.drools.rule.Package.checkValidity(Package.java:471)
at
org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:481)
at org.drools.reteoo.ReteooRuleBase.addPackages(ReteooRuleBase.java:436)
at org.drools.reteoo.ReteooRuleBase.addPackage(ReteooRuleBase.java:443)
at com.sample.RuleRunner.loadRules(RuleRunner.java:70)
at com.sample.RuleRunner.runStatelessRules(RuleRunner.java:185)
at com.sample.RuleMain.main(RuleMain.java:132)
http://drools.46999.n3.nabble.com/file/n4017627/Distribution_Factor.xls
Distribution_Factor.xls
--
View this message in context: http://drools.46999.n3.nabble.com/getting-mismatched-error-tp4017627.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 1 month
Unable to find implementation for BusinessRuleProvider
by John Peterson
Hi,
I've been experimenting with the Guided Rule Editor plug-in in Eclipse.
I've built a Drools Project using the default Hello World sample
application. I've created a new "Guided Rule" in my project called
"GuidedRule.brl" and get the associated "drools.package" with it. The
rule is simple:
WHEN
THEN
System.out.println("Rule has fired");
I build the knowledge base as follows:
private static KnowledgeBase readKnowledgeBase() throws
Exception {
KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource("SampleGuided.drl"),
ResourceType.BRL);
KnowledgeBuilderErrors errors = kbuilder.getErrors();
if (errors.size() > 0) {
for (KnowledgeBuilderError error: errors) {
System.err.println(error);
}
throw new IllegalArgumentException("Could not
parse knowledge.");
}
KnowledgeBase kbase =
KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
return kbase;
}
The only line changed is adding the resource of type BRL.
When I try to run, I get the following error:
java.lang.RuntimeException: org.drools.compiler.DroolsParserException:
org.drools.CheckedDroolsException: Unable to find implementation for
BusinessRuleProvider
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.j
ava:544)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.ja
va:28)
at com.sample.DroolsTest.readKnowledgeBase(DroolsTest.java:41)
at com.sample.DroolsTest.main(DroolsTest.java:23)
Caused by: org.drools.compiler.DroolsParserException:
org.drools.CheckedDroolsException: Unable to find implementation for
BusinessRuleProvider
at
org.drools.compiler.PackageBuilder.addPackageFromBrl(PackageBuilder.java
:386)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.j
ava:470)
... 3 more
Caused by: org.drools.CheckedDroolsException: Unable to find
implementation for BusinessRuleProvider
at
org.drools.compiler.BusinessRuleProviderFactory.throwNoImplementationFou
nd(BusinessRuleProviderFactory.java:66)
at
org.drools.compiler.BusinessRuleProviderFactory.loadProvider(BusinessRul
eProviderFactory.java:42)
at
org.drools.compiler.BusinessRuleProviderFactory.getProvider(BusinessRule
ProviderFactory.java:25)
at
org.drools.compiler.PackageBuilder.addPackageFromBrl(PackageBuilder.java
:366)
... 4 more
I've tried variations to add the drools.package as a PKG type, I've had
the rules (and package) in both "com.sample" and /src/main/rules, but I
can't seem to resolve the problem. "drools.package" has been updated to
include the package name (package com.sample;) and I import the message
class as well (even though it isn't being used currently).
I suspect the issue is simple, but I haven't been able to figure it out.
Any help would be appreciated.
12 years, 1 month
Persistence in fireUntilHalt() loop
by Alberto R. Galdo
Hi,
We're running an application that uses Drools + JBPM 5 + Drools
integration our set-up can be seen as:
Some rule fires and creates a JBPM process ( a fact gets inserted into
drools using "kcontext.getKnowledgeRuntime().startProcess("testProcess")"
). We have a problem with the persistence of this processes. Persistence is
implemented with JPA and JTA. Our application runs with fireUntilHalt() and
when a process is launched from the consequence of any of the rules the
persistence of the process fails. If the application runs with
fireAllRules(), the persistence works like a charm.
The error shown is as follow:
Exception in thread "Thread-5" Exception executing consequence for rule
"Run Process" in com.sample: java.lang.NullPointerException
at
org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1101)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1029)
at org.drools.common.DefaultAgenda.fireUntilHalt(DefaultAgenda.java:1229)
at
org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:754)
at
org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:730)
at
org.drools.command.runtime.rule.FireUntilHaltCommand$1.run(FireUntilHaltCommand.java:50)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
at
org.jbpm.persistence.processinstance.JPAProcessInstanceManager.addProcessInstance(JPAProcessInstanceManager.java:44)
at
org.jbpm.process.instance.AbstractProcessInstanceFactory.createProcessInstance(AbstractProcessInstanceFactory.java:36)
at
org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:182)
at
org.jbpm.process.instance.ProcessRuntimeImpl.createProcessInstance(ProcessRuntimeImpl.java:154)
at
org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:135)
at
org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:130)
at
org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1074)
at
org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:301)
at com.sample.Rule_Run_Process.defaultConsequence(Rule_Run_Process.java:9)
at com.sample.Rule_Run_ProcessDefaultConsequenceInvoker.evaluate(Unknown
Source)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1091)
... 6 more
The problem is in this function:
public void addProcessInstance(ProcessInstance processInstance) {
ProcessInstanceInfo processInstanceInfo = new ProcessInstanceInfo(
processInstance, this.kruntime.getEnvironment() );
ProcessPersistenceContext context
= ((ProcessPersistenceContextManager)
this.kruntime.getEnvironment()
.get( EnvironmentName.PERSISTENCE_CONTEXT_MANAGER ))
.getProcessPersistenceContext();
// @PrePersist added to ProcessInstanceInfo because of this
context.persist( processInstanceInfo );
((org.jbpm.process.instance.ProcessInstance)
processInstance).setId( processInstanceInfo.getId() );
processInstanceInfo.updateLastReadDate();
internalAddProcessInstance(processInstance);
}
We think after that persist sentence, the entity manager would have to run
a flush sentence for the process instance is inserted into database and get
the ID.
Greets.
12 years, 2 months
System problems
by paco
I am using Drools 5.4.0, guvnor 5.3.0 and default database.
I imported the rules with XML file (550 KB) in Guvnor. After I can check,
validate and test (with run analysis button) the rules without problems.
Everything works fine.
After when I import ed other rules XML file (30,000 KB), I realized that the
system becomes too slow and obviously I can no longer veifier, validate or
test my rules.
Please suggest
--
View this message in context: http://drools.46999.n3.nabble.com/System-problems-tp4018363.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 2 months