throws WorkflowException {
Map.Entry<Task, TaskFormData> checked = checkTask(form.getTaskId(), username);
if (!checked.getKey().getOwner().equals(username)) {
throw new WorkflowException(new IllegalArgumentException("Task " + form.getTaskId() + " assigned to "
+ checked.getKey().getOwner() + " but submited by " + username));
}
SyncopeUser user = userDAO.findByWorkflowId(checked.getKey().getProcessInstanceId());
if (user == null) {
throw new NotFoundException("User with workflow id " + checked.getKey().getProcessInstanceId());
}
Set<String> preTasks = getPerformedTasks(user);
try {
formService.submitTaskFormData(form.getTaskId(), form.getPropertiesForSubmit());
} catch (ActivitiException e) {
throw new WorkflowException("While submitting form for task " + form.getTaskId(), e);
}
Set<String> postTasks = getPerformedTasks(user);
postTasks.removeAll(preTasks);
postTasks.add(form.getTaskId());