// take care of serialization
if( cmd instanceof GetTaskCommand
|| cmd instanceof GetContentCommand
|| cmd instanceof GetTaskContentCommand ) {
cmd = new ExecuteAndSerializeCommand(cmd);
}
try {
return userTaskService.execute(deploymentId, cmd);
} catch (TaskNotFoundException e) {
throw KieRemoteRestOperationException.notFound("Task " + taskId + " could not be found!");