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.
14 years, 9 months
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
14 years, 9 months
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?
14 years, 9 months
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
14 years, 9 months
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.
14 years, 9 months
Deploying a package to Guvnor
by spamcontrol@mac.com
Is there a way to import a package file (as built by ant) into Guvnor? I can see how to import rules and jars, but I'd like to upload a complete package (POJO's + rules) in a single step to Guvnor. Is this currently possible?
14 years, 9 months
AGE problem
by Pavel Tavoda
Hello,
I would like to calculate AGE of object based on Date inside object, I
can use eval but I hope it's so basic functionality that Drools should
have it. It's also performance problem if I need to use EVAL in many
rules (let's say 100 in XLS). I'm playing with some FUSION features
like:
$now : Now() && $order : SecurityOrder(this before[400d, 0d] $now)
should work but I can't specify YEARS as constant. That's a problem
for long time because 30*365d isn't same as 30 years if you consider
leap years. Is it possible some easy way to calculate AGE of something
with correct time handling and compare to years? Something like:
SecurityOrder( age(createdDate) > 20y, age(createdDate) < 25y)
or by FUSION:
$now : Now() && $order : SecurityOrder(this before[25y, 20y] $now)
For now I'm using following function in eval() but it's becoming
performance problem:
function boolean between(Calendar currentDate, Date oldDate, int from, int to) {
Calendar fromCal = Calendar.getInstance();
fromCal.setTime(oldDate);
fromCal.add(Calendar.YEAR, from);
Calendar toCal = Calendar.getInstance();
toCal.setTime(oldDate);
toCal.add(Calendar.YEAR, to);
return currentDate.after(fromCal) && currentDate.before(toCal);
}
Thank you
Pavel
14 years, 9 months