How to find the all userTask elements before the specified userTask element

I have a problem when I do the reject operation on a userTask element, as shown in the picture below: I want to reject current userTask to specified userTask element. The problem is that how to find all userTask elements before the current userTask element.

This might be difficult, since you have to define first, what before means.

a) visually (x-coordinate)
b) flow-wise

In terms of b), you could solve this by chaining through the incoming properties and then identify bpmn:UserTask elements.