Search in sources :

Example 6 with ActionWorkItemInsertFactCol52

use of org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemInsertFactCol52 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 7 with ActionWorkItemInsertFactCol52

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

the class PluginHandlerTest method testEditWhenColumnIsAnActionWorkItemInsertFactCol52.

@Test
public void testEditWhenColumnIsAnActionWorkItemInsertFactCol52() {
    final ActionWorkItemInsertFactCol52 originalColumn = mock(ActionWorkItemInsertFactCol52.class);
    final ActionWorkItemSetFieldPlugin plugin = spy(new ActionWorkItemSetFieldPlugin(patternPage, fieldPage, additionalInfoPage, workItemPage, event, translationService));
    doReturn(wizard).when(wizardManagedInstance).get();
    doReturn(plugin).when(actionWorkItemSetFieldPlugin).get();
    pluginHandler.edit(originalColumn);
    verify(plugin).setOriginalColumnConfig52(originalColumn);
    verify(pluginHandler).openWizard(plugin);
    verify(wizard).start(plugin);
}
Also used : ActionWorkItemSetFieldPlugin(org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.ActionWorkItemSetFieldPlugin) ActionWorkItemInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemInsertFactCol52) Test(org.junit.Test)

Example 8 with ActionWorkItemInsertFactCol52

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

the class ActionWorkItemInsertWrapperTest method testClone.

@Test
public void testClone() throws Exception {
    final ActionWorkItemInsertFactCol52 column = new ActionWorkItemInsertFactCol52();
    column.setFactField("factField");
    column.setBoundName("boundName");
    column.setValueList("valueList");
    column.setHeader("header");
    column.setInsertLogical(false);
    column.setDefaultValue(new DTCellValue52("defaultValue"));
    column.setFactType("factType");
    column.setHideColumn(false);
    column.setType("type");
    column.setParameterClassName("parameterClassName");
    column.setWorkItemName("workItemName");
    column.setWorkItemResultParameterName("workItemResultParameterName");
    final ActionWorkItemInsertWrapper wrapper = new ActionWorkItemInsertWrapper(plugin, column);
    final ActionWorkItemInsertFactCol52 clone = wrapper.getActionCol52();
    assertEquals("factField", column.getFactField());
    assertEquals("boundName", column.getBoundName());
    assertEquals("valueList", column.getValueList());
    assertEquals("header", column.getHeader());
    assertEquals(false, column.isInsertLogical());
    assertEquals(new DTCellValue52("defaultValue"), column.getDefaultValue());
    assertEquals("factType", column.getFactType());
    assertEquals(false, column.isHideColumn());
    assertEquals("type", column.getType());
    assertEquals("parameterClassName", column.getParameterClassName());
    assertEquals("workItemName", column.getWorkItemName());
    assertEquals("workItemResultParameterName", column.getWorkItemResultParameterName());
    assertNotSame(column, clone);
}
Also used : ActionWorkItemInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemInsertFactCol52) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52) Test(org.junit.Test)

Example 9 with ActionWorkItemInsertFactCol52

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

the class DecisionTableColumnViewUtilsTest method testColumnManagementGroupTitleWorkItemInsertFactEmpty.

@Test
public void testColumnManagementGroupTitleWorkItemInsertFactEmpty() throws Exception {
    final ActionWorkItemInsertFactCol52 column = mock(ActionWorkItemInsertFactCol52.class);
    doReturn(COLUMN_HEADER).when(column).getHeader();
    assertEquals(COLUMN_HEADER, DecisionTableColumnViewUtils.getColumnManagementGroupTitle(column));
}
Also used : ActionWorkItemInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemInsertFactCol52) Test(org.junit.Test)

Example 10 with ActionWorkItemInsertFactCol52

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

the class ActionWorkItemInsertFactColumnSynchronizerTest method testAppend.

@Test
public void testAppend() throws VetoException {
    final ActionWorkItemInsertFactCol52 column = new ActionWorkItemInsertFactCol52();
    column.setWorkItemName(WORK_ITEM_NAME);
    column.setHeader("col1");
    modelSynchronizer.appendColumn(column);
    assertEquals(2, model.getActionCols().size());
    assertEquals(4, uiModel.getColumns().size());
    assertTrue(uiModel.getColumns().get(3) instanceof BooleanUiColumn);
    assertEquals(true, ((BaseMultipleDOMElementUiColumn) uiModel.getColumns().get(3)).isEditable());
}
Also used : ActionWorkItemInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemInsertFactCol52) BooleanUiColumn(org.drools.workbench.screens.guided.dtable.client.widget.table.columns.BooleanUiColumn) Test(org.junit.Test)

Aggregations

ActionWorkItemInsertFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemInsertFactCol52)25 Test (org.junit.Test)17 ActionWorkItemCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52)6 BooleanUiColumn (org.drools.workbench.screens.guided.dtable.client.widget.table.columns.BooleanUiColumn)6 ArrayList (java.util.ArrayList)5 ActionInsertFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52)5 BaseColumnFieldDiff (org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff)5 ActionCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionCol52)4 BaseColumn (org.drools.workbench.models.guided.dtable.shared.model.BaseColumn)4 DTCellValue52 (org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)4 ActionSetFieldCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52)3 ActionWorkItemSetFieldCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemSetFieldCol52)3 Collections (java.util.Collections)2 List (java.util.List)2 Dependent (javax.enterprise.context.Dependent)2 ActionExecuteWorkItem (org.drools.workbench.models.datamodel.rule.ActionExecuteWorkItem)2 ActionFieldValue (org.drools.workbench.models.datamodel.rule.ActionFieldValue)2 ActionInsertFact (org.drools.workbench.models.datamodel.rule.ActionInsertFact)2 ActionWorkItemFieldValue (org.drools.workbench.models.datamodel.rule.ActionWorkItemFieldValue)2 RuleModel (org.drools.workbench.models.datamodel.rule.RuleModel)2