Search in sources :

Example 1 with ConditionColumnDetails

use of org.drools.workbench.models.guided.dtable.shared.auditlog.ConditionColumnDetails in project drools-wb by kiegroup.

the class AuditLogEntryCellHelper method buildColumnDetailsUpdate.

private void buildColumnDetailsUpdate(final ColumnDetails details, final ColumnDetails originalDetails, final List<BaseColumnFieldDiff> diffs, final SafeHtmlBuilder sb) {
    if ((details instanceof ConditionColumnDetails) && (originalDetails instanceof ConditionColumnDetails)) {
        buildColumnDetailsUpdate((ConditionColumnDetails) details, (ConditionColumnDetails) originalDetails, diffs, sb);
    } else if ((details instanceof LimitedEntryConditionColumnDetails) && (originalDetails instanceof LimitedEntryConditionColumnDetails)) {
        buildColumnDetailsUpdate((LimitedEntryConditionColumnDetails) details, (LimitedEntryConditionColumnDetails) originalDetails, diffs, sb);
    } else if ((details instanceof ActionInsertFactColumnDetails) && (originalDetails instanceof ActionInsertFactColumnDetails)) {
        buildColumnDetailsUpdate((ActionInsertFactColumnDetails) details, (ActionInsertFactColumnDetails) originalDetails, diffs, sb);
    } else if ((details instanceof LimitedEntryActionInsertFactColumnDetails) && (originalDetails instanceof LimitedEntryActionInsertFactColumnDetails)) {
        buildColumnDetailsUpdate((LimitedEntryActionInsertFactColumnDetails) details, (LimitedEntryActionInsertFactColumnDetails) originalDetails, diffs, sb);
    } else if ((details instanceof ActionSetFieldColumnDetails) && (originalDetails instanceof ActionSetFieldColumnDetails)) {
        buildColumnDetailsUpdate((ActionSetFieldColumnDetails) details, (ActionSetFieldColumnDetails) originalDetails, diffs, sb);
    } else if ((details instanceof LimitedEntryActionSetFieldColumnDetails) && (originalDetails instanceof LimitedEntryActionSetFieldColumnDetails)) {
        buildColumnDetailsUpdate((LimitedEntryActionSetFieldColumnDetails) details, (LimitedEntryActionSetFieldColumnDetails) originalDetails, diffs, sb);
    } else if ((details instanceof AttributeColumnDetails) && (originalDetails instanceof AttributeColumnDetails)) {
        buildColumnDetailsUpdate((AttributeColumnDetails) details, (AttributeColumnDetails) originalDetails, diffs, sb);
    } else if ((details instanceof MetadataColumnDetails) && (originalDetails instanceof MetadataColumnDetails)) {
        buildColumnDetailsUpdate((MetadataColumnDetails) details, (MetadataColumnDetails) originalDetails, diffs, sb);
    } else if ((details instanceof ActionWorkItemColumnDetails) && (originalDetails instanceof ActionWorkItemColumnDetails)) {
        buildColumnDetailsUpdate((ActionWorkItemColumnDetails) details, (ActionWorkItemColumnDetails) originalDetails, diffs, sb);
    } else if ((details instanceof ActionWorkItemInsertFactColumnDetails) && (originalDetails instanceof ActionWorkItemInsertFactColumnDetails)) {
        buildColumnDetailsUpdate((ActionWorkItemInsertFactColumnDetails) details, (ActionWorkItemInsertFactColumnDetails) originalDetails, diffs, sb);
    } else if ((details instanceof ActionWorkItemSetFieldColumnDetails) && (originalDetails instanceof ActionWorkItemSetFieldColumnDetails)) {
        buildColumnDetailsUpdate((ActionWorkItemSetFieldColumnDetails) details, (ActionWorkItemSetFieldColumnDetails) originalDetails, diffs, sb);
    } else {
        sb.append(TEMPLATE.commentHeader(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogUpdateColumn(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(DTColumnConfig52.FIELD_DEFAULT_VALUE)) {
                    buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.DefaultValue(), diff.getOldValue(), diff.getValue(), sbFields);
                }
            }
        }
        if (sbFields != null) {
            sb.append(TEMPLATE.updatedFields(sbFields.toSafeHtml(), labelClass));
        }
    }
}
Also used : LimitedEntryConditionColumnDetails(org.drools.workbench.models.guided.dtable.shared.auditlog.LimitedEntryConditionColumnDetails) ConditionColumnDetails(org.drools.workbench.models.guided.dtable.shared.auditlog.ConditionColumnDetails) ActionWorkItemSetFieldColumnDetails(org.drools.workbench.models.guided.dtable.shared.auditlog.ActionWorkItemSetFieldColumnDetails) MetadataColumnDetails(org.drools.workbench.models.guided.dtable.shared.auditlog.MetadataColumnDetails) LimitedEntryConditionColumnDetails(org.drools.workbench.models.guided.dtable.shared.auditlog.LimitedEntryConditionColumnDetails) LimitedEntryActionSetFieldColumnDetails(org.drools.workbench.models.guided.dtable.shared.auditlog.LimitedEntryActionSetFieldColumnDetails) LimitedEntryActionInsertFactColumnDetails(org.drools.workbench.models.guided.dtable.shared.auditlog.LimitedEntryActionInsertFactColumnDetails) ActionWorkItemColumnDetails(org.drools.workbench.models.guided.dtable.shared.auditlog.ActionWorkItemColumnDetails) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder) AttributeColumnDetails(org.drools.workbench.models.guided.dtable.shared.auditlog.AttributeColumnDetails) ActionInsertFactColumnDetails(org.drools.workbench.models.guided.dtable.shared.auditlog.ActionInsertFactColumnDetails) LimitedEntryActionInsertFactColumnDetails(org.drools.workbench.models.guided.dtable.shared.auditlog.LimitedEntryActionInsertFactColumnDetails) ActionWorkItemInsertFactColumnDetails(org.drools.workbench.models.guided.dtable.shared.auditlog.ActionWorkItemInsertFactColumnDetails) BaseColumnFieldDiff(org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff) LimitedEntryActionSetFieldColumnDetails(org.drools.workbench.models.guided.dtable.shared.auditlog.LimitedEntryActionSetFieldColumnDetails) ActionSetFieldColumnDetails(org.drools.workbench.models.guided.dtable.shared.auditlog.ActionSetFieldColumnDetails)

