Expression formKeyExpression = null;
if (taskDefinitionKey == null) {
// TODO: Maybe add getFormKey() to FormHandler interface to avoid the following cast
FormHandler formHandler = processDefinition.getStartFormHandler();
// Sorry!!! In case of a custom start form handler (which does not extend
// the DefaultFormHandler) a formKey would never be returned. So a custom
// form handler (for a startForm) has always to extend the DefaultStartFormHandler!
if (formHandler instanceof DefaultStartFormHandler) {