report = super.createResource(report);
// Since our properties are can be added at parent resource creation time, we have to make sure they are added.
if (report.getStatus() == CreateResourceStatus.SUCCESS) {
// Now we have to send this as an update, so the properties are created properly
ConfigurationUpdateReport updateReport = new ConfigurationUpdateReport(report.getResourceConfiguration());
ConfigurationDefinition configDef = report.getResourceType().getResourceConfigurationDefinition();
Address address = new Address(getAddress());
address.add(report.getPluginConfiguration().getSimpleValue("path"),report.getUserSpecifiedResourceName());
ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(configDef, getASConnection(), address);
delegate.updateResourceConfiguration(updateReport);
if (updateReport.getStatus() != ConfigurationUpdateStatus.SUCCESS) {
report.setErrorMessage(updateReport.getErrorMessage());
report.setStatus(CreateResourceStatus.FAILURE);
}
}
return report;
}