DataManager dataManager;
try {
dataManager = networkManager.getDataManager();
} catch (NoPeerConnectionException e) {
throw new ProcessExecutionException(e);
}
if (context.consumeUserProfileTask() == null) {
throw new ProcessExecutionException("User profile task in context is null.");
}
boolean success = dataManager.removeUserProfileTask(userId, context.consumeUserProfileTask()
.getContentKey(), context.consumeUserProfileTask().getProtectionKey());
removePerformed = true;
if (!success) {
throw new ProcessExecutionException("Could not remove the user profile task.");
}
}