Search in sources :

Example 1 with ResolveReferenceActionExpressionType

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;
}
Also used : SelectorOptions(com.evolveum.midpoint.schema.SelectorOptions) PipelineData(com.evolveum.midpoint.model.impl.scripting.PipelineData) ResolveReferenceActionExpressionType(com.evolveum.midpoint.xml.ns._public.model.scripting_3.ResolveReferenceActionExpressionType) SelectorQualifiedGetOptionsType(com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionsType)

Aggregations

PipelineData (com.evolveum.midpoint.model.impl.scripting.PipelineData)1 SelectorOptions (com.evolveum.midpoint.schema.SelectorOptions)1 SelectorQualifiedGetOptionsType (com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionsType)1 ResolveReferenceActionExpressionType (com.evolveum.midpoint.xml.ns._public.model.scripting_3.ResolveReferenceActionExpressionType)1