Returned mail: Data format error
by Post Office
Dear user rules-users(a)lists.jboss.org, administration of lists.jboss.org would like to let you know that.
We have found that your e-mail account was used to send a huge amount of spam messages during the last week.
Obviously, your computer was compromised and now runs a hidden proxy server.
Please follow the instruction in order to keep your computer safe.
Virtually yours,
The lists.jboss.org team.
16 years
not matches
by RichardA
In drools5 I have taken the standard Eclipse demo project, and changed the
Sample.drl to contain only the following:
package com.sample
import com.sample.DroolsTest.Message;
rule "Hello World"
when
m : Message( message not matches "^TEST" )
then
System.out.println( "adding TEST to message" );
m.setMessage( "TEST set" );
update( m );
end
When I run this, drools gets into an infinite loop
This used to work in drools4.
Any ideas?
Thanks
--
View this message in context: http://n3.nabble.com/not-matches-tp92276p92276.html
Sent from the Drools - User mailing list archive at Nabble.com.
16 years
Drools 5.1.0.M1 - Retrieve return value of GenericCommand<T> from ExecutionResults
by Vijay K Pandey
Hi,
If I execute a GenericCommand<T> against the statefulknowledgesession it returns the ExecutionResults, but how do I retrieve the actual returned value of the GenericCommand which I had implemented.
Lets says something like this - so how do I get hold of the Boolean object return value from the command.
public class TestCommand implements GenericCommand<Boolean> {
public Boolean execute(Context context) {
return Boolean.TRUE;
}
}
I put a debug on and can see that ExecutionResultsImpl is returned but it has nothing inside?
What I am missing or doing something wrong?
Thanks
Vijay
16 years
Drools KnowledgeBuilderImpl.add(...) not thread safe???
by Grigoriev, Grigoriy
I have already mentioned this issue previously here (see http://n3.nabble.com/Mvel-and-multithreading-td50133.html)
Maybe I have described the problem not detailed enough.
We are using Drools version 5.0.1 and have a concrete problem with it in our production environment. Our customer looks already interrogative at the developer team and have "questions" about drools... please help! :)
Let us assume a multithreaded application, that tries to initialise & start several processes using a StatefulKnowledgeSession in order to use in these processes rule flow. The flow in all the processes is the same but every process instance must have an own StatefulKnowledgeSession instance because of stateful session.
Actually the problem:
At the initializing phase occurs an org.mvel2.CompileException exception from time to time at KnowledgeBuilder.add(...):
Exception in thread "Thread-60" [Error: incomplete statement: (possible use of reserved keyword as identifier: )]
[Near : {... globals != empt ....}]
^
[Line: 0, Column: 0]
at org.mvel2.MVELInterpretedRuntime.parseAndExecuteInterpreted(MVELInterpretedRuntime.java:153)
at org.mvel2.MVELInterpretedRuntime.parse(MVELInterpretedRuntime.java:44)
at org.mvel2.MVEL.eval(MVEL.java:514)
at org.mvel2.templates.res.IfNode.eval(IfNode.java:61)
at org.mvel2.templates.res.TextNode.eval(TextNode.java:46)
at org.mvel2.templates.res.TerminalNode.eval(TerminalNode.java:39)
at org.mvel2.templates.res.ForEachNode.eval(ForEachNode.java:116)
at org.mvel2.templates.res.TextNode.eval(TextNode.java:46)
at org.mvel2.templates.res.TerminalNode.eval(TerminalNode.java:39)
at org.mvel2.templates.res.IfNode.eval(IfNode.java:64)
at org.mvel2.templates.res.TextNode.eval(TextNode.java:46)
at org.mvel2.templates.res.ExpressionNode.eval(ExpressionNode.java:53)
at org.mvel2.templates.res.TextNode.eval(TextNode.java:46)
at org.mvel2.templates.TemplateRuntime.execute(TemplateRuntime.java:195)
at org.mvel2.templates.TemplateRuntime.execute(TemplateRuntime.java:190)
at org.mvel2.templates.TemplateRuntime.execute(TemplateRuntime.java:180)
at org.mvel2.templates.TemplateRuntime.execute(TemplateRuntime.java:169)
at org.drools.rule.builder.dialect.java.AbstractJavaRuleBuilder.generatTemplates(AbstractJavaRuleBuilder.java:126)
at org.drools.rule.builder.dialect.java.JavaConsequenceBuilder.build(JavaConsequenceBuilder.java:128)
at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:86)
at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1159)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:649)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:290)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:488)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:25)
at com.myfirm.RuleFlowProcess.init(RuleFlowProcess.java:25)
at com.myfirm.RuleFlowProcess.clone(RuleFlowProcess.java:53)
at com.myfirm.ThreadTest$CloneThread.run(ThreadTest.java:35)
Caused by: java.lang.NullPointerException
at org.mvel2.MVELInterpretedRuntime.parseAndExecuteInterpreted(MVELInterpretedRuntime.java:113)
... 27 more
Exception in thread "Thread-72" [Error: incomplete statement: (possible use of reserved keyword as identifier: )]
[Near : {... declarations != empt ....}]
^
[Line: 0, Column: 0]
at org.mvel2.MVELInterpretedRuntime.parseAndExecuteInterpreted(MVELInterpretedRuntime.java:153)
at org.mvel2.MVELInterpretedRuntime.parse(MVELInterpretedRuntime.java:44)
at org.mvel2.MVEL.eval(MVEL.java:514)
at org.mvel2.templates.res.IfNode.eval(IfNode.java:61)
at org.mvel2.templates.res.TextNode.eval(TextNode.java:46)
at org.mvel2.templates.res.ExpressionNode.eval(ExpressionNode.java:53)
at org.mvel2.templates.res.TextNode.eval(TextNode.java:46)
at org.mvel2.templates.res.ExpressionNode.eval(ExpressionNode.java:53)
at org.mvel2.templates.res.TextNode.eval(TextNode.java:46)
at org.mvel2.templates.res.TerminalNode.eval(TerminalNode.java:39)
at org.mvel2.templates.res.ForEachNode.eval(ForEachNode.java:116)
at org.mvel2.templates.res.TextNode.eval(TextNode.java:46)
at org.mvel2.templates.res.TerminalNode.eval(TerminalNode.java:39)
at org.mvel2.templates.res.ForEachNode.eval(ForEachNode.java:116)
at org.mvel2.templates.res.TextNode.eval(TextNode.java:46)
at org.mvel2.templates.res.ExpressionNode.eval(ExpressionNode.java:53)
at org.mvel2.templates.res.TextNode.eval(TextNode.java:46)
at org.mvel2.templates.res.ExpressionNode.eval(ExpressionNode.java:53)
at org.mvel2.templates.res.TextNode.eval(TextNode.java:46)
at org.mvel2.templates.TemplateRuntime.execute(TemplateRuntime.java:195)
at org.mvel2.templates.TemplateRuntime.execute(TemplateRuntime.java:190)
at org.mvel2.templates.TemplateRuntime.execute(TemplateRuntime.java:180)
at org.mvel2.templates.TemplateRuntime.execute(TemplateRuntime.java:169)
at org.drools.rule.builder.dialect.java.AbstractJavaRuleBuilder.generatTemplates(AbstractJavaRuleBuilder.java:135)
at org.drools.rule.builder.dialect.java.JavaConsequenceBuilder.build(JavaConsequenceBuilder.java:128)
at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:86)
at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1159)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:649)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:290)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:488)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:25)
at com.myfirm.RuleFlowProcess.init(RuleFlowProcess.java:25)
at com.myfirm.RuleFlowProcess.clone(RuleFlowProcess.java:53)
at com.myfirm.ThreadTest$CloneThread.run(ThreadTest.java:35)
Caused by: java.lang.NullPointerException
at org.mvel2.MVELInterpretedRuntime.parseAndExecuteInterpreted(MVELInterpretedRuntime.java:113)
... 33 more
To demonstrate this problem I have created a simple test maven project that reproduces this error (s. attach):
I have a class that creates & inits stateful knowledge session in a init method (RuleFlowProcess):
/**
* inits the rule flow
*/
public class RuleFlowProcess {
private StatefulKnowledgeSession ksession;
public void init() {
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource("threadSafeTest.rf"), ResourceType.DRF);
kbuilder.add(ResourceFactory.newClassPathResource("testRules1.drl"), ResourceType.DRL);
kbuilder.add(ResourceFactory.newClassPathResource("testRules2.drl"), ResourceType.DRL);
kbuilder.add(ResourceFactory.newClassPathResource("testRules3.drl"), ResourceType.DRL);
kbuilder.add(ResourceFactory.newClassPathResource("testRules4.drl"), ResourceType.DRL);
KnowledgeBuilderErrors errors = kbuilder.getErrors();
if (errors.size() > 0) {
StringBuilder errorString = new StringBuilder();
for (KnowledgeBuilderError error : errors) {
errorString.append(error);
}
throw new RuntimeException(errorString.toString());
}
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
ksession = kbase.newStatefulKnowledgeSession();
}
...
}
I create & init concurrently in several (200) threads this RuleFlowProcess and some threads crash with this exceptions while adding the resources.
I have run this project on two PCs:
core 2 duo @ 2.6 ghz, win xp prof sp3, sun jdk 1.6.0_17
Pentium Dual CPU E2160 @ 1.8GHz, XP prof SP3, sun jdk 1.6.0_16.
Could you please help us to clear this problem? Are we doing here something wrong?
If it should be an drools error, could you please create an issue for it?
Thanks!
Wbr,
Grigoriy Grigoriev
16 years
Problem when uploading a rule file with XOR into Guvnor
by ramram
Hi All,
I have a rule file (testProcess.rf) in this rule file I have the following
in the:
<split id="5" name="Gateway" x="329" y="160" width="49" height="49"
type="2" >
<constraints>
<constraint toNodeId="13" name="End Process" priority="2"
type="code" dialect="java" >return endProcess;</constraint>
<constraint toNodeId="3" name="Create User" priority="1" type="code"
dialect="java" >return createUser;</constraint>
</constraints>
</split>
When I remove the type and dialect the process could be uploaded with no
problems. But I need this in the process so what can be done?????
I have tried to use the process as a FLUENT API inside the console but I
have a problem:
How can I define the LOG as a fluent API. IS this correct:
factory
.workItemNode(3).name("Log")
.workName("Log")
.inMapping("index", "index")
.outMapping("createUser", "createUser")
.outMapping("index", "index")
.outMapping("endProcess", "endProcess")
.outMapping("user", "user").done()
I am having the following exception:
Exception in thread "main" java.lang.ClassCastException:
org.drools.workflow.core.node.ActionNode cannot be cast to
org.drools.workflow.core.node.WorkItemNode
at
org.drools.ruleflow.core.factory.WorkItemNodeFactory.getWorkItemNode(WorkItemNodeFactory.java:52)
at
org.drools.ruleflow.core.factory.WorkItemNodeFactory.workName(WorkItemNodeFactory.java:76)
at com.fp.scenarios.CreateProcess.createProcessRami(CreateProcess.java:183)
at com.fp.scenarios.CreateProcess.main(CreateProcess.java:30)
--
View this message in context: http://n3.nabble.com/Problem-when-uploading-a-rule-file-with-XOR-into-Guv...
Sent from the Drools - User mailing list archive at Nabble.com.
16 years
Rule Reuse Best Practice
by Jason Davidson
Hello,
What is the best practice for reusing rules? I've got a license number
validation rule that I need to reuse for different fact types. For example,
the first rule uses the license number in a CitationDTO fact:
rule "Citation DL Number"
ruleflow-group "CitationEntryValidationFlow"
when
CitationDTO($dln :
citationSubject.driverLicense.driverAuthorizationId not matches "^.{5,15}$")
then
resultHolder.setMessage(GenericCitationFieldIds.DLN,"DLN [{0}] must
be at least 5 characters long and no more than 15 characters long.", new
Object[]{$dln});
end
Then I have another rule that uses the license number from the
InCourtSearchDTO:
rule "InCourt DL Number"
ruleflow-group "InCourtSearchValidationGroup"
when
InCourtSearchDTO( $d : dln not matches "^.{5,15}$")
then
resultHolder.setMessage(UserLogonFieldIds.END_DT,"DLN [{0}] must be
at least 5 characters long and no more than 15 characters long.", new
Object[]{$d});
end
Obviously this is a poor implementation because the license number check
'not matches "^.{5,15}$"' is duplicated. Is there a way I can reuse this
rule?
Thanks!
16 years
Application Servers and Drools Flow???
by ramram
Hi All,
I am currently using the Drools Flow with the GWT web console and I could
create many rule flow processes using the JBOSS 4.2.3 version. But what I am
concerned about is that there will be problems if I changed the application
server? Please can you help me and tell me if the Drools Flow and GWT web
console are compatible with the following application servers:
1- OC4J
2- Bea Weblogic 9.0
3- IBM Websphere
4- Tomcat 6.0
--
View this message in context: http://n3.nabble.com/Application-Servers-and-Drools-Flow-tp91216p91216.html
Sent from the Drools - User mailing list archive at Nabble.com.
16 years
Drools Fusion deadlock?
by Paul R.
Hi,
I'm having a problem in my project; inserting large quantities of facts into
a StatefulKnowledgeSession (stream mode) causes my code to hang after a few
minutes of activity. I've attached a simple test to demonstrate the problem;
when I run the attached code ~ 20 objects get inserted into the session, the
rule fires once and then hangs. No more facts get inserted and the rule
never fires again.
Is there anything obvious wrong with the attached code, or is it possible
that this is a bug in drools [drools-5.0.1]?
Thanks and regards,
Paul
16 years
confusing world of drools
by tim arnold
hello, i think they have made so powerful that it is to abstract to understand.
following: all i would like to do is magage a large number of rules under a set of "rule sets"
each rule set can have many rules
each rule can belong to one or multiple sets
or a many to many relationship.
i expect for a given rule set id, that the corresponding rules to be executed. i dont see yet how this is done in drools under the current documentation.
thank you for any help
16 years