]
Mark Proctor resolved JBRULES-3144.
-----------------------------------
Fix Version/s: 5.4.0.Final
Resolution: Done
UnMatch Listener for Compensation Actions
-----------------------------------------
Key: JBRULES-3144
URL:
https://issues.jboss.org/browse/JBRULES-3144
Project: Drools
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Components: drools-core (expert)
Reporter: Geoffrey De Smet
Assignee: Mark Proctor
Priority: Critical
Fix For: 5.4.0.Final
Here's what I'd like to be able to do:
{code}
rule "serviceConflict"
when
$leftProcessAssignment : MrProcessAssignment($service : service, $machine :
machine, $leftId : id)
$rightProcessAssignment : MrProcessAssignment(service == $service, machine ==
$machine, id > $leftId)
then
scoreCalculator.addToHardScore(1); // No insertLogical or accumulate of those
ConstraintOccurence's needed
undo-then
scoreCalculator.substractFromHardScore(1);
end
{code}
And here's a more complex example where the weight isn't a static "1":
{code}
rule "serviceLocationSpread"
when
$service : MrService($locationSpread : locationSpread)
$spreadCount : Number(intValue < $locationSpread) from accumulate(
$location : MrLocation()
and exists MrProcessAssignment(service == $service, location ==
$location),
count($location)
)
then
scoreCalculator.addToHardScore($locationSpread - $spreadCount.intValue());
undo-then
scoreCalculator.substractFromHardScore($locationSpread -
$spreadCount.intValue());
// $spreadCount should still be the same as it used to be
end
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: