Search in sources :

Example 1 with OrphanedPolicyConstraintType

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

the class OrphanedConstraintEvaluator method createBuiltInMessage.

@NotNull
private <AH extends AssignmentHolderType> LocalizableMessage createBuiltInMessage(String keyPrefix, JAXBElement<OrphanedPolicyConstraintType> constraintElement, PolicyRuleEvaluationContext<AH> ctx, OperationResult result) throws ExpressionEvaluationException, ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException {
    OrphanedPolicyConstraintType constraint = constraintElement.getValue();
    List<Object> args = new ArrayList<>();
    args.add(evaluatorHelper.createBeforeAfterMessage(ctx));
    String keySuffix;
    if (constraint.getName() != null) {
        args.add(constraint.getName());
        keySuffix = KEY_NAMED;
    } else {
        keySuffix = KEY_UNNAMED;
    }
    LocalizableMessage builtInMessage = new LocalizableMessageBuilder().key(keyPrefix + keySuffix).args(args).build();
    return evaluatorHelper.createLocalizableMessage(constraintElement, ctx, builtInMessage, result);
}
Also used : ArrayList(java.util.ArrayList) LocalizableMessage(com.evolveum.midpoint.util.LocalizableMessage) PrismObject(com.evolveum.midpoint.prism.PrismObject) LocalizableMessageBuilder(com.evolveum.midpoint.util.LocalizableMessageBuilder) OrphanedPolicyConstraintType(com.evolveum.midpoint.xml.ns._public.common.common_3.OrphanedPolicyConstraintType) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

PrismObject (com.evolveum.midpoint.prism.PrismObject)1 LocalizableMessage (com.evolveum.midpoint.util.LocalizableMessage)1 LocalizableMessageBuilder (com.evolveum.midpoint.util.LocalizableMessageBuilder)1 OrphanedPolicyConstraintType (com.evolveum.midpoint.xml.ns._public.common.common_3.OrphanedPolicyConstraintType)1 ArrayList (java.util.ArrayList)1 NotNull (org.jetbrains.annotations.NotNull)1