Search in sources :

Example 11 with ColumnUtilities

use of org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities in project drools-wb by kiegroup.

the class AbstractGuidedDecisionTableWizardPage method setContent.

public void setContent(final Path contextPath, final String baseFileName, final GuidedDecisionTable52.TableFormat tableFormat, final GuidedDecisionTable52.HitPolicy hitPolicy, final AsyncPackageDataModelOracle oracle, final GuidedDecisionTable52 model, final Validator validator) {
    this.contextPath = contextPath;
    this.baseFileName = baseFileName;
    this.tableFormat = tableFormat;
    this.hitPolicy = hitPolicy;
    this.oracle = oracle;
    this.model = model;
    this.validator = validator;
    this.cellUtilities = new CellUtilities();
    this.columnUtilities = new ColumnUtilities(model, oracle);
}
Also used : ColumnUtilities(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities) CellUtilities(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.CellUtilities)

Example 12 with ColumnUtilities

use of org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities in project drools-wb by kiegroup.

the class BRLConditionColumnDefinitionBuilder method generateDefinition.

@Override
public void generateDefinition(final GuidedDecisionTableView.Presenter dtPresenter, final BaseColumn column, final Callback<String> afterGenerationCallback) {
    if (!(column instanceof BRLConditionVariableColumn)) {
        return;
    }
    final GuidedDecisionTable52 existingModel = dtPresenter.getModel();
    final BRLConditionVariableColumn brlVariableColumn = (BRLConditionVariableColumn) column;
    final BRLConditionColumn brlColumn = existingModel.getBRLColumn(brlVariableColumn);
    final GuidedDecisionTable52 partialModel = new GuidedDecisionTable52();
    final ColumnUtilities columnUtilities = new ColumnUtilities(existingModel, dtPresenter.getDataModelOracle());
    partialModel.getConditions().add(brlColumn);
    partialModel.getData().add(makeRowData(columnUtilities, brlColumn));
    generateDefinitionOnServer(partialModel, dtPresenter.getCurrentPath(), (String drl) -> afterGenerationCallback.callback(getLHS(drl)));
}
Also used : BRLConditionColumn(org.drools.workbench.models.guided.dtable.shared.model.BRLConditionColumn) ColumnUtilities(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities) GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) BRLConditionVariableColumn(org.drools.workbench.models.guided.dtable.shared.model.BRLConditionVariableColumn)

Example 13 with ColumnUtilities

use of org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities in project drools-wb by kiegroup.

the class BaseConverterTest method setup.

@Before
public void setup() {
    this.model = getModel();
    this.oracle = getOracle();
    this.presenter = getPresenter();
    this.columnUtilities = new ColumnUtilities(model, oracle);
    for (BaseColumnConverter bcc : getConverters()) {
        bcc.initialise(model, oracle, columnUtilities, presenter);
    }
}
Also used : ColumnUtilities(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities) BaseColumnConverter(org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.BaseColumnConverter) Before(org.junit.Before)

Example 14 with ColumnUtilities

use of org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities in project drools-wb by kiegroup.

the class BaseActionColumnDefinitionBuilder method generateActionColumn.

protected void generateActionColumn(final GuidedDecisionTableView.Presenter dtPresenter, final BaseColumn column, final Callback<String> afterGenerationCallback) {
    final GuidedDecisionTable52 existingModel = dtPresenter.getModel();
    final GuidedDecisionTable52 partialModel = new GuidedDecisionTable52();
    final ColumnUtilities columnUtilities = new ColumnUtilities(existingModel, dtPresenter.getDataModelOracle());
    final ActionCol52 ac = (ActionCol52) column;
    partialModel.getActionCols().add(ac);
    partialModel.getData().add(makeRowData(columnUtilities, ac));
    generateDefinitionOnServer(partialModel, dtPresenter.getCurrentPath(), (String drl) -> afterGenerationCallback.callback(getRHS(drl)));
}
Also used : ColumnUtilities(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities) GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) ActionCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionCol52)

Example 15 with ColumnUtilities

use of org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities in project drools-wb by kiegroup.

the class BaseConditionColumnDefinitionBuilder method generateConditionColumn.

protected void generateConditionColumn(final GuidedDecisionTableView.Presenter dtPresenter, final BaseColumn column, final Callback<String> afterGenerationCallback) {
    final GuidedDecisionTable52 existingModel = dtPresenter.getModel();
    final ConditionCol52 cc = (ConditionCol52) column;
    if (!isConditionPartOfPattern(existingModel, cc)) {
        return;
    }
    final GuidedDecisionTable52 partialModel = new GuidedDecisionTable52();
    final ColumnUtilities columnUtilities = new ColumnUtilities(existingModel, dtPresenter.getDataModelOracle());
    final Pattern52 p = existingModel.getPattern(cc).clonePattern();
    p.getChildColumns().clear();
    p.getChildColumns().add(cc);
    partialModel.getConditions().add(p);
    partialModel.getData().add(makeRowData(columnUtilities, cc));
    generateDefinitionOnServer(partialModel, dtPresenter.getCurrentPath(), (String drl) -> afterGenerationCallback.callback(getLHS(drl)));
}
Also used : ConditionCol52(org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52) ColumnUtilities(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities) GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) Pattern52(org.drools.workbench.models.guided.dtable.shared.model.Pattern52)

Aggregations

ColumnUtilities (org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities)17 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)12 ConditionCol52 (org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52)9 Pattern52 (org.drools.workbench.models.guided.dtable.shared.model.Pattern52)8 AsyncPackageDataModelOracle (org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle)8 Test (org.junit.Test)7 RawMVELEvaluator (org.kie.soup.project.datamodel.commons.util.RawMVELEvaluator)7 PackageDataModelOracleBaselinePayload (org.kie.workbench.common.services.datamodel.model.PackageDataModelOracleBaselinePayload)7 Path (org.uberfire.backend.vfs.Path)7 ActionSetFieldCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52)5 ModelField (org.kie.soup.project.datamodel.oracle.ModelField)5 ModuleDataModelOracle (org.kie.soup.project.datamodel.oracle.ModuleDataModelOracle)5 ActionInsertFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52)4 AttributeCol52 (org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52)4 CellUtilities (org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.CellUtilities)4 DescriptionCol52 (org.drools.workbench.models.guided.dtable.shared.model.DescriptionCol52)2 RowNumberCol52 (org.drools.workbench.models.guided.dtable.shared.model.RowNumberCol52)2 BaseColumnConverter (org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.BaseColumnConverter)2 DependentEnumsUtilities (org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.DependentEnumsUtilities)2 Before (org.junit.Before)2