Search in sources :

Example 66 with AsyncPackageDataModelOracle

use of org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle in project drools-wb by kiegroup.

the class ActionWorkItemSetFieldPlugin method acceptParameterType.

private boolean acceptParameterType(final PortableParameterDefinition ppd) {
    final AsyncPackageDataModelOracle oracle = presenter.getDataModelOracle();
    if (nil(editingWrapper().getFactField())) {
        return false;
    }
    if (nil(ppd.getClassName())) {
        return false;
    }
    final String fieldClassName = oracle.getFieldClassName(patternWrapper().getFactType(), editingWrapper().getFactField());
    return fieldClassName.equals(ppd.getClassName());
}
Also used : AsyncPackageDataModelOracle(org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle)

Example 67 with AsyncPackageDataModelOracle

use of org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle in project drools-wb by kiegroup.

the class ConditionColumnPlugin method assertDefaultValue.

void assertDefaultValue() {
    final CellUtilities cellUtilities = new CellUtilities();
    final AsyncPackageDataModelOracle oracle = presenter.getDataModelOracle();
    final ColumnUtilities columnUtilities = new ColumnUtilities(model(), oracle);
    final List<String> valueList = Arrays.asList(columnUtilities.getValueList(editingCol));
    if (valueList.size() > 0) {
        final String defaultValue = cellUtilities.asString(editingCol().getDefaultValue());
        if (!valueList.contains(defaultValue)) {
            editingCol.getDefaultValue().clearValues();
        }
    } else {
        // Ensure the Default Value has been updated to represent the column's data-type.
        final DTCellValue52 defaultValue = editingCol().getDefaultValue();
        final DataType.DataTypes dataType = columnUtilities.getDataType(editingPattern(), editingCol());
        cellUtilities.convertDTCellValueType(dataType, defaultValue);
    }
}
Also used : AsyncPackageDataModelOracle(org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle) ColumnUtilities(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities) CellUtilities(org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.CellUtilities) DataType(org.kie.soup.project.datamodel.oracle.DataType) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)

Example 68 with AsyncPackageDataModelOracle

use of org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle in project drools-wb by kiegroup.

the class OperatorPage method getOperatorCompletions.

void getOperatorCompletions(final Callback<String[]> callback) {
    final AsyncPackageDataModelOracle oracle = presenter.getDataModelOracle();
    oracle.getOperatorCompletions(plugin().getFactType(), plugin().getFactField(), callback);
}
Also used : AsyncPackageDataModelOracle(org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle)

Example 69 with AsyncPackageDataModelOracle

use of org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle in project drools-wb by kiegroup.

the class BaseWidgetFactory method factory.

protected DTCellValueWidgetFactory factory() {
    final GuidedDecisionTable52 model = getPlugin().getPresenter().getModel();
    final AsyncPackageDataModelOracle oracle = getPlugin().getPresenter().getDataModelOracle();
    final boolean allowEmptyValues = model.getTableFormat() == GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY;
    return DTCellValueWidgetFactory.getInstance(model, oracle, false, allowEmptyValues);
}
Also used : AsyncPackageDataModelOracle(org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle) GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)

Example 70 with AsyncPackageDataModelOracle

use of org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle in project drools-wb by kiegroup.

the class FieldPage method forEachFactField.

void forEachFactField(Consumer<String> loadedFieldConsumer) {
    if (hasEditingPattern()) {
        final AsyncPackageDataModelOracle oracle = presenter.getDataModelOracle();
        oracle.getFieldCompletions(factType(), getAccessor(), fieldsLoadedCallback(loadedFieldConsumer));
    }
}
Also used : AsyncPackageDataModelOracle(org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle)

Aggregations

AsyncPackageDataModelOracle (org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle)86 Test (org.junit.Test)59 ModelField (org.kie.soup.project.datamodel.oracle.ModelField)55 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)50 PackageDataModelOracleBaselinePayload (org.kie.workbench.common.services.datamodel.model.PackageDataModelOracleBaselinePayload)48 Path (org.uberfire.backend.vfs.Path)46 Pattern52 (org.drools.workbench.models.guided.dtable.shared.model.Pattern52)45 RawMVELEvaluator (org.kie.soup.project.datamodel.commons.util.RawMVELEvaluator)45 ConditionCol52 (org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52)43 ModuleDataModelOracle (org.kie.soup.project.datamodel.oracle.ModuleDataModelOracle)43 LimitedEntryConditionCol52 (org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryConditionCol52)38 DTCellValue52 (org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)29 List (java.util.List)21 ActionInsertFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52)20 ActionSetFieldCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52)20 PackageDataModelOracle (org.kie.soup.project.datamodel.oracle.PackageDataModelOracle)20 ArrayList (java.util.ArrayList)18 LimitedEntryActionInsertFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryActionInsertFactCol52)18 LimitedEntryActionSetFieldCol52 (org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryActionSetFieldCol52)18 FactPattern (org.drools.workbench.models.datamodel.rule.FactPattern)12