Search in sources :

Example 11 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_Simple.

@Test
public void getSafeHtml_ActionWorkItemExecute_Simple() {
    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");
    PortableWorkDefinition def1 = new PortableWorkDefinition();
    def1.setName("def1name");
    def1.addParameter(param1);
    PortableStringParameterDefinition param3 = new PortableStringParameterDefinition();
    param3.setName("param3");
    param3.setValue("value3");
    PortableWorkDefinition def2 = new PortableWorkDefinition();
    def2.setName("def2name");
    def2.addParameter(param3);
    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)

Example 12 with UpdateColumnAuditLogEntry

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

the class AuditLogEntryCellHelperTest method getSafeHtml_Attribute.

@Test
public void getSafeHtml_Attribute() {
    AttributeCol52 originalColumn = new AttributeCol52();
    originalColumn.setReverseOrder(false);
    originalColumn.setUseRowNumber(false);
    originalColumn.setHideColumn(false);
    originalColumn.setDefaultValue(new DTCellValue52("def1"));
    // header & attribute name of an attribute column cannot be updated in the ui
    originalColumn.setAttribute("attr");
    originalColumn.setHeader("attr");
    AttributeCol52 newColumn = new AttributeCol52();
    newColumn.setReverseOrder(true);
    newColumn.setUseRowNumber(true);
    newColumn.setHideColumn(true);
    newColumn.setDefaultValue(new DTCellValue52("def2"));
    // header & attribute name of an attribute column cannot be updated in the ui
    newColumn.setAttribute("attr");
    newColumn.setHeader("attr");
    List<BaseColumnFieldDiff> diffs = originalColumn.diff(newColumn);
    SafeHtml result = helper.getSafeHtml(new UpdateColumnAuditLogEntry("mock user", originalColumn, newColumn, diffs));
    assertEquals(getAttributeHeaderRepre(newColumn.getAttribute()) + getDiffRepre(diffs), result.asString());
}
Also used : AttributeCol52(org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52) 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 13 with UpdateColumnAuditLogEntry

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

the class AuditLogEntryCellHelperTest method getSafeHtml_BrlCondition.

@Test
public void getSafeHtml_BrlCondition() {
    // Definition diffs are currently not supported, maybe #soon?
    BRLConditionColumn originalColumn = new BRLConditionColumn();
    // originalColumn.setDefinition(Arrays.asList(new FactPattern("FactType1")));
    originalColumn.setHeader("condition1");
    originalColumn.setHideColumn(false);
    BRLConditionColumn newColumn = new BRLConditionColumn();
    // originalColumn.setDefinition(Arrays.asList(new FactPattern("FactType2"), new FactPattern("FactType3")));
    newColumn.setHeader("condition2");
    newColumn.setHideColumn(true);
    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 : BRLConditionColumn(org.drools.workbench.models.guided.dtable.shared.model.BRLConditionColumn) 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 14 with UpdateColumnAuditLogEntry

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

the class AuditLogEntryCellHelperTest method getSafeHtml_ActionWorkItemSetField.

@Test
public void getSafeHtml_ActionWorkItemSetField() {
    ActionWorkItemSetFieldCol52 originalColumn = new ActionWorkItemSetFieldCol52();
    originalColumn.setParameterClassName("ParamClass1");
    originalColumn.setWorkItemName("WI1");
    originalColumn.setWorkItemResultParameterName("param1");
    originalColumn.setBoundName("bind1");
    originalColumn.setFactField("field1");
    originalColumn.setUpdate(false);
    originalColumn.setHeader("action1");
    originalColumn.setHideColumn(false);
    ActionWorkItemSetFieldCol52 newColumn = new ActionWorkItemSetFieldCol52();
    newColumn.setParameterClassName("ParamClass2");
    newColumn.setWorkItemName("WI2");
    newColumn.setWorkItemResultParameterName("param2");
    newColumn.setBoundName("bind2");
    newColumn.setFactField("field2");
    newColumn.setUpdate(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 : 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) ActionWorkItemSetFieldCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemSetFieldCol52) Test(org.junit.Test)

Example 15 with UpdateColumnAuditLogEntry

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

the class AuditLogEntryCellHelperTest method getSafeHtml_ActionSetField.

@Test
public void getSafeHtml_ActionSetField() {
    ActionSetFieldCol52 originalColumn = new ActionSetFieldCol52();
    originalColumn.setBoundName("bind1");
    originalColumn.setFactField("field1");
    originalColumn.setUpdate(false);
    originalColumn.setValueList("q,w,e");
    originalColumn.setHeader("action1");
    originalColumn.setHideColumn(false);
    originalColumn.setDefaultValue(new DTCellValue52("def1"));
    ActionSetFieldCol52 newColumn = new ActionSetFieldCol52();
    newColumn.setBoundName("bind2");
    newColumn.setFactField("field2");
    newColumn.setUpdate(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 : 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) ActionSetFieldCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52) LimitedEntryActionSetFieldCol52(org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryActionSetFieldCol52) 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