@Override
public WorkflowFormTO getForm(final String workflowId)
throws NotFoundException, WorkflowException {
Task task;
try {
task = taskService.createTaskQuery().processInstanceId(workflowId).singleResult();
} catch (ActivitiException e) {
throw new WorkflowException("While reading form for workflow instance " + workflowId, e);
}
TaskFormData formData;
try {
formData = formService.getTaskFormData(task.getId());
} catch (ActivitiException e) {
LOG.debug("No form found for task {}", task.getId(), e);
formData = null;
}
WorkflowFormTO result = null;
if (formData != null && !formData.getFormProperties().isEmpty()) {