Calling function in state machine transition rule?

Thanks Gatherer. Although you made a small mistake. You will not find your defined event on the transition page but on the event graph.