Search in sources :

Example 36 with ActionInsertFactCol52

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

the class GuidedDecisionTablePresenterTest method addActionInsertFactToModel.

private void addActionInsertFactToModel(final GuidedDecisionTable52 model, final String factType, final String fieldName) {
    final ActionInsertFactCol52 aif = new ActionInsertFactCol52();
    aif.setFactType(factType);
    aif.setFactField(fieldName);
    model.getActionCols().add(aif);
}
Also used : ActionInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52)

Example 37 with ActionInsertFactCol52

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

the class GuidedDecisionTablePresenterTest method hasColumnDefinitionsWithActionColumn.

@Test
public void hasColumnDefinitionsWithActionColumn() {
    final ActionInsertFactCol52 action = new ActionInsertFactCol52();
    action.setFactType("FactType");
    action.setFactField("field");
    dtPresenter.getModel().getActionCols().add(action);
    assertTrue(dtPresenter.hasColumnDefinitions());
}
Also used : ActionInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52) Test(org.junit.Test)

Example 38 with ActionInsertFactCol52

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

the class GuidedDecisionTablePresenterTest method appendActionColumn.

@Test
public void appendActionColumn() throws VetoException {
    reset(modellerPresenter);
    final ActionInsertFactCol52 action = new ActionInsertFactCol52();
    action.setFactType("FactType");
    action.setFactField("field");
    action.setHeader("header");
    when(oracle.getFieldType(eq("FactType"), eq("field"))).thenReturn(DataType.TYPE_STRING);
    dtPresenter.appendColumn(action);
    verify(synchronizer, times(1)).appendColumn(eq(action));
    verify(refreshActionsPanelEvent, times(1)).fire(any(RefreshActionsPanelEvent.class));
    verify(modellerPresenter, times(1)).updateLinks();
}
Also used : ActionInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52) RefreshActionsPanelEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.RefreshActionsPanelEvent) Test(org.junit.Test)

Example 39 with ActionInsertFactCol52

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

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

the class GuidedDecisionTablePresenterTest method deleteActionColumn.

@Test
public void deleteActionColumn() throws VetoException {
    final ActionInsertFactCol52 column = new ActionInsertFactCol52();
    column.setFactType("FactType");
    column.setFactField("field");
    column.setHeader("header");
    when(oracle.getFieldType(eq("FactType"), eq("field"))).thenReturn(DataType.TYPE_STRING);
    dtPresenter.appendColumn(column);
    reset(modellerPresenter);
    dtPresenter.deleteColumn(column);
    verify(synchronizer, times(1)).deleteColumn(eq(column));
    verify(modellerPresenter, times(1)).updateLinks();
    checkDTSelectionsChangedEventFired(1);
}
Also used : ActionInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52) Test(org.junit.Test)

Aggregations

ActionInsertFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52)105 Test (org.junit.Test)74 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)43 Pattern52 (org.drools.workbench.models.guided.dtable.shared.model.Pattern52)40 ConditionCol52 (org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52)39 ActionSetFieldCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52)38 LimitedEntryActionInsertFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryActionInsertFactCol52)32 DTCellValue52 (org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)24 LimitedEntryActionSetFieldCol52 (org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryActionSetFieldCol52)20 LimitedEntryConditionCol52 (org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryConditionCol52)20 RawMVELEvaluator (org.kie.soup.project.datamodel.commons.util.RawMVELEvaluator)20 PackageDataModelOracleBaselinePayload (org.kie.workbench.common.services.datamodel.model.PackageDataModelOracleBaselinePayload)20 AsyncPackageDataModelOracle (org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle)20 Path (org.uberfire.backend.vfs.Path)20 ModelField (org.kie.soup.project.datamodel.oracle.ModelField)19 ModuleDataModelOracle (org.kie.soup.project.datamodel.oracle.ModuleDataModelOracle)19 BRLActionColumn (org.drools.workbench.models.guided.dtable.shared.model.BRLActionColumn)15 BaseColumn (org.drools.workbench.models.guided.dtable.shared.model.BaseColumn)14 ActionCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionCol52)13 PackageDataModelOracle (org.kie.soup.project.datamodel.oracle.PackageDataModelOracle)13