Please take a look at this solution. It seems to be what you are looking for.
Functional Behavior Tree