*/
public String invokeOperation()
{
//this.facesMessages.clear();
ResourceType resourceType = getResourceType();
OperationDefinition operationDef = getOperationDefinition(resourceType, this.selectedOperationName);
ConfigurationDefinition paramDef = operationDef.getParametersConfigurationDefinition();
if (paramDef != null && !paramDef.getPropertyDefinitions().isEmpty() && this.selectedOperationParameters == null)
{
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());