Class ScriptExpressionEvaluator<V extends PrismValue,D extends ItemDefinition<?>>
java.lang.Object
com.evolveum.midpoint.repo.common.expression.evaluator.AbstractExpressionEvaluator<V,D,E>
com.evolveum.midpoint.model.common.expression.evaluator.transformation.AbstractValueTransformationExpressionEvaluator<V,D,ScriptExpressionEvaluatorType>
com.evolveum.midpoint.model.common.expression.script.ScriptExpressionEvaluator<V,D>
- All Implemented Interfaces:
ExpressionEvaluator<V>
public class ScriptExpressionEvaluator<V extends PrismValue,D extends ItemDefinition<?>>
extends AbstractValueTransformationExpressionEvaluator<V,D,ScriptExpressionEvaluatorType>
Executes specified script written e.g. in Groovy, JavaScript, Python, etc.
Apache Velocity template language is supported as well,
It is a part of
Expression
and ExpressionEvaluator
framework.
This class is a bridge between the "relativity" and "script execution" aspects of the script expression evaluation:
. ScriptExpression
evaluates scripts and ignores all those complex aspects of expressions' relativity,
. and AbstractValueTransformationExpressionEvaluator
and the super-classes deal with relativity handling (etc)
and ignore technical aspects of running Groovy/JS/whatever scripts.- Author:
- Radovan Semancik
-
Field Summary
Fields inherited from class com.evolveum.midpoint.model.common.expression.evaluator.transformation.AbstractValueTransformationExpressionEvaluator
localizationService, securityContextManager
Fields inherited from class com.evolveum.midpoint.repo.common.expression.evaluator.AbstractExpressionEvaluator
expressionEvaluatorBean, outputDefinition, prismContext, protector
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Check expression profile.Short characterization of the evaluator.transformSingleValue
(VariablesMap variables, PlusMinusZero valueDestination, boolean useNew, ExpressionEvaluationContext eCtx, String contextDescription, Task task, OperationResult result) Transforms single value tuple.Methods inherited from class com.evolveum.midpoint.model.common.expression.evaluator.transformation.AbstractValueTransformationExpressionEvaluator
evaluate, isIncludeNullInputs, isRelative
Methods inherited from class com.evolveum.midpoint.repo.common.expression.evaluator.AbstractExpressionEvaluator
addInternalOrigin, applyValueMetadata, findInSourcesAndVariables, finishOutputTriple, getElementName, getOutputDefinition, getPrismContext, getProtector
-
Method Details
-
checkEvaluatorProfile
Description copied from class:AbstractExpressionEvaluator
Check expression profile. Throws security exception if the execution is not allowed by the profile.This implementation works only for simple evaluators that do not have any profile settings. Complex evaluators should override this method.
- Overrides:
checkEvaluatorProfile
in classAbstractExpressionEvaluator<V extends PrismValue,
D extends ItemDefinition<?>, ScriptExpressionEvaluatorType>
-
transformSingleValue
@NotNull protected @NotNull List<V> transformSingleValue(VariablesMap variables, PlusMinusZero valueDestination, boolean useNew, ExpressionEvaluationContext eCtx, String contextDescription, Task task, OperationResult result) throws ExpressionEvaluationException, ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException Description copied from class:AbstractValueTransformationExpressionEvaluator
Transforms single value tuple.- Specified by:
transformSingleValue
in classAbstractValueTransformationExpressionEvaluator<V extends PrismValue,
D extends ItemDefinition<?>, ScriptExpressionEvaluatorType> - Parameters:
variables
- Variables to be applied. Must not be relativistic! All deltas must be sorted out by now.valueDestination
- Where we are going to put output value(s). Actually it's only supplementary information for the transformer as the actual placement of output values is done in the caller.useNew
- Are we using "new" state of sources/input variables? Again, this is only supplementary information, because the variables should be already non-relativistic. Some scripts need to know the value of "useNew".eCtx
- Caller-specified context of the whole expression evaluation.- Throws:
ExpressionEvaluationException
ObjectNotFoundException
SchemaException
CommunicationException
ConfigurationException
SecurityViolationException
-
shortDebugDump
Description copied from interface:ExpressionEvaluator
Short characterization of the evaluator. One line, often only a single word.
-