[DROOLS-296] rewrite or constraints when necessary

Backport fix from master