Use BPMN Model API for typical compensation use case

Hm, good question, not sure what the best way is. I personally lean towards consistency in such questions, but that’s debatable. If we want to prevent users from creating invalid models (e.g. compensation handlers with outgoing sequence flows), the compensationHandler() approach might be favourable, as it could return a builder that is limited to creating a single task.

On a side note, I found the idea proposed by @David_Karr quite interesting:

Java 8 is out of the picture at the moment, though.