The easiest way is to use some object that can be used to hold the result. It is a variable that you insert in the on entry script of the rule task, the rules set the results on that object during processing and in the on exit script you can access the results easily and for example set them as a variable.
i will do the same way.. but i have another query... based on the rule decision i need to take the decision to move process further or make it process failed... to handled this scenario i need the rule decision value into my java program.
for example my java program know the process ID. based on process ID is there any way to get the rule Output variable.??