Search in sources :

Example 1 with UpdateColumnAuditLogEntry

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

the class AuditLogEntryCellHelperTest method getSafeHtml_ActionWorkItemInsert.

@Test
public void getSafeHtml_ActionWorkItemInsert() {
    ActionWorkItemInsertFactCol52 originalColumn = new ActionWorkItemInsertFactCol52();
    originalColumn.setParameterClassName("ParamClass1");
    originalColumn.setWorkItemName("WI1");
    originalColumn.setWorkItemResultParameterName("param1");
    originalColumn.setBoundName("b1");
    originalColumn.setFactField("field1");
    originalColumn.setInsertLogical(false);
    originalColumn.setHeader("action1");
    originalColumn.setHideColumn(false);
    ActionWorkItemInsertFactCol52 newColumn = new ActionWorkItemInsertFactCol52();
    newColumn.setParameterClassName("ParamClass2");
    newColumn.setWorkItemName("WI2");
    newColumn.setWorkItemResultParameterName("param2");
    newColumn.setBoundName("b2");
    newColumn.setFactField("field2");
    newColumn.setInsertLogical(true);
    newColumn.setHeader("action2");
    newColumn.setHideColumn(true);
    List<BaseColumnFieldDiff> diffs = originalColumn.diff(newColumn);
    SafeHtml result = helper.getSafeHtml(new UpdateColumnAuditLogEntry("mock user", originalColumn, newColumn, diffs));
    assertEquals(getActionHeaderRepre(newColumn.getHeader()) + getDiffRepre(diffs), result.asString());
}
Also used : ActionWorkItemInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemInsertFactCol52) UpdateColumnAuditLogEntry(org.drools.workbench.models.guided.dtable.shared.auditlog.UpdateColumnAuditLogEntry) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) BaseColumnFieldDiff(org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff) Test(org.junit.Test)

Example 2 with UpdateColumnAuditLogEntry

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

the class AuditLogEntryCellHelperTest method getSafeHtml_Metadata.

@Test
public void getSafeHtml_Metadata() {
    MetadataCol52 originalColumn = new MetadataCol52();
    originalColumn.setHideColumn(true);
    originalColumn.setDefaultValue(new DTCellValue52("def1"));
    // header & metadata of a metadata column cannot be updated in the ui
    originalColumn.setMetadata("meta");
    originalColumn.setHeader("meta");
    MetadataCol52 newColumn = new MetadataCol52();
    newColumn.setHideColumn(false);
    newColumn.setDefaultValue(new DTCellValue52("def2"));
    // header & metadata of a metadata column cannot be updated in the ui
    newColumn.setMetadata("meta");
    newColumn.setHeader("meta");
    List<BaseColumnFieldDiff> diffs = originalColumn.diff(newColumn);
    SafeHtml result = helper.getSafeHtml(new UpdateColumnAuditLogEntry("mock user", originalColumn, newColumn, diffs));
    assertEquals(getHeaderRepre(newColumn.getHeader()) + getDiffRepre(diffs), result.asString());
}
Also used : MetadataCol52(org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52) UpdateColumnAuditLogEntry(org.drools.workbench.models.guided.dtable.shared.auditlog.UpdateColumnAuditLogEntry) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) BaseColumnFieldDiff(org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52) Test(org.junit.Test)

Example 3 with UpdateColumnAuditLogEntry

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

the class AuditLogEntryCellHelperTest method getSafeHtml_ActionRetract.

@Test
public void getSafeHtml_ActionRetract() {
    ActionRetractFactCol52 originalColumn = new ActionRetractFactCol52();
    originalColumn.setHeader("action1");
    originalColumn.setHideColumn(false);
    originalColumn.setDefaultValue(new DTCellValue52("def1"));
    ActionRetractFactCol52 newColumn = new ActionRetractFactCol52();
    newColumn.setHeader("action2");
    newColumn.setHideColumn(true);
    newColumn.setDefaultValue(new DTCellValue52("def2"));
    List<BaseColumnFieldDiff> diffs = originalColumn.diff(newColumn);
    SafeHtml result = helper.getSafeHtml(new UpdateColumnAuditLogEntry("mock user", originalColumn, newColumn, diffs));
    assertEquals(getHeaderRepre(newColumn.getHeader()) + getDiffRepre(diffs), result.asString());
}
Also used : ActionRetractFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionRetractFactCol52) UpdateColumnAuditLogEntry(org.drools.workbench.models.guided.dtable.shared.auditlog.UpdateColumnAuditLogEntry) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) BaseColumnFieldDiff(org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52) Test(org.junit.Test)

Example 4 with UpdateColumnAuditLogEntry

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

the class AuditLogEntryCellHelperTest method getSafeHtml_ActionInsert.

@Test
public void getSafeHtml_ActionInsert() {
    // hide, insert, value list, default value, field, header
    ActionInsertFactCol52 originalColumn = new ActionInsertFactCol52();
    originalColumn.setFactField("field1");
    originalColumn.setInsertLogical(false);
    originalColumn.setValueList("q,w,e");
    originalColumn.setHeader("action1");
    originalColumn.setHideColumn(false);
    originalColumn.setDefaultValue(new DTCellValue52("def1"));
    ActionInsertFactCol52 newColumn = new ActionInsertFactCol52();
    newColumn.setFactField("field2");
    newColumn.setInsertLogical(true);
    newColumn.setValueList("a,s,d");
    newColumn.setHeader("action2");
    newColumn.setHideColumn(true);
    newColumn.setDefaultValue(new DTCellValue52("def2"));
    List<BaseColumnFieldDiff> diffs = originalColumn.diff(newColumn);
    SafeHtml result = helper.getSafeHtml(new UpdateColumnAuditLogEntry("mock user", originalColumn, newColumn, diffs));
    assertEquals(getActionHeaderRepre(newColumn.getHeader()) + getDiffRepre(diffs), result.asString());
}
Also used : ActionInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52) LimitedEntryActionInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryActionInsertFactCol52) UpdateColumnAuditLogEntry(org.drools.workbench.models.guided.dtable.shared.auditlog.UpdateColumnAuditLogEntry) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) BaseColumnFieldDiff(org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52) Test(org.junit.Test)

Example 5 with UpdateColumnAuditLogEntry

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

the class AuditLogEntryCellHelperTest method getSafeHtml_ActionWorkItemExecute_Complex.

@Test
public void getSafeHtml_ActionWorkItemExecute_Complex() {
    ActionWorkItemCol52 originalColumn = new ActionWorkItemCol52();
    originalColumn.setHeader("action1");
    originalColumn.setHideColumn(false);
    ActionWorkItemCol52 newColumn = new ActionWorkItemCol52();
    newColumn.setHeader("action2");
    newColumn.setHideColumn(true);
    PortableStringParameterDefinition param1 = new PortableStringParameterDefinition();
    param1.setName("param1");
    param1.setValue("value1");
    PortableStringParameterDefinition param2 = new PortableStringParameterDefinition();
    param2.setName("param2");
    param2.setValue("value2");
    PortableWorkDefinition def1 = new PortableWorkDefinition();
    def1.setName("def1name");
    def1.addParameter(param1);
    def1.addParameter(param2);
    PortableStringParameterDefinition param3 = new PortableStringParameterDefinition();
    param3.setName("param3");
    param3.setValue("value3");
    PortableStringParameterDefinition param4 = new PortableStringParameterDefinition();
    param4.setName("param1");
    param4.setValue("value1");
    PortableStringParameterDefinition param5 = new PortableStringParameterDefinition();
    param5.setName("param5");
    param5.setBinding("binding5");
    PortableStringParameterDefinition param6 = new PortableStringParameterDefinition();
    param6.setName("param2");
    param6.setValue("value6");
    PortableWorkDefinition def2 = new PortableWorkDefinition();
    def2.setName("def2name");
    def2.addParameter(param3);
    def2.addParameter(param4);
    def2.addParameter(param5);
    def2.addParameter(param6);
    originalColumn.setWorkItemDefinition(def1);
    newColumn.setWorkItemDefinition(def2);
    List<BaseColumnFieldDiff> diffs = originalColumn.diff(newColumn);
    SafeHtml result = helper.getSafeHtml(new UpdateColumnAuditLogEntry("mock user", originalColumn, newColumn, diffs));
    assertEquals(getActionHeaderRepre(newColumn.getHeader()) + getDiffRepre(diffs), result.asString());
}
Also used : PortableStringParameterDefinition(org.drools.workbench.models.datamodel.workitems.PortableStringParameterDefinition) ActionWorkItemCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52) UpdateColumnAuditLogEntry(org.drools.workbench.models.guided.dtable.shared.auditlog.UpdateColumnAuditLogEntry) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) PortableWorkDefinition(org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition) BaseColumnFieldDiff(org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff) Test(org.junit.Test)

Aggregations

UpdateColumnAuditLogEntry (org.drools.workbench.models.guided.dtable.shared.auditlog.UpdateColumnAuditLogEntry)16 BaseColumnFieldDiff (org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff)15 Test (org.junit.Test)15 SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)14 DTCellValue52 (org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)6 PortableStringParameterDefinition (org.drools.workbench.models.datamodel.workitems.PortableStringParameterDefinition)2 PortableWorkDefinition (org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition)2 ActionWorkItemCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52)2 AttributeCol52 (org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52)2 BRLActionColumn (org.drools.workbench.models.guided.dtable.shared.model.BRLActionColumn)2 BRLConditionColumn (org.drools.workbench.models.guided.dtable.shared.model.BRLConditionColumn)2 ConditionCol52 (org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52)2 MetadataCol52 (org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52)2 Pattern52 (org.drools.workbench.models.guided.dtable.shared.model.Pattern52)2 ActionRetractFact (org.drools.workbench.models.datamodel.rule.ActionRetractFact)1 FactPattern (org.drools.workbench.models.datamodel.rule.FactPattern)1 ActionCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionCol52)1 ActionInsertFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52)1 ActionRetractFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionRetractFactCol52)1 ActionSetFieldCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52)1