Search in sources :

Example 1 with RecomputeActionExpressionType

use of com.evolveum.midpoint.xml.ns._public.model.scripting_3.RecomputeActionExpressionType in project midpoint by Evolveum.

the class RecomputeExecutor method execute.

@Override
public PipelineData execute(ActionExpressionType action, PipelineData input, ExecutionContext context, OperationResult globalResult) throws ScriptExecutionException, SchemaException, ObjectNotFoundException, SecurityViolationException, CommunicationException, ConfigurationException, ExpressionEvaluationException {
    boolean dryRun = operationsHelper.getDryRun(action, input, context, globalResult);
    ModelExecuteOptions options = operationsHelper.getOptions(action, input, context, globalResult);
    options.reconcile(true);
    TriggerCreationType triggerCreation = action instanceof RecomputeActionExpressionType ? ((RecomputeActionExpressionType) action).getTriggered() : null;
    iterateOverObjects(input, context, globalResult, (object, item, result) -> recompute(object, dryRun, options, triggerCreation, context, result), (object, exception) -> context.println("Failed to recompute " + object + drySuffix(dryRun) + exceptionSuffix(exception)));
    return input;
}
Also used : TriggerCreationType(com.evolveum.midpoint.xml.ns._public.common.common_3.TriggerCreationType) ModelExecuteOptions(com.evolveum.midpoint.model.api.ModelExecuteOptions) RecomputeActionExpressionType(com.evolveum.midpoint.xml.ns._public.model.scripting_3.RecomputeActionExpressionType)

Aggregations

ModelExecuteOptions (com.evolveum.midpoint.model.api.ModelExecuteOptions)1 TriggerCreationType (com.evolveum.midpoint.xml.ns._public.common.common_3.TriggerCreationType)1 RecomputeActionExpressionType (com.evolveum.midpoint.xml.ns._public.model.scripting_3.RecomputeActionExpressionType)1