diff --git a/midpoint/reference/concepts/clockwork/scripting-hooks.adoc b/midpoint/reference/concepts/clockwork/scripting-hooks.adoc index 04ee89ba8..adef20035 100644 --- a/midpoint/reference/concepts/clockwork/scripting-hooks.adoc +++ b/midpoint/reference/concepts/clockwork/scripting-hooks.adoc @@ -59,7 +59,7 @@ The following code block provides an example of Groovy scripting hook. orgTarget.setOid(org.getOid()); orgTarget.setType(OrgType.COMPLEX_TYPE); assignment.setTargetRef(orgTarget); - assignmentDelta = ContainerDelta.createModificationAdd(UserType.F_ASSIGNMENT, UserType.class, prismContext, assignment); + assignmentDelta = prismContext.deltaFactory().container().createModificationAdd(UserType.F_ASSIGNMENT, UserType.class, assignment); modelContext.getFocusContext().swallowToPrimaryDelta(assignmentDelta); } } @@ -95,7 +95,7 @@ Following scripting hook removes all assignments from disabled users. Please not if (administrativeStatus == ActivationStatusType.DISABLED) { changed = false; for (AssignmentType assign : user.getAssignment()) { - assignmentDelta = ContainerDelta.createModificationDelete(UserType.F_ASSIGNMENT, UserType.class, prismContext, assign.clone()); + assignmentDelta = prismContext.deltaFactory().container().createModificationAdd(UserType.F_ASSIGNMENT, UserType.class, assign.clone()); log.debug('Removing assignment ' + assignmentDelta + ' from disabled user ' + user.getName()); modelContext.getFocusContext().swallowToSecondaryDelta(assignmentDelta); changed = true;