Re: Drools performance issue
by Mark Proctor
Please send these emails to the user list (in cc) so everyone can help,
not directly to me.
Mark
jayadevan m wrote:
>
> Hi
>
> We have one performance(memory) issue in drools-5
>
> Our Scenario
>
> We have 3 entities
>
> Trip - Entity representing details about trip
>
> Driver - Entity for driver , it contain details about driver
>
> Assignments - details about each assignments (one driver may assigned
> to many trip)
>
> The rule is to find ,"Find overlapping between trip assignments"
>
> For Implementing this we take the Trip ,Driver And Assignments
> entities from Data base and put it into working memory
>
> For Small number of records this rule work well ,
>
> But we want to check it against 15000 driver ,331176 assignments and
> 12745 trips
>
> In that case it take huge amount of time for execution (rule firing )
>
>
>
> Rule is
>
> rule "Assignment Check"
>
> when
>
> $creVo: DriverAssignVO($drId: driverId ,$tid: tripId);
>
> $tripAssignment: TripVO(
>
> $tpid: tripId,
>
> $startDtmUtc: startDtmUtc,
>
> $endDtmUtc: endDtmUtc)
>
> and
>
> $trvo: TripVO(
>
> tripId != $tpid,
>
> tripId in ($tid),
>
> ((startDtmUtc >= $startDtmUtc &&
> startDtmUtc <= $endDtmUtc) ||
>
> (endDtmUtc >= $startDtmUtc && endDtmUtc <=
> $endDtmUtc)));
>
> $crvo: DriverAssignVO($drvrId: driverId , driverId ==
> $drId , tripId != $tid, tripId == $tpid)
>
> then
>
> System.out.println("TRIP ID: " + $crvo.getTripId());
>
> end
>
>
>
> thanks and regards
>
16 years, 7 months
DRL - Accessors that take arguments
by Vidya Chandrasekaran
Hi,
I am fairly new to Drools and am just getting my feet wet with writing
rules.
In my work, I have to integrate drools with classes that do not expose all
properties via getXXX/ isXXX accessor methods but require a call of the form
someMethod("keyvalue"). I have been using the MVEL dialect and do not see a
way to call a function with arguments on the LHS side of a rule either in
the documentation or the mailing list.
In fact, I have been trying something like
rule "rulename"
agenda-group "evaluation"
when
$d: VO( computePrice("key") < 10) from entry-point "Inventory
stream"
then
#
end
This fails with a 'no viable alternative at input '"key"' in rule. Is there
a way this can be accomplished?
Thanks,
Vidya
16 years, 7 months