initSelectedOperationInfo();
return "missingParams";
}
else
{
OperationHistory newOperationHistory = this.historyManager.addOperationHistory(operationDef.getName(),
this.selectedOperationParameters, this.currentResource, resourceType);
// Null this out as soon as we're done with it, so it won't carry over to the next request.
this.selectedOperationParameters = null;
ResourceManager resourceManager = ResourceManagerFactory.resourceManager();
String jobId = newOperationHistory.getJobId().toString();
try
{
resourceManager.invokeOperation(this.currentResource, operationDef, newOperationHistory.getParameters(),
jobId);
this.facesMessages.add("The #0 operation has been invoked. See the operation history below for the results once the operation has completed.",
operationDef.getDisplayName());
}
catch (RuntimeException e)
{
newOperationHistory.setStatus(OperationRequestStatus.FAILURE);
newOperationHistory.setErrorMessage(e.toString());
this.facesMessages.add(FacesMessage.SEVERITY_FATAL, "Failed to invoke operation: #0", e);
}
initHistories();
// Auto-select the operation history, so its results will be displayed in the
// "Selected Operation History Item" panel.
selectOperationHistory(newOperationHistory.getId());
return "success";
}
}