Search in sources :

Example 1 with PolicyItemTargetType

use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.PolicyItemTargetType in project midpoint by Evolveum.

the class GenerateValueExecutor method execute.

@Override
public PipelineData execute(ActionExpressionType action, PipelineData input, ExecutionContext context, OperationResult globalResult) throws ScriptExecutionException, SchemaException, ConfigurationException, ObjectNotFoundException, CommunicationException, SecurityViolationException, ExpressionEvaluationException {
    PolicyItemsDefinitionType itemsDefinition;
    PolicyItemsDefinitionType configured = expressionHelper.getActionArgument(PolicyItemsDefinitionType.class, action, GenerateValueActionExpressionType.F_ITEMS, PARAMETER_ITEMS, input, context, null, PARAMETER_ITEMS, globalResult);
    if (configured != null) {
        itemsDefinition = configured;
    } else {
        itemsDefinition = new PolicyItemsDefinitionType().policyItemDefinition(new PolicyItemDefinitionType().target(new PolicyItemTargetType().path(new ItemPathType(PATH_CREDENTIALS_PASSWORD_VALUE))).execute(false));
    }
    iterateOverObjects(input, context, globalResult, (object, item, result) -> {
        modelInteraction.generateValue(object, itemsDefinition, context.getTask(), result);
        context.println("Generated value(s) for " + object);
    }, (object, exception) -> {
        context.println("Failed to generate value(s) for " + object + exceptionSuffix(exception));
    });
    return input;
}
Also used : PolicyItemsDefinitionType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.PolicyItemsDefinitionType) ItemPathType(com.evolveum.prism.xml.ns._public.types_3.ItemPathType) PolicyItemDefinitionType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.PolicyItemDefinitionType) PolicyItemTargetType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.PolicyItemTargetType)

Aggregations

PolicyItemDefinitionType (com.evolveum.midpoint.xml.ns._public.common.api_types_3.PolicyItemDefinitionType)1 PolicyItemTargetType (com.evolveum.midpoint.xml.ns._public.common.api_types_3.PolicyItemTargetType)1 PolicyItemsDefinitionType (com.evolveum.midpoint.xml.ns._public.common.api_types_3.PolicyItemsDefinitionType)1 ItemPathType (com.evolveum.prism.xml.ns._public.types_3.ItemPathType)1