use of com.evolveum.midpoint.studio.impl.browse.GeneratorOptions in project midpoint-studio by Evolveum.
the class UploadTestValidateResourceTask method processObject.
@Override
public ProcessObjectResult processObject(MidPointObject obj) throws Exception {
ProcessObjectResult por = super.processObject(obj);
OperationResult testConnectionResult = por.result();
String name = obj.getName();
if (testConnectionResult != null && !testConnectionResult.isSuccess()) {
printProblem("Skipping resource validation for " + name + ", there was a problem with upload/test");
return por;
}
if (!ObjectTypes.RESOURCE.equals(obj.getType())) {
printProblem("Can't validate resource for " + name + ", because it's " + obj.getType().getClassDefinition().getName());
return por;
}
GeneratorOptions genOptions = new GeneratorOptions();
BulkActionGenerator gen = new BulkActionGenerator(BulkActionGenerator.Action.VALIDATE);
String requestString = gen.generateFromSourceObject(obj, genOptions, getProject());
ExecuteScriptResponseType response = client.execute(requestString);
OperationResultType res = response.getResult();
OperationResult executionResult = OperationResult.createOperationResult(res);
return validateOperationResult("validate", executionResult, obj.getName());
}
Aggregations