private boolean executeActionOnTargetAndProcessResults(
final ObjectAdapter targetAdapter,
final AjaxRequestTarget target,
final Form<?> feedbackForm) {
final ActionModel actionModel = getActionModel();
// validate the action parameters (if any)
final String invalidReasonIfAny = actionModel.getReasonInvalidIfAny();
if (invalidReasonIfAny != null) {
raiseWarning(target, feedbackForm, invalidReasonIfAny);
return false;
}
final CommandContext commandContext = getServicesInjector().lookupService(CommandContext.class);
final Command command;
if (commandContext != null) {
command = commandContext.getCommand();
command.setExecutor(Executor.USER);
} else {
command = null;
}
// the object store could raise an exception (eg uniqueness constraint)
// so we handle it here.
try {
// could be programmatic flushing, so must include in the try... finally
final ObjectAdapter resultAdapter = executeActionHandlingApplicationExceptions();
// flush any queued changes, so concurrency or violation exceptions (if any)
// will be thrown here
getTransactionManager().flushTransaction();
ActionResultResponse resultResponse = ActionResultResponseType.determineAndInterpretResult(this.getActionModel(), target, resultAdapter);
resultResponse.getHandlingStrategy().handleResults(this, resultResponse);
if (actionModel.isBookmarkable()) {
bookmarkPage(actionModel);
}
if(actionPrompt != null) {
actionPrompt.closePrompt(target);
// cos will be reused next time, so mustn't cache em.
actionModel.clearArguments();
}
return true;
} catch (RuntimeException ex) {