Executing a subset of rules.
by Stephen Masters
Hi folks,
I'm curious on what would be best practice with regards configuring things so that only a subset of rules is evaluated in certain situations.
I have a knowledge base that is designed to evaluate a whole variety of rules relating to whether a trade can be carried out. I would like to generate a 'report' of what banks I can trade with based on their current ratings. i.e. Based on rules like "Do not place funds in a counterparty (bank) below Moodys A2 rating." However there are numerous other rules such as "Do not place more than 20% of a fund in a single currency".
To generate the report I was going to set up a batch of dummy trades for evaluation and 'ask' the rules engine whether I am allowed to trade. However, specifically for the purposes of this report I don't want to see failures caused by anything other than a counterparty ratings rule.
I was thinking that one option would be to organise my packages so that I have an isolated 'counterparty ratings' package. That way I could load that specific set of rules into a counterparty ratings reporting session, and not others.
Does that seem a reasonable way of doing things? Or are there better ways of doing this?
Thanks in advance for any thoughts...
Steve
Stephen Masters
http://about.me/stephen-masters
stephen.masters(a)me.com
14 years, 3 months
MVEL curly braces position - bug or feature?
by nickS
Hi
I've been learning drools ands I saw that there is a Fibonacci example, so I
thought I'd write my own using mvel as the dialect and then compare it to
the model solution.
However, I couldn't get mine working. It parsed but the behaviour was very
odd. It kept ignoring the modify block in my recurse rule and consequently
it went into an infinite loop. I compared it to the 'approved' solution and
the two were pretty much the same, except that it worked and mine didn't.
After a lot of checking I noticed that I had started my curly brace on a new
line after modify but the example had continued straight after the closing
brace of the modify.
Works //
modify ( f ){
value = 1
};
or
modify ( f ){value = 1 };
Doesn't Work //
modify ( f )
{
value = 1
};
Does anyone know if this is a bug or a feature?
--
View this message in context: http://drools.46999.n3.nabble.com/MVEL-curly-braces-position-bug-or-featu...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months
Gwt Console in JBPM
by srinivasasanda
Hi,
I'm using JBPM5.1 installer,with JBOSS 5.1.0GA,Drools 5.3
I'm integrating Drools with JBPM.Before that,this is issue arised with
JBPM5.I've dowloaded the source code for jbpm console in
*https://github.com/bpmc/bpm-console*.I followed instructions and succesfuly
made 2 war files gwt-console.war,gwt-console-server.war.
But,When I'm deploying them in my JBOSS,it is generating exception and I'm
unable to open the console.The server log is
2012-01-10 12:47:17,303 INFO
[org.jboss.web.tomcat.service.deployers.TomcatDeployment] (main) deploy,
ctxPath=/default-bpm-console
2012-01-10 12:47:18,156 ERROR [org.reflections.Reflections] (main) could not
create Vfs.Dir from url. ignoring the exception and continuing
org.reflections.ReflectionsException: could not create Dir using
org.jboss.errai.bus.server.service.metadata.VFSUrlType from url
vfszip:/D:/jbpm-installer/jboss-5.1.0.GA/server/default/deploy/gwt-console.war/WEB-INF/classes/..
When I'm opening http://localhost:8080/jbpm-console:It is generating 404
page not found error.Please suggest me how to achieve it.Even I posted in
other forums,but couldnt able to get solution.Could you please suggest me
--
View this message in context: http://drools.46999.n3.nabble.com/Gwt-Console-in-JBPM-tp3647313p3647313.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months
Template Key in DSL
by srinivasasanda
Hi,
I created a rule template.I also created the DSL.
When the Person occupation is {s} = Person(occupation == "{s}").
In the rule template I inserted DSL statement and it is displayed as When
the person occupation is----
Now,I need to Load Template Data.But as there is no template key,I'm unable
to add rows in load template data option.Please suggest me how to load
template data in the rule template with DSL.
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Template-Key-in-DSL-tp3634710p3634710.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months
Where could I get drools binary or source versioning 5.3.2.final?
by Miles Wen
Hello,
I submitted some issues to the issue tracker and browsed the issue tracker
site. Found that there is a bug fix version for drools 5.3 final which
named '5.3.2.final'. But I can't find where to download it.I searched for
the droolsjbpm/drools github repos too, but still couldn't find.
So if somebody knows where to find the drools 5.3.2.final version, please
tell me.
Thanks.
--
Regards.
Miles. Wen
14 years, 3 months
does "dialect" really have an effect?
by ronalbury
Drools 5.3
Given the following rule:
rule "EasyApp Family Term Rider Max Value"
dialect "java"
#ruleflow-group "values-group"
when
$ea : EasyApp(
getFoo1AsBoolean()==true
&& (getFoo2AsInt() > 25000
|| getFoo2AsInt() > getFoo3().getCurrentAmtAsInt()/5))
)
then
$ea.addError(drools.getRule().getName());
end
The method getFoo3().getCurrentAmtAsInt() returns null, and so I get a null
pointer error. I can accept that. However, the traceback shows I am deep in
MVEL code:
Caused by: java.lang.NullPointerException
at org.mvel2.ast.IntDiv.getReducedValueAccelerated(IntDiv.java:16)
at
org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:38)
at
org.mvel2.ast.Substatement.getReducedValueAccelerated(Substatement.java:43)
at
org.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:116)
at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:31)
at org.mvel2.MVELRuntime.execute(MVELRuntime.java:87)
at
org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:122)
at
org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:115)
at org.mvel2.MVEL.executeExpression(MVEL.java:930)
at
org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:100)
at
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:291)
... 17 more
I know you can use java syntax inside MVEL ... does Drools even look at the
dialect, or does it always just run everything in MVEL?
--
View this message in context: http://drools.46999.n3.nabble.com/does-dialect-really-have-an-effect-tp36...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months
Instantiate fact class declared only in drl
by MarcoMojana
Hi,
I have declared a fact in a drl file as follows:
package a.b.c
declare MyFact
vehicle : Vehicle
end
The corresponding class file doesn't exists: it is created on the fly by
drools at runtime. The class name should be a.b.c.MyFact, but the
classloader cannot find it by using:
Class c = Class.forName("a.b.c.MyFact");
Is it possible to do that and how? I don't want to create the class because
it is used only by rules inside the drl file, but I would like to write a
test case for them.
Thank you
--
MM
--
View this message in context: http://drools.46999.n3.nabble.com/Instantiate-fact-class-declared-only-in...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months