TaskDefinition is only the UserTask-specific bit. Inspect the actual ActivityImpl which is present in the ReadOnlyProcessDefinition (repositoryService):
public interface PvmActivity extends PvmScope {
boolean isAsync();
Alternatively, you could add a BPMNParseListener (in 5.12, this will be a slight different name and approach, but the end-result will be the same) and inspect the XML-element or the intermediate model, so you can throw an exception when the process is deployed (as of 5.11):
/**
* @author Tijs Rademakers
*/
public class Activity extends FlowNode {
…
public boolean isAsynchronous() {
return asynchronous;
}
In case you're using a version prior to 5.11, you can always inspect the "async" attribute in the XML-element, passed in the BPMNParseListeners…