Aggregations

SafeHtmlBuilder (com.google.gwt.safehtml.shared.SafeHtmlBuilder)1 ActionInsertFactColumnDetails (org.drools.workbench.models.guided.dtable.shared.auditlog.ActionInsertFactColumnDetails)1 ActionSetFieldColumnDetails (org.drools.workbench.models.guided.dtable.shared.auditlog.ActionSetFieldColumnDetails)1 ActionWorkItemColumnDetails (org.drools.workbench.models.guided.dtable.shared.auditlog.ActionWorkItemColumnDetails)1 ActionWorkItemInsertFactColumnDetails (org.drools.workbench.models.guided.dtable.shared.auditlog.ActionWorkItemInsertFactColumnDetails)1 ActionWorkItemSetFieldColumnDetails (org.drools.workbench.models.guided.dtable.shared.auditlog.ActionWorkItemSetFieldColumnDetails)1 AttributeColumnDetails (org.drools.workbench.models.guided.dtable.shared.auditlog.AttributeColumnDetails)1 ConditionColumnDetails (org.drools.workbench.models.guided.dtable.shared.auditlog.ConditionColumnDetails)1 LimitedEntryActionInsertFactColumnDetails (org.drools.workbench.models.guided.dtable.shared.auditlog.LimitedEntryActionInsertFactColumnDetails)1 LimitedEntryActionSetFieldColumnDetails (org.drools.workbench.models.guided.dtable.shared.auditlog.LimitedEntryActionSetFieldColumnDetails)1 LimitedEntryConditionColumnDetails (org.drools.workbench.models.guided.dtable.shared.auditlog.LimitedEntryConditionColumnDetails)1 MetadataColumnDetails (org.drools.workbench.models.guided.dtable.shared.auditlog.MetadataColumnDetails)1 BaseColumnFieldDiff (org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff)1