mail
by Senthil Kumar Krishnan
12 years, 10 months
Rulebase locking
by Joe White
We have encountered a problem with a lock getting generated on an
AbstractRuleBase and then never released causing new threads to not be
able to execute in that RuleBase. We are on an older version 5.0.1 of
Drools and are working on creating a unit test that we can use to see if
the defect exists in newer releases. That said, any tips that somebody
might have to reproduce a concurrency issue related to rule bases used
across threads would be very helpful. Or if there are other similar JIRA
entries that we can look at that?
This occurs only when the system is under relatively high load and there
potentially could be 100 threads attempting to access and use the same
rulebase.
This is very similar to this JIRA:
https://issues.jboss.org/browse/JBRULES-2086?page=com.atlassian.jira.plu
gin.system.issuetabpanels:all-tabpanel
We have confirmed that we have the fix generated in that ticket.
The general related stack traces for the waiting threads is :
java.lang.Thread.State: WAITING
...
at
java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.lock(Reentran
tReadWriteLock.java:423)
at
org.drools.common.AbstractRuleBase.readLock(AbstractRuleBase.java:414)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.jav
a:866)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.jav
a:788)
...
java.lang.Thread.State: BLOCKED on
org.drools.reteoo.ReteooStatefulSession@fec3cf owned by:
DefaultMessageListenerContainer-145
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemo
ry.java:627)
at
org.drools.base.FireAllRulesRuleBaseUpdateListener.beforeRuleBaseUnlocke
d(FireAllRulesRuleBaseUpdateListener.java:41)
at
org.drools.event.RuleBaseEventSupport.fireBeforeRuleBaseUnlocked(RuleBas
eEventSupport.java:123)
at
org.drools.common.AbstractRuleBase.unlock(AbstractRuleBase.java:408)
at
org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:517
)
at
org.drools.reteoo.ReteooRuleBase.addPackage(ReteooRuleBase.java:388)
.....
12 years, 10 months
rule flow
by kachaps4u
Hey all,
I tried to create a rule flow in Jboss dev studio specifying each
ruleflow-group name( same as in the rules inside BRMS). I specified the same
id as in BRMS and the same package name. I uploaded to the BRMS but the
rules are not getting fired. Can somebody please help me?
Thanks
aps
--
View this message in context: http://drools.46999.n3.nabble.com/rule-flow-tp3655029p3655029.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 10 months
For loop inside a modify block problem
by Martin A
Hello, guys,
I have the following snippet of a right side rule:
modify ($gsc) {
doSomething($item.id);
for (int i = 0; i < $item.quantity; i++) {
doSomethingElse($item.id);
}
}
which looks like is invalid syntax in some way, but it comes out with
strange error report, such as '[Error: no such identifier: $item]'
Would you please assist me on how to put that loop inside that modify block?
Thank you and regards,
Martin
12 years, 10 months
How to add Packages to RuleBase
by srinivasasanda
Hi
I wrote code for creating RuleBase. But I got error at retrieving URL
resource by passing ruleFile to the getResource() method.It is returning
null. How to get the URL resource. I posted the sample code which i have
written for creating RuleBase.
public RuleBase createRuleBase() throws Exception
{
if(rules==null)
{
throw new Exception("No rules provided for Engine");
}
ruleBase = RuleBaseFactory.newRuleBase();
PackageBuilder builder = new PackageBuilder();
for(String ruleFile : rules)
{
System.out.println("Rule is "+ruleFile); //prints
the ruleFile
URL resource = this.getClass().getResource(ruleFile); //gets the URL
resource of the ruleFile
if(resource==null)
{
System.err.println("Could not find resource: "+ruleFile);
continue;
}
File file = new File(this.getClass().getResource(ruleFile).getPath());
if(!file.exists())
{
System.err.println("Could not find rule file: "+file.getPath());
continue;
}
builder.addPackageFromDrl(new FileReader(file.getPath()));
}
org.drools.rule.Package pkg = builder.getPackage();
ruleBase.addPackage(pkg);
return ruleBase;
}
My Packages are not adding to RuleBase.It is returning null.
How to add the packages to ruleBase.Please suggest me
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-add-Packages-to-RuleBase-tp36534...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 10 months