[jboss-jira] [JBoss JIRA] (JBRULES-3144) undo-then: when rule becomes no longer true execute a callback"

Geoffrey De Smet (Assigned) (JIRA) jira-events at lists.jboss.org
Tue Jan 3 13:51:09 EST 2012


     [ https://issues.jboss.org/browse/JBRULES-3144?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Geoffrey De Smet reassigned JBRULES-3144:
-----------------------------------------

    Assignee: Mark Proctor  (was: Geoffrey De Smet)


My experiments proved that planner can be a lot faster if undo-then is implemented in drools expert, so I hope it's considered in the DRL language design to include undo-then.
                
> undo-then: when rule becomes no longer true execute a callback"
> ---------------------------------------------------------------
>
>                 Key: JBRULES-3144
>                 URL: https://issues.jboss.org/browse/JBRULES-3144
>             Project: Drools
>          Issue Type: Task
>      Security Level: Public(Everyone can see) 
>          Components: drools-core  (expert), drools-planner
>            Reporter: Geoffrey De Smet
>            Assignee: Mark Proctor
>
> 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: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list