[DROOLS-661] Make accumulate fuctions aware of join variables

(cherry picked from commit 4cbc25b15c706b9ae40625138a2b0b09a07c5a86)