use of com.evolveum.midpoint.xml.ns._public.model.scripting_3.ResolveReferenceActionExpressionType in project midpoint by Evolveum.
the class ResolveExecutor method execute.
@Override
public PipelineData execute(ActionExpressionType action, PipelineData input, ExecutionContext context, OperationResult globalResult) throws ScriptExecutionException, SchemaException, ConfigurationException, ObjectNotFoundException, CommunicationException, SecurityViolationException, ExpressionEvaluationException {
Collection<SelectorOptions<GetOperationOptions>> options;
if (action instanceof ResolveReferenceActionExpressionType) {
SelectorQualifiedGetOptionsType optionsBean = ((ResolveReferenceActionExpressionType) action).getOptions();
options = GetOperationOptionsUtil.optionsBeanToOptions(optionsBean);
} else {
boolean noFetch = expressionHelper.getArgumentAsBoolean(action.getParameter(), PARAM_NO_FETCH, input, context, false, NAME, globalResult);
options = schemaService.getOperationOptionsBuilder().noFetch(noFetch).build();
}
PipelineData output = PipelineData.createEmpty();
iterateOverItems(input, context, globalResult, (value, item, result) -> resolveReference(context, options, output, item, value, result), (value, exception) -> context.println("Couldn't resolve reference: " + value + exceptionSuffix(exception)));
return output;
}
Aggregations