Skip to content

Commit

Permalink
MID-7606 fixed names for references
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Mar 9, 2022
1 parent d31fbc0 commit 8391ada
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ public static TaskType createResourceTask(PrismContext prismContext, String task
ObjectReferenceType resourceRef = new ObjectReferenceType();
resourceRef.setOid(resource.getOid());
resourceRef.setType(ResourceType.COMPLEX_TYPE);
resourceRef.setTargetName(new PolyStringType(resource.getName()));
newTask.setObjectRef(resourceRef);

String name = createNewTaskName(taskNamePrefix, resource);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ private void prepopulateTask(PrismObject<TaskType> object) {
if (task.getOwnerRef() == null) {
try {
FocusType focus = getSecurityContextManager().getPrincipal().getFocus();
task.ownerRef(getSecurityContextManager().getPrincipalOid(), focus.asPrismObject().getDefinition().getTypeName());
ObjectReferenceType ownerRef = new ObjectReferenceType();
ownerRef.setOid(getSecurityContextManager().getPrincipalOid());
ownerRef.setType(focus.asPrismObject().getDefinition().getTypeName());
ownerRef.setTargetName(focus.getName());
task.ownerRef(ownerRef);
} catch (SecurityViolationException e) {
// we can ignore it here probably
}
Expand Down

0 comments on commit 8391ada

Please sign in to comment.