Problem running drools-verifier ant task
by deaddowney
I'm trying to run the verifier against a simple rule file I've created. My
rules live in a directory called "rules". The rules files are directly
under rules/.
rules/rule1.drl
rules/rule2.drl
My ant target looks like:
<target name="verifier" depends="compile">
<verifier
srcdir="rules"
tofile="${outputdir}"
classpathref="classpath-compile-deploy">
<include name="*.drl" />
</verifier>
</target>
I'm getting this exception:
java.lang.NullPointerException
at java.io.Reader.<init>(Reader.java:61)
at java.io.InputStreamReader.<init>(InputStreamReader.java:55)
at
org.drools.contrib.DroolsVerifierAntTask.compileAndAnalyzeFile(DroolsVerifierAntTask.java:125)
at
org.drools.contrib.DroolsVerifierAntTask.execute(DroolsVerifierAntTask.java:105)
The error occurs in compileAndAnalyzeFiles:
http://grepcode.com/file/repository.jboss.com/maven2/org.drools/drools-an...
The line it's bombing out seems to be trying to find my rules file relative
to the Verifier class:
org.drools.lang.descr.PackageDescr descr = (new DrlParser()).parse(new
InputStreamReader(org/drools/verifier/Verifier.getResourceAsStream(filename)));
Why does it do that? Why not just read the file I specify? Do I have to
muck with the classpath to get the verifier to work?
Thanks,
Adam
--
View this message in context: http://n3.nabble.com/Problem-running-drools-verifier-ant-task-tp417853p41...
Sent from the Drools - User mailing list archive at Nabble.com.
16 years
Re: [rules-users] Rule Templates and null values
by Pavel Tavoda
Enlighten us. Where is this method and how to use it? I'm also interested.
Palo
2010/2/26 Bernd Rücker <bernd.ruecker(a)camunda.com>:
> Okay, digging more into the source code I found the method
> “replaceOptionals” which does exactly what I need. So despite the missing
> docs, a line IS skipped if the according parameter used in that line is
> null. Perfect :-)
>
>
>
> Sorry for the interruption…
>
>
>
> Von: rules-users-bounces(a)lists.jboss.org
> [mailto:rules-users-bounces@lists.jboss.org] Im Auftrag von Bernd Rücker
> Gesendet: Freitag, 26. Februar 2010 12:30
> An: rules-users(a)lists.jboss.org
> Betreff: [rules-users] Rule Templates and null values
>
>
>
> Hi all.
>
>
>
> I question myself if I can get the Rule Templates to works like it is in
> Excel: If one “parameter” is not set (null), the whole line of the template
> is skipped?
>
>
>
> Since we want to build a template for a lot of rules, fed from a database.
> There some conditions can be null, so they should not be included in the
> rule at all. Has anybody an idea to this? I haven’t found anything, neither
> in the docs, nor in the testcases…
>
>
>
> Thanks a lot
>
> Bernd
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
16 years
Rule Templates and null values
by Bernd Rücker
Hi all.
I question myself if I can get the Rule Templates to works like it is in
Excel: If one parameter is not set (null), the whole line of the
template is skipped?
Since we want to build a template for a lot of rules, fed from a database.
There some conditions can be null, so they should not be included in the
rule at all. Has anybody an idea to this? I havent found anything,
neither in the docs, nor in the testcases
Thanks a lot
Bernd
16 years
WSHumanTaskHandler problem in TaskCompletedHandler
by KiranP
i have created a web based application which uses the WSHumanTaskHandler for
2 work items in my project
the flow as start-->workitem1-->workItem2-->end
and there can be many instances of process running the process use the mina
task Server and Client Provided
it work fine if there is only one processinstance but if there r more than
one than it gets into the place in code of WSHumantaskHandler commented as
// defensive check that should never happen, just here for testing
and shows that Event.getTaskId() and taskId are diffrent when this should
not happen....
so i m running in a lot of trouble . . . . . can somebody which part of code
i must look where such a thing can happen......thanks in advance
kiranP
--
View this message in context: http://n3.nabble.com/WSHumanTaskHandler-problem-in-TaskCompletedHandler-t...
Sent from the Drools - User mailing list archive at Nabble.com.
16 years
Re: [rules-users] Using Sliding Time Window usage in Drools Fusion v5.0.1
by Karthik Krishnan
Dear all :
We have been using Drools Expert in our various projects. Now we are to use
Drools Fusion v5.0.1 in our project for CEP.
We are trying to get SlidingTimeWindow function working... My Rule is like
below
********************************
declare MyEvent
@role( event )
@timestamp(eventDateTime)
end
rule "Rule1"
when
$event: MyEvent() over window:time( 2s ) from entry-point "My Stream"
then
System.out.println($event.getEventName() + ": Event Occured!!!" +
$event.getEventDateTime().toString());
end
*******************************
MyEvent is a Java Bean with eventName and eventDateTime attributes.
And my java code looks like below :
MyEvent e1 = new MyEvent("Meeting1", new Date(110, 1, 25, 10, 30));
MyEvent e2 = new MyEvent("Meeting2", new Date(110, 1, 25, 10, 33));
...
...
session.insert(e1);
Thread.sleep(5000);
session.insert(e2);
session.fireAllRules();
Here Since all these events time stamps indicate they had happened long
back...when I evaluate the rule, I should not see any event picked up...
But I see the following output...
Meeting2: Event Occured!!!Thu Feb 25 10:33:00 IST 2010
Meeting1: Event Occured!!!Thu Feb 25 10:30:00 IST 2010
This example seems to pretty simple, but I am wondering whats going wrong.
Am I missing anything here? Any help would be greatly appreciated.
Thanks.
Best regards,
Karthik Krishnan.
http://karthiks.in
Best regards,
Karthik Krishnan.
http://karthiks.in
16 years
Welcome to the "rules-users" mailing list
by Adam Krieg
I’m new to Drools and having trouble accessing my Domain object which is basically a container around a map.
class Person {
Map props;
public Map getProps();
…. Extra stuff
}
I want to create a rule that will match when Age is greater than 20 and name is one of “Fred”, “Barney”, or “Wilma”. These entries are stored in the Map props, so that to get age, you would call person.getProps().get(“AGE”)
rule "My Rule"
dialect "mvel"
when
$person : Person(
props[“AGE”] > 20,
props[“NAME”] memberOf [“Fred”, “Wilma”, “Barney”]
)
then
System.out.println("found match”+$person);
End
But I am running into a parsing error:
no viable alternative at input ')' in rule "My Rule" in pattern Person.
The second condition seems to be the problem. Can I check for membership inside a List I create inline in mvel?
16 years
Call for Vote: Drools support in IntelliJ IDEA
by Ansgar Konermann
Hi everyone,
I'm wondering whether there are any Drools users on this list using
IntelliJ IDEA to do their regular development work.
As you might know, there is currently no Drools support in IntelliJ
IDEA. However, it would be nice to have this support. Switching between
your Java / Groovy / Scala / whatever project in IDEA and your rules
project in a different tool is cumbersome. There must be one tool to
rule them all! :-)
There exists a feature request to add Drools support to one of the
future releases of IntelliJ IDEA.
Sadly, the feature request seems to have received only little attention
from the IDEA developers.
If you want to help out changing this, register a user account with the
IntelliJ issue tracking system [1] and vote for this feature request
[2]. Also feel free to add your comments or needs to the issue ticket.
I'd be glad if some of you vote for this ticket. Thanks.
Regards
Ansgar
[1] http://youtrack.jetbrains.net/registerUserForm
[2] http://youtrack.jetbrains.net/issue/IDEA-24348
16 years
Using Collections in LHS
by dhari
In this scenario I do have typical Order and Items data structure. I want to
implement various business rules where I want to check both Order attributes
and Item attributes together.
Order [ Date, Discount, Amount, Customer, Type, Items]
Item [ Quantity, Rate, ExpiresDate, Grade ]
I am trying to implements following rules but all gives me syntax error. I
wondering if someone can help me in.
rule “one”
when
Order ( $discount : Discount, $items : Items)
Item ($discount > 10 && Grade > 3) from $items
then
System.err.print(“Discount is not allowed with items having grade 3 or
higher)
end
rule “two”
when
Order ( $discount : Discount, $items : Items)
Item ($discount > 20 || Quantity < 5 ) from $items
then
//do some thinge
end
--
View this message in context: http://n3.nabble.com/Using-Collections-in-LHS-tp386923p386923.html
Sent from the Drools - User mailing list archive at Nabble.com.
16 years