public static String getComment(AbstractWorkItemOutputType output) { return output != null ? output.getComment() : null; }
public static String prettyPrintCertCommentForReport(AbstractWorkItemOutputType output) { return output != null ? output.getComment() : null; }
record.setResult(answer); message.append(answer); if (output.getComment() != null) { message.append(" : ").append(output.getComment()); record.addPropertyValue(WorkflowConstants.AUDIT_COMMENT, output.getComment());
public static String prettyPrintOutputChangeForReport(PrismContainerValue<AccessCertificationWorkItemType> workItemPcv) { if (workItemPcv == null) { // should not occur return ""; } AccessCertificationWorkItemType workItem = workItemPcv.asContainerable(); if (workItem.getOutputChangeTimestamp() != null && workItem.getOutput() != null && (workItem.getOutput().getOutcome() != null || StringUtils.isNotBlank(workItem.getOutput().getComment()))) { // output change timestamp is shown only if there's a real outcome (either result or comment) return prettyPrintForReport(workItem.getOutputChangeTimestamp()); } else { return ""; } }
public static String prettyPrintPerformerOrAssigneesForReport(PrismContainerValue<AbstractWorkItemType> workItemPcv) { if (workItemPcv == null) { // should not occur return ""; } AbstractWorkItemType workItem = workItemPcv.asContainerable(); if (workItem.getPerformerRef() != null && workItem.getOutput() != null && (workItem.getOutput().getOutcome() != null || StringUtils.isNotBlank(workItem.getOutput().getComment()))) { // performer is shown only if there's a real outcome (either result or comment) return prettyPrintForReport(workItem.getPerformerRef(), false); } else { return "(" + prettyPrintReferencesForReport(workItem.getAssigneeRef(), false) + ")"; } }
private String formatComment(ObjectReferenceType performerRef, AbstractWorkItemOutputType output, AbstractWorkItemType workItem, WorkItemCompletionEventType event, Task task, OperationResult result) { if (formatting == null || formatting.getCondition() == null && formatting.getValue() == null) { return output.getComment(); LoggingUtils.logUnexpectedException(LOGGER, "Couldn't evaluate value expression in comments formatter - using plain comment value; " + "performer = {}, output = {}, workItem = {}, event = {}", e, performer, output, workItem, event); return output.getComment(); return output.getComment();
private List<ItemDelta<?, ?>> createMetadataDeltas(AccessCertificationCaseType aCase, AccessCertificationCampaignType campaign, Class<? extends ObjectType> objectClass, ItemPath pathPrefix, RunContext runContext, OperationResult result) throws SchemaException { String outcome = aCase.getOutcome(); if (OutcomeUtils.isNoneOrNotDecided(outcome)) { return emptyList(); } Set<ObjectReferenceType> certifiers = new HashSet<>(); Set<String> comments = new HashSet<>(); for (AccessCertificationWorkItemType workItem : aCase.getWorkItem()) { AbstractWorkItemOutputType output = workItem.getOutput(); if (workItem.getPerformerRef() == null || output == null) { continue; } boolean commentNotEmpty = StringUtils.isNotEmpty(output.getComment()); if (commentNotEmpty || !OutcomeUtils.isNoneOrNotDecided(output.getOutcome())) { certifiers.add(workItem.getPerformerRef().clone()); String formattedComment = runContext.commentsFormatter.formatComment(workItem, runContext.task, result); if (StringUtils.isNotEmpty(formattedComment)) { comments.add(formattedComment); } } } return prismContext.deltaFor(objectClass) .item(pathPrefix.append(MetadataType.F_CERTIFICATION_FINISHED_TIMESTAMP)).replace(campaign.getEndTimestamp()) .item(pathPrefix.append(MetadataType.F_CERTIFICATION_OUTCOME)).replace(outcome) .item(pathPrefix.append(MetadataType.F_CERTIFIER_REF)).replaceRealValues(certifiers) .item(pathPrefix.append(MetadataType.F_CERTIFIER_COMMENT)).replaceRealValues(comments) .asItemDeltas(); }