use of com.evolveum.midpoint.schema.ObjectTreeDeltas in project midpoint by Evolveum.
the class AddAssociationAspect method associationAdditionToDelta.
// creates an ObjectTreeDeltas that will be executed after successful approval of the given assignment
private ObjectTreeDeltas associationAdditionToDelta(ModelContext<?> modelContext, AssociationAdditionType addition, String objectOid) throws SchemaException {
ObjectTreeDeltas changes = new ObjectTreeDeltas(prismContext);
ResourceShadowDiscriminator shadowDiscriminator = ResourceShadowDiscriminator.fromResourceShadowDiscriminatorType(addition.getResourceShadowDiscriminator());
String projectionOid = modelContext.findProjectionContext(shadowDiscriminator).getOid();
ObjectDelta<ShadowType> objectDelta = (ObjectDelta<ShadowType>) DeltaBuilder.deltaFor(ShadowType.class, prismContext).item(ShadowType.F_ASSOCIATION).add(addition.getAssociation().clone()).asObjectDelta(projectionOid);
changes.addProjectionChange(shadowDiscriminator, objectDelta);
return changes;
}
Aggregations