Skip to content

Commit

Permalink
MID-8469 The message generated at assignment (name of CaseType) is mo…
Browse files Browse the repository at this point in the history
…dified to include the relation information of the assignment
  • Loading branch information
wadahiro committed Feb 3, 2023
1 parent ebecdf2 commit 416487a
Showing 1 changed file with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.xml.namespace.QName;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
Expand Down Expand Up @@ -337,11 +338,26 @@ private LocalizableMessage createDefaultProcessName(ModelInvocationContext<?> ct
assignment.isBeingDeleted() ? "Deleted" :
"Modified";

return new LocalizableMessageBuilder()
.key(SchemaConstants.DEFAULT_POLICY_CONSTRAINT_SHORT_MESSAGE_KEY_PREFIX + "assignmentModification.toBe" + operationKey)
.arg(ObjectTypeUtil.createDisplayInformation(target, false))
.arg(ObjectTypeUtil.createDisplayInformation(asPrismObject(focus), false))
.build();
QName relation = assignment.getNormalizedRelation();

if (relation == null) {
return new LocalizableMessageBuilder()
.key(SchemaConstants.DEFAULT_POLICY_CONSTRAINT_SHORT_MESSAGE_KEY_PREFIX + "assignmentModification.toBe" + operationKey)
.arg(ObjectTypeUtil.createDisplayInformation(target, false))
.arg(ObjectTypeUtil.createDisplayInformation(asPrismObject(focus), false))
.build();
} else {
LocalizableMessage relationMessage = new LocalizableMessageBuilder()
.key("relation." + relation.getLocalPart())
.build();

return new LocalizableMessageBuilder()
.key(SchemaConstants.DEFAULT_POLICY_CONSTRAINT_SHORT_REL_MESSAGE_KEY_PREFIX + "assignmentModification.toBe" + operationKey)
.arg(ObjectTypeUtil.createDisplayInformation(target, false))
.arg(ObjectTypeUtil.createDisplayInformation(asPrismObject(focus), false))
.arg(relationMessage)
.build();
}
}

// creates an ObjectDelta that will be executed after successful approval of the given assignment
Expand Down

0 comments on commit 416487a

Please sign in to comment.