[DROOLS-73] avoid infinite loop during DSL expansion
(cherry picked from commit 3a2082c7e3be099b5a481878ddb1ccc3f5c9bae6)