Search in sources :

Example 1 with S_ValuesEntry

use of com.evolveum.midpoint.prism.delta.builder.S_ValuesEntry in project midpoint by Evolveum.

the class PolicyRuleBasedAspect method assignmentToDelta.

// creates an ObjectDelta that will be executed after successful approval of the given assignment
@SuppressWarnings("unchecked")
private ObjectDelta<? extends FocusType> assignmentToDelta(Class<? extends Objectable> focusClass, AssignmentType assignmentType, boolean assignmentRemoved, String objectOid) throws SchemaException {
    PrismContainerValue value = assignmentType.clone().asPrismContainerValue();
    S_ValuesEntry item = DeltaBuilder.deltaFor(focusClass, prismContext).item(FocusType.F_ASSIGNMENT);
    S_ItemEntry op = assignmentRemoved ? item.delete(value) : item.add(value);
    return (ObjectDelta<? extends FocusType>) op.asObjectDelta(objectOid);
}
Also used : PrismContainerValue(com.evolveum.midpoint.prism.PrismContainerValue) S_ItemEntry(com.evolveum.midpoint.prism.delta.builder.S_ItemEntry) ObjectDelta(com.evolveum.midpoint.prism.delta.ObjectDelta) S_ValuesEntry(com.evolveum.midpoint.prism.delta.builder.S_ValuesEntry)

Aggregations

PrismContainerValue (com.evolveum.midpoint.prism.PrismContainerValue)1 ObjectDelta (com.evolveum.midpoint.prism.delta.ObjectDelta)1 S_ItemEntry (com.evolveum.midpoint.prism.delta.builder.S_ItemEntry)1 S_ValuesEntry (com.evolveum.midpoint.prism.delta.builder.S_ValuesEntry)1