use of org.drools.workbench.models.guided.dtable.shared.model.WorkItemColumnParameterValueDiffImpl in project drools-wb by kiegroup.
the class AuditLogEntryCellHelper method buildColumnDetailsUpdate.
private void buildColumnDetailsUpdate(final ActionWorkItemColumnDetails details, final ActionWorkItemColumnDetails originalDetails, final List<BaseColumnFieldDiff> diffs, final SafeHtmlBuilder sb) {
sb.append(TEMPLATE.commentHeader(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogUpdateAction(details.getColumnHeader())));
SafeHtmlBuilder sbFields = null;
// Show changed fields too.
if (diffs != null && !diffs.isEmpty()) {
sbFields = new SafeHtmlBuilder();
for (BaseColumnFieldDiff diff : diffs) {
String changedFieldName = diff.getFieldName();
if (changedFieldName.equals(DTColumnConfig52.FIELD_HEADER)) {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.ColumnHeader(), diff.getOldValue(), diff.getValue(), sbFields);
} else if (changedFieldName.equals(DTColumnConfig52.FIELD_HIDE_COLUMN)) {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.HideThisColumn(), diff.getOldValue(), diff.getValue(), sbFields);
} else if (changedFieldName.equals(ActionWorkItemCol52.FIELD_WORKITEM_DEFINITION_NAME)) {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogWorkItemName(), diff.getOldValue(), diff.getValue(), sbFields);
} else if (changedFieldName.equals(ActionWorkItemCol52.FIELD_WORKITEM_DEFINITION_PARAMETER_NAME)) {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogWorkItemParameterName(), diff.getOldValue(), diff.getValue(), sbFields);
} else if (changedFieldName.equals(ActionWorkItemCol52.FIELD_WORKITEM_DEFINITION_PARAMETER_VALUE)) {
if (diff instanceof WorkItemColumnParameterValueDiffImpl) {
final String parameterName = ((WorkItemColumnParameterValueDiffImpl) diff).getParameterName();
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogWorkItemParameterValueOnly0(parameterName), diff.getOldValue(), diff.getValue(), sbFields);
} else {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogWorkItemParameterValue(), diff.getOldValue(), diff.getValue(), sbFields);
}
}
}
}
if (sbFields != null) {
sb.append(TEMPLATE.updatedFields(sbFields.toSafeHtml(), labelClass));
}
}
Aggregations