UnSubscribe:my mail.
by Manohar Kokkula
Hello,
Please unsubscribe my mail: manohar.kokkula(a)tcs.com.
Thanks in advance.
Manohar Kokkula
Mailto: manohar.kokkula(a)tcs.com
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
14 years
Suscribe : my email
by quentin chevalier
Hello,
There is my email : quentin.chevalier.altran(a)gmail.com
Thx & regards
14 years
KnowledgeAgent Changeset problems
by albertorugnone
Hi all,
I have some problem with KnowledgeAgent, maybe you can help me. I will list
these in the following
1) during change set loading I have the following error
(null: 1, 207): schema_reference.4: Failed to read schema document
'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
document could not be read; 3) the root element of the document is not
<xsd:schema>.
(null: 1, 207): cvc-elt.1: Cannot find the declaration of element
'change-set'.
(null: 1, 216): schema_reference.4: Failed to read schema document
'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
document could not be read; 3) the root element of the document is not
<xsd:schema>.
(null: 1, 311): schema_reference.4: Failed to read schema document
'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
document could not be read; 3) the root element of the document is not
<xsd:schema>
I suppose this is because change-set.xml can be reached. What is a correct
setting for xs:schemaLocation.
2) I would like scan also a directories in order to add knowledge to my rule
set if I add a new file. How I can do that?
3) KnowledgeAgentConfiguration aconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
aconf.setProperty("drools.agent.newInstance", "true") <== what is the
meaning of this property? Where I can find documentation about those
properties
4) why when I would set a global variable I receive
Exception in thread "main" java.lang.RuntimeException: Unexpected global
[service]
at
org.drools.common.AbstractWorkingMemory.setGlobal(AbstractWorkingMemory.java:615)
at
org.drools.impl.StatefulKnowledgeSessionImpl.setGlobal(StatefulKnowledgeSessionImpl.java:332)
at
com.sample.DroolsKnowledgeAgentTest.main(DroolsKnowledgeAgentTest.java:90)
I the following an example about my question
@SuppressWarnings("restriction") public class DroolsKnowledgeAgentTest {
public static class Service {
}
DroolsKnowledgeAgentTest() {
KnowledgeBase newKnowledgeBase = KnowledgeBaseFactory.newKnowledgeBase();
ResourceFactory.getResourceChangeNotifierService()
.start();
ResourceFactory.getResourceChangeScannerService()
.start();
final ResourceChangeScannerConfiguration sconf =
ResourceFactory.getResourceChangeScannerService()
.newResourceChangeScannerConfiguration();
sconf.setProperty("drools.resource.scanner.interval", "2");
ResourceFactory.getResourceChangeScannerService()
.configure(sconf);
final KnowledgeAgentConfiguration aconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
aconf.setProperty("drools.agent.scanDirectories", "true");
aconf.setProperty("drools.agent.scanResources", "true");
aconf.setProperty("drools.agent.newInstance", "true");
final KnowledgeAgent agent =
KnowledgeAgentFactory.newKnowledgeAgent("pch.sel.knowledge.agent",
newKnowledgeBase, aconf);
// if (_l.isDebugEnabled()) {
/* we need some log every time */
agent.setSystemEventListener(new PrintStreamSystemEventListener());
// }
}
public static void main(String[] args) throws IOException {
ResourceFactory.getResourceChangeNotifierService()
.start();
ResourceFactory.getResourceChangeScannerService()
.start();
String xml = "";
xml += "<change-set xmlns='http://drools.org/drools-5.0/change-set'";
xml += "
xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'";
xml += "
xs:schemaLocation='http://drools.org/drools-5.0/change-set
drools-change-set-5.0.xsd' >";
xml += " <add> ";
xml += " <resource
source='Z:/WSP/drools-test/src/main/java/com/sample/rule1.drl' type='DRL'
/>";
xml += " </add> ";
xml += "</change-set>";
FileManager fileManager = new FileManager();
File fxml = fileManager.newFile("changeset.xml");
BufferedWriter output = new BufferedWriter(new FileWriter(fxml));
output.write(xml);
output.close();
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
ResourceChangeScannerConfiguration sconf =
ResourceFactory.getResourceChangeScannerService()
.newResourceChangeScannerConfiguration();
sconf.setProperty("drools.resource.scanner.interval", "2");
ResourceFactory.getResourceChangeScannerService()
.configure(sconf);
KnowledgeAgentConfiguration aconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
aconf.setProperty("drools.agent.scanDirectories", "true");
aconf.setProperty("drools.agent.scanResources", "true");
aconf.setProperty("drools.agent.newInstance", "true");
KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("test
agent", kbase, aconf);
kagent.applyChangeSet(ResourceFactory.newUrlResource(fxml.toURI()
.toURL()));
StatefulKnowledgeSession ksession = kagent.getKnowledgeBase()
.newStatefulKnowledgeSession();
ksession.setGlobal("service", new Service());
}
}
and rule named rule1.drl
#created on: 29-Feb-2012
package com.sample
#list any import classes here.
#declare any global variables here
global DroolsKnowledgeAgentTest.Service service;
rule "Your First Rule"
when
#conditions
then
#actions
end
Thank you very much for your answers and kind regards
Alberto
--
View this message in context: http://drools.46999.n3.nabble.com/KnowledgeAgent-Changeset-problems-tp378...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years
debug
by grandjean
Hi
I am a newbie and i would like to use debugging mode under eclipse indigo
sr2 with drools 5.3.
So, I created a very simple drools Helloworld project.
I added two breakpoints, one in the 'then' section of the 'goodbye' rule and
the other one in the line where I call fireAllRules();
I selected the main class and right clicked so as to select 'Debug As Drools
Application'
So, it stops on the FireeAllRules() but it doesn't stop on the rule
breakpoint.
In addition, the Agenda, Working Memory views are totally blank
How can I get a working debug mode?
Thks in advance
Bruno Grandjean
--
--
View this message in context: http://drools.46999.n3.nabble.com/debug-tp3889858p3889858.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years
Adding a new KnowledgePakage to and existing KnowledgeBase
by mike
Hi there,
I am having problems adding knowledge packages to a kb. For instance I
create a kb n' add this drl:
package test
rule "abc"
then System.out.println("abc");
end
then I want to add another drl with the same package.
package test
rule "123"
then System.out.println("123");
end
this is the code i'm using for adding
public static void add(KnowledgeBase kb, String content) throws Exception {
(1) KnowledgeBuilder builder =
KnowledgeBuilderFactory.newKnowledgeBuilder(kb);
(2) builder.add(
ResourceFactory.newByteArrayResource(content.getBytes()),
ResourceType.DRL);
if (builder.hasErrors())
throw new Exception(builder.getErrors().toString());
kb.addKnowledgePackages(builder.getKnowledgePackages());
}
please notice i am creating a new builder every time and the kb is passed
in on (1)
the first call to add works fine. but on the second i get
a NullPointerException on line (2)
java.lang.NullPointerException
at
org.drools.rule.builder.dialect.java.PackageStore.write(PackageStore.java:47)
at
org.drools.commons.jci.compilers.EclipseJavaCompiler$3.acceptResult(EclipseJavaCompiler.java:350)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:474)
at
org.drools.commons.jci.compilers.EclipseJavaCompiler.compile(EclipseJavaCompiler.java:358)
at
org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:49)
at
org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:369)
at
org.drools.compiler.DialectCompiletimeRegistry.compileAll(DialectCompiletimeRegistry.java:53)
at org.drools.compiler.PackageRegistry.compileAll(PackageRegistry.java:71)
at org.drools.compiler.PackageBuilder.compileAll(PackageBuilder.java:869)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:826)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:404)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:586)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:37)
thank you very much
mike
14 years
Guvnor WAR files build question
by chema
Hi all,
I'm quite new with Guvnor and i have to add some config files to it in order
to deploy the application in a server (security things and other custom
modules).
To do that I choosed to download the sources (Maven project from official
github) of Guvnor for the version 5.3.0.Final and I started to add the
things i needed. This way the operation could be done as a normal dev (all
application tests are run, etc...)
Here is my problem. Usually when you add a file (xml file in this case) in
the WEB-INF directory (I'm talking about the guvnor-webapp module and the
directory src/main/webapp/WEB-INF) and you run the build (Maven war plugin,
in this case i perform a clean install of the module
guvnor-distribution-wars) you'll find these files in the WEB-INF directory
of the war produced.
I have no errors, all the wars (wars for jboss versions 5.1, 6, 7 and tomcat
6) are generated, but my file is not in the WEB-INF directory of the war (in
fact no war produced has it).
As I'm scratching my head with this, I rolled back all the changes I made
and restarted the process only adding a test.xml file in the WEB-INF
directory and building Guvnor again. Same result...
I may be not understanding how it works or doing something wrong, but I'll
really appreciate all the help you can give me to resolve this simple (I
think it should be simple, but as I can't get over it...) issue.
Many thanks.
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-WAR-files-build-question-tp38869...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years
mvel strict-mode not applied in drools 5.3.1.Final
by korgen
Hi folks,
In the process of upgrading from Java 1.6 to Java 1.7 (1.7.0_03 to be
precise) we updated Drools from 5.1.1 to 5.3.1 (as in 5.1.1 language level
1.7 is not supported).
However with Drools 5.3.1 the system property "drools.dialect.mvel.strict"
seems not to be applied all the time. I know this sounds fishy, but this is
the behaviour:
In a (junit based) test we create the knowledgebase by loading multiple drl
files. Each of them has the dialect 'mvel' set in its beginning.
In our @BeforeClass of the test we do a:
System.setProperty("drools.dialect.mvel.strict", "false");
and I also tried using a KnowledgeBuilderConfiguration with the appropriate
settings.
But still sometimes the test fails with a "unable to resolve method using
strict-mode..." message. I say sometime because running the test multiple
times via maven "mvn -Dtest=ClassicDroolsTest test" sometimes produces
failure, sometimes produces success.
It might by noteworthy that the method called in the test expects two
parameters of type Double, but as it seems Drools is not seeing the
covariant return type of the class which is actually used (the abstract base
method has return type Object, the concrete method has return type Double).
I tried to reproduce the issue with a simpler test setup to be able to post
it here but did not succeed.
I also applied the patch
https://github.com/droolsjbpm/drools/commit/1c20018abeef8bee86f896ffff794...
(comming from https://issues.jboss.org/browse/JBRULES-3163) to the Drools
5.1.1 sources, compiled them myself and everything works like a charm with
it. However I cannot use this unofficial work around as I can't (and don't
want) use a patched version of Drools in my environment.
Also when I compile & run my sources with jdk 1.6.0_31 everything is fine.
I'd really appreciate any help on this topic as I couldn't find any hints on
this behaviour in the release notes from Drools versions > 5.1.1
Thanks
Joerg
--
View this message in context: http://drools.46999.n3.nabble.com/mvel-strict-mode-not-applied-in-drools-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years
Usings joins in decision tables
by sumatheja
Hi All,
I'm new to using decision tables. I'm trying to create a join in
the condition column like
when
Header($a:id)
SubHeader($b:id==$a)
How to achieve this in decision tables. Any help will be appreciated.
--
cheers
14 years
[rules user] different behavior on double type
by Zeke
Hi, guys:
I am using Drools 4.0.7. I find a strange behavior. When my LHS is
"Message( varDouble == 99.9 )" and "varDouble" equals "new Double(99.9)",
the condition is true. But when my LHS is "Message( types.doubleType ==
99.9 )" and the "doubleType" field is also equal to "new Double(99.9)", the
condition is false. I debug the code, and find that:
When the LHS is "Message( varDouble == 99.9 )", the logic will handle the
literal 99.9 as *Double.valueOf( “99.9” )*, and the comparison is between *(new
Double(99.9)).doubleValue(*) and *Double.valueOf( “99.9” ).doubleValue()*,
When the LHS is "Message( types.doubleType == 99.9 )", the logic is
different from above. The comparison is between *new BigDecimal((Double)
99.9, MathContext.DECIMAL64)* (which double value is 99.90000000000001) and
*new BigDecimal(“99.9”, MathContext.DECIMAL64)* (which double value is
99.9).
I think we need make things consistent. "varDouble" and
"types.doubleType" are of the same type and value. It doesn't make sense to
have different behavior just because of one field is nesting while the
other is not. I know Drools is using MVEL to evaluate the condition. But I
am not sure it is a MVEL bug or Drools uses MVEL wrong. It will be much
appreciated if you can give me any comments!
14 years