Search in sources :

Example 26 with ExpressionType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ExpressionType in project midpoint by Evolveum.

the class GcpExpressionHelper method evaluateActivationCondition.

boolean evaluateActivationCondition(GeneralChangeProcessorScenarioType scenarioType, ModelContext context, Task taskFromModel, OperationResult result) throws SchemaException {
    ExpressionType conditionExpression = scenarioType.getActivationCondition();
    if (conditionExpression == null) {
        return true;
    }
    ExpressionVariables variables = new ExpressionVariables();
    variables.addVariableDefinition(new QName(SchemaConstants.NS_C, "context"), context);
    boolean start;
    try {
        start = evaluateBooleanExpression(conditionExpression, variables, "workflow activation condition", taskFromModel, result);
    } catch (ObjectNotFoundException | ExpressionEvaluationException e) {
        throw new SystemException("Couldn't evaluate generalChangeProcessor activation condition", e);
    }
    return start;
}
Also used : ExpressionVariables(com.evolveum.midpoint.repo.common.expression.ExpressionVariables) ExpressionEvaluationException(com.evolveum.midpoint.util.exception.ExpressionEvaluationException) SystemException(com.evolveum.midpoint.util.exception.SystemException) QName(javax.xml.namespace.QName) ObjectNotFoundException(com.evolveum.midpoint.util.exception.ObjectNotFoundException) ExpressionType(com.evolveum.midpoint.xml.ns._public.common.common_3.ExpressionType)

Aggregations

ExpressionType (com.evolveum.midpoint.xml.ns._public.common.common_3.ExpressionType)19 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)8 QName (javax.xml.namespace.QName)8 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)7 ArrayList (java.util.ArrayList)7 ExpressionEvaluationContext (com.evolveum.midpoint.repo.common.expression.ExpressionEvaluationContext)6 ExpressionVariables (com.evolveum.midpoint.repo.common.expression.ExpressionVariables)6 ShadowType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)6 Test (org.testng.annotations.Test)6 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)5 PolyString (com.evolveum.midpoint.prism.polystring.PolyString)5 ExpressionEvaluationException (com.evolveum.midpoint.util.exception.ExpressionEvaluationException)5 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)5 ObjectReferenceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType)5 ObjectDelta (com.evolveum.midpoint.prism.delta.ObjectDelta)4 Task (com.evolveum.midpoint.task.api.Task)4 ObjectNotFoundException (com.evolveum.midpoint.util.exception.ObjectNotFoundException)4 MappingType (com.evolveum.midpoint.xml.ns._public.common.common_3.MappingType)4 ObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType)3 ItemPathType (com.evolveum.prism.xml.ns._public.types_3.ItemPathType)3