drools guvnor 5.4 final deployment error
by domingo
Hi,
I am trying to deploy drools guvnor 5.4 war into jboss5.1.0.GA apps server,
but i got the following error...
......
........
caused by: java.lang.ClassNotFoundException:
javax.validation.MessageInterpolato
$Context
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at
org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseCl
help will be appreciated...
thanks,
-----
with kind regards,
--
View this message in context: http://drools.46999.n3.nabble.com/drools-guvnor-5-4-final-deployment-erro...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 5 months
Guvnor: Dependent Enumeration loosing value
by Sandjaja, Dominik
Hi everybody,
I use the advanced, dependent enumeration concepts of the Guvnor DSL as
explained here (second part):
http://docs.jboss.org/drools/release/5.4.0.Final/drools-guvnor-docs/html
/ch04.html#d0e1887
In principle, this works fine: I get my values in the dropdown fields
just fine, e.g. when using the following DSL sentence:
[when]In the module {module:ENUM:Enums.BooleanModules} the checkbox for
the field {field:ENUM:Enums.BooleanField} is checked={module} (
{field}Visible && {field} )
When everything works, the {field} is filled, depending on the selected
value in {module}.
BUT: If I create such a rule, close it, open it again, the following DRL
is generated (given that {module} has the value MODULE:
MODULE ( Visible && )
As you can see, the value for {field} is missing at all! If I change
something somewhere else in the rule and save it, the rule is invalid
and everything breaks!
I have no idea where to look as there are no errors when saving or
loading the rules. Should I file a bug for this or am I missing
something?
Thanks
Dominik
12 years, 5 months
5.4.0.Final OSGi bundle with Apache Karaf 2.2.7
by Nicholas Hemley
Hello,
I am having troubles getting the 5.4.0.Final OSGi bundle to install/activate on Apache Karaf 2.2.7.
Note - I have already fixed the JAXB/XJC problem as discussed here:
https://issues.jboss.org/browse/JBRULES-3192
So following from this I have tried two different approaches:
a) Drop the OSGi bundle jars into Karaf deploy/ folder
b) Using Karaf Console
The latter method is discussed here:
http://drools.46999.n3.nabble.com/drools-osgi-issue-td4017799.html
The console session for (b) was as follows:
osgi:install -s wrap:mvn:com.google.protobuf/protobuf-java/2.4.1
osgi:install -s wrap:mvn:org.antlr/antlr-runtime/3.3
osgi:install -s wrap:mvn:javax.persistence/persistence-api/1.0.2
osgi:install -s mvn:org.mvel/mvel2/2.1.0.drools16
osgi:install -s wrap:mvn:com.thoughtworks.xstream/xstream/1.4.2
osgi:install -s wrap:mvn:org.drools/drools-spring/5.4.0.Final
osgi:install -s mvn:org.drools/knowledge-api/5.4.0.Final
osgi:install -s mvn:org.drools/knowledge-internal-api/5.4.0.Final
osgi:install -s mvn:org.drools/drools-core/5.4.0.Final
NullPointerException (no stack trace)
Clearly the 5.4.0.Final bundle, as is, does not work in Apache Karaf 2.2.7.
So my question is this:
Has the fix in the post above been applied to a patch that I can download, please? Or must I wait for 5.5.0.Beta1?
Otherwise, is there a previous version of Drools OSGi bundles that does work with Apache Karaf?
Many thanks for any pointers.
Cheerio,
Nic
12 years, 5 months
Check problems of conflicts in the rules
by paco
I want to detect the conflict between the rules with Drools Verifier. For
example the first condition of the second rule is present in the first rule
and the actions to perform are the same in both rules as they demonstrate in
the following case. It works very well when these rules belong to the same
drl file.
--------- fichier a.drl---------------------------
rule "a"
no-loop true
ruleflow-group "group1"
dialect "mvel"
when
A==0
then
Action1
end
rule "b"
no-loop true
ruleflow-group "group1"
dialect "mvel"
when
A==0 && B==1
then
Action1
end
The problem arises when I separated its rules and that I have to put each in
its own file
---------------- a.drl----------------
rule "a"
no-loop true
ruleflow-group "group1"
dialect "mvel"
when
A==0
then
Action1
end
------------------b.drl--------------------
rule "b"
no-loop true
ruleflow-group "group1"
dialect "mvel"
when
A==0 && B==1
then
Action1
end
I can no longer detect this problem with Drools Verifier.
Does anyone ever encountered this problem?
How can I do to write a small program to audit if this case?
--
View this message in context: http://drools.46999.n3.nabble.com/Check-problems-of-conflicts-in-the-rule...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 5 months
Giving multiple range values in condition of Decision table
by pratibhapandey
Hello Team,
I have written a condition like this, see the highlighted one..
http://drools.46999.n3.nabble.com/file/n4017965/error.png
I am getting the prob when rule engine parses the range value. When I
generate a DRL out of this sheet what I get is:
rule "Rule 2"
salience 65520
when
lvgBslaData: LeverageBSLAData(((productTypeCode in ('REO' ||
(investmentGroupType == "'TRM')") && (dealLtvNbiExtDebt <= EQUITY)) &&
primaryCollateralType == "0.6")
then
lvgBslaData.setCorpLeverageName( "Hotel Equity ");
end
except of getting the below rule:
rule "Rule 2"
salience 65520
when
lvgBslaData: LeverageBSLAData(((productTypeCode in ('REO','TRM') ||
(investmentGroupType == "EQUITY") &&(dealLtvNbiExtDebt <= 0.6)) &&
primaryCollateralType == "Hotel")
then
lvgBslaData.setCorpLeverageName( "Hotel Equity ");
end
I cannot change the condition except the ordering.. Please tell me how can I
achieve this?
--
View this message in context: http://drools.46999.n3.nabble.com/Giving-multiple-range-values-in-conditi...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 5 months
getBestSolution not returning the correct Solution?
by Charles
I displayed the score to console on hardConstraintsBroken rule.
rule "hardConstraintsBroken"
dialect "java"
salience -1 // Do the other rules first (optional, for performance)
when
$sd : ServiceRequest( $object : object );
$hardTotal : Number() from accumulate (
IntConstraintOccurrence( $weight : weight ),
sum( $weight ) );
then
System.out.println( $object.getId() + " : " + (- $hardTotal.intValue())
);
scoreHolder.setScore(- $hardTotal.intValue() );
end
I found that the getBestSolution() did not return the correct best solution
based on console output.
For example, in console output
Problem Entity:
O00010440201002 O00010440201003 O00010440201004 O00010440201009
O00010440201010 O00010440201011
Object: O00010440201002 : -5
Object: O00010440201002 : -5
Object: O00010440201010 : -4
Object: O00010440201003 : -5
Object: O00010440201004 : -5
Object: O00010440201011 : -4
Object: O00010440201009 : -1
Object: O00010440201004 : -5
Object: O00010440201010 : -4
Object: O00010440201002 : -5
Object: O00010440201003 : -5
Object: O00010440201011 : -4
Object: O00010440201002 : -5
Object: O00010440201003 : -5
Object: O00010440201004 : -5
Object: O00010440201009 : -1
Object: O00010440201011 : -4
Object: O00010440201003 : -5
Object: O00010440201011 : -4
Object: O00010440201004 : -5
Best Solution return by Solver
O00010440201011 : -1
My expectation
O00010440201009 : -1
Previous implementation in 5.3.0 doesn't have this problem.
Can explain where I might do wrongly?
--
View this message in context: http://drools.46999.n3.nabble.com/getBestSolution-not-returning-the-corre...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 5 months
Is a single StatefulKnowledgeSession with Distributed Memory cache possible?
by chrisLi
Hi All,
I am working on a banking fraud detection project with Drools Fusion,
which will match a transaction against hunreds of rules to check whether the
transaction is suspicious.
In some rules, I use time-based sliding window to calculate the average
transaction amount of an account in the past 3 or 6 months. One possible
rule will be as below:
rule "Single Large Amount Transaction"
dialect "mvel"
when
$account : Account($number : number)
$averageAmount : BigDecimal() from accumulate(
TransactionCompletedEvent(fromAccountNumber == $account.number,
$amount : amount)
over window:time(90d)
from entry-point TransactionStream,
bigDecimalAverage($amount))
$t1 : TransactionCreatedEvent(fromAccountNumber == $account.number,
amount > $account.creditAmount * 0.5, amount > $averageAmount *
3.0)
from entry-point TransactionStream
then
end
In such cases, the Fusion Engine will hold TransactionCompletedEvent in
its memory for 90 days. And we have about 1 billion Accounts in total, so
the TransactionCompletedEvent will be huge, we will very soon run out of
memory.
I have been blocked here for a long time! Is it possible to distribute a
single StatefulKnowledgeSession in multiple JVMs or machines using
Distributed Memory cache such as Hazelcast? If yes, could you give me some
opinion on the solution? Or is this the problem the Drools Grid project try
to handle? Or there are other techonology to handle large numbers of facts
or events problem?
As far as I know, Drools Grid distribute multilple ksessions on multiple
machines in the Grid, each or several kseesions on one node? Is my
understandings right?
Any response or opinion from you will be appriciated! Thank you very
much!
--
View this message in context: http://drools.46999.n3.nabble.com/Is-a-single-StatefulKnowledgeSession-wi...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 5 months
jsp, java and drl file
by Brajesh
Hi Friends
I am trying to create a web page with a form, so when we click on submit, we
are redirected to the result web page, but the content of this page will be
generated according to the rules i created in my drl file. Does anyone knows
the easiest way to do this? are they a way to call the drl file from the jsp
file, or the java file?
My Jsp file
<form:form method="post" action="login.htm" commandName="loginForm"
id="loginForm">
<table>
<tr>
<td>Enter username:</td>
<td><form:input path="UserName" style="width:250px"
maxlength="75"/></td>
</tr>
<tr>
<td>Enter password</td>
<td><form:password path="UserPassword" style="width:250px"
maxlength="75"/></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" >
<label>
<input type="submit" value="Save" />
</label>
<label>
<input type="reset" value="clear"/>
</label>
</td>
</tr>
</table>
</form:form>
My controller class
@RequestMapping(value="login.htm", method=RequestMethod.POST)
public String showAffilaiteform(Map<String, Object> model,login
loginform,BindingResult result) {
String target = AFFILIATE_REGISTRATION;
try{
testDAO.drools(loginform);
model.put("affiliateRegistrationForm", new AffiliateUserRegistration());
}catch(Exception e)
{
e.printStackTrace();
}
return target;
}
My TestDao class
public class TestDAO implements ITestDao {
public void drools(login loginform) {
try {
// load up the knowledge base
KnowledgeBase kbase = readKnowledgeBase();
StatefulKnowledgeSession ksession =
kbase.newStatefulKnowledgeSession();
KnowledgeRuntimeLogger logger =
KnowledgeRuntimeLoggerFactory.newFileLogger(ksession, "myLog");
ksession.insert(loginform);
ksession.fireAllRules();
logger.close();
} catch (Throwable t) {
t.printStackTrace();
}
}
private static KnowledgeBase readKnowledgeBase() throws Exception {
KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource("LoginRules.drl"),
ResourceType.DRL);
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;
}
My DRL file
import com.ri.bean.login;
rule "b"
dialect "mvel"
when
login( userName == "" ||==null)
then
System.out.println("hello");
login lo = new login();
end
These are my files and my application runs without any error.Now I want to
show a message on my jsp page when the rule violates.can anybody provide me
a small piece of code.
Regards
Brajesh
--
View this message in context: http://drools.46999.n3.nabble.com/jsp-java-and-drl-file-tp4017955.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 5 months