Search in sources :

Example 6 with ObjectTreeDeltas

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;
}
Also used : ResourceShadowDiscriminator(com.evolveum.midpoint.schema.ResourceShadowDiscriminator) ObjectDelta(com.evolveum.midpoint.prism.delta.ObjectDelta) ObjectTreeDeltas(com.evolveum.midpoint.schema.ObjectTreeDeltas)

Aggregations

ObjectTreeDeltas (com.evolveum.midpoint.schema.ObjectTreeDeltas)6 ObjectDelta (com.evolveum.midpoint.prism.delta.ObjectDelta)3 ResourceShadowDiscriminator (com.evolveum.midpoint.schema.ResourceShadowDiscriminator)3 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)2 WfTask (com.evolveum.midpoint.wf.impl.tasks.WfTask)2 ShadowType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)2 Map (java.util.Map)2 ModelProjectionContext (com.evolveum.midpoint.model.api.context.ModelProjectionContext)1 Scene (com.evolveum.midpoint.model.api.visualizer.Scene)1 LensContext (com.evolveum.midpoint.model.impl.lens.LensContext)1 LensFocusContext (com.evolveum.midpoint.model.impl.lens.LensFocusContext)1 TaskRunResultStatus (com.evolveum.midpoint.task.api.TaskRunResult.TaskRunResultStatus)1 SceneDto (com.evolveum.midpoint.web.component.prism.show.SceneDto)1 PcpChildWfTaskCreationInstruction (com.evolveum.midpoint.wf.impl.processors.primary.PcpChildWfTaskCreationInstruction)1