How hard would it be to allow something like this in the DRL?

rule "myRule"
  when
    t: Total()
    ... // a bunch of complicated fact constraints
  then
    t.increment();
  undo-then
    t.decrement();
end

The current workarounds don't are clunky:
- Writing an negative (opposite) rule isn't efficient: it means declaring the rule twice effectively. Also the negative rule is usually using lots of or's and not's which isn't fast.
- Using logical inserts is a more heavy weight (= slower).



Here's another description of this feature request from the user mailing list:

Ah, well that's my point of ignorance, then.  I was thinking in stateless mode.  :)   And 
to do what I suggest in a stateful manner would require a "modifyLogical" type 
functionality in place of the insertLogical.  i.e.

modifyLogical (object) {
  //do this when the condition obtains
} else {
  //do this when the condition no longer obtains
}

Could be an interesting functionality to have, though.


--
With kind regards,
Geoffrey De Smet

_______________________________________________
rules-dev mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-dev

Reply via email to