@Test public void testFromDMNModelExpressionKindPMML() { setup(false); this.function.setExpression(context); this.function.setKind(FunctionDefinition.Kind.PMML); mapper.fromDMNModel(0, 0); assertFromDMNModelEditor(supplementaryEditor, supplementaryEditorDefinition, false); }
@Override public void fromDMNModel(final int rowIndex, final int columnIndex) { dmnModel.get().ifPresent(function -> { final FunctionDefinition.Kind kind = extractExpressionLanguage(function); final Optional<Expression> expression = Optional.ofNullable(function.getExpression()); if (kind == null) { return; } switch (kind) { case FEEL: final Optional<ExpressionEditorDefinition<Expression>> expressionEditorDefinition = expressionEditorDefinitionsSupplier.get().getExpressionEditorDefinition(expression); expressionEditorDefinition.ifPresent(ed -> { setUiModelEditor(rowIndex, columnIndex, function, ed); }); break; case JAVA: case PMML: final Optional<ExpressionEditorDefinition<Expression>> supplementaryEditorDefinition = supplementaryEditorDefinitionsSupplier.get().getExpressionEditorDefinition(expression); supplementaryEditorDefinition.ifPresent(ed -> { setUiModelEditor(rowIndex, columnIndex, function, ed); }); } }); }
FunctionUIModelMapper extends BaseUIModelMapper<FunctionDefinition> { @Override public void fromDMNModel(final int rowIndex, final int columnIndex) { dmnModel.get().ifPresent(function -> { final FunctionDefinition.Kind kind = extractExpressionLanguage(function); final Optional<Expression> expression = Optional.ofNullable(function.getExpression()); if (kind == null) { return; } switch (kind) { case FEEL: final Optional<ExpressionEditorDefinition<Expression>> expressionEditorDefinition = expressionEditorDefinitionsSupplier.get().getExpressionEditorDefinition(expression); expressionEditorDefinition.ifPresent(ed -> { setUiModelEditor(rowIndex, columnIndex, function, ed); }); break; case JAVA: case PMML: final Optional<ExpressionEditorDefinition<Expression>> supplementaryEditorDefinition = supplementaryEditorDefinitionsSupplier.get().getExpressionEditorDefinition(expression); supplementaryEditorDefinition.ifPresent(ed -> { setUiModelEditor(rowIndex, columnIndex, function, ed); }); } }); } }
FunctionUIModelMapper extends BaseUIModelMapper<FunctionDefinition> { @Override public void fromDMNModel(final int rowIndex, final int columnIndex) { dmnModel.get().ifPresent(function -> { final FunctionDefinition.Kind kind = extractExpressionLanguage(function); final Optional<Expression> expression = Optional.ofNullable(function.getExpression()); if (kind == null) { return; } switch (kind) { case FEEL: final Optional<ExpressionEditorDefinition<Expression>> expressionEditorDefinition = expressionEditorDefinitionsSupplier.get().getExpressionEditorDefinition(expression); expressionEditorDefinition.ifPresent(ed -> { setUiModelEditor(rowIndex, columnIndex, function, ed); }); break; case JAVA: case PMML: final Optional<ExpressionEditorDefinition<Expression>> supplementaryEditorDefinition = supplementaryEditorDefinitionsSupplier.get().getExpressionEditorDefinition(expression); supplementaryEditorDefinition.ifPresent(ed -> { setUiModelEditor(rowIndex, columnIndex, function, ed); }); } }); } FunctionUIModelMapper(final GridWidget gridWidget,
                                 final Supplier<GridData> uiModel,
                                 final Supplier<Optional<FunctionDefinition>> dmnModel,
                                 final Supplier<Boolean> isOnlyVisualChangeAllowedSupplier,
                                 final Supplier<ExpressionEditorDefinitions> expressionEditorDefinitionsSupplier,
                                 final Supplier<ExpressionEditorDefinitions> supplementaryEditorDefinitionsSupplier,
                                 final ListSelectorView.Presenter listSelector,
                                 final int nesting); }
FunctionUIModelMapper extends BaseUIModelMapper<FunctionDefinition> { @Override public void fromDMNModel(final int rowIndex, final int columnIndex) { dmnModel.get().ifPresent(function -> { final FunctionDefinition.Kind kind = extractExpressionLanguage(function); final Optional<Expression> expression = Optional.ofNullable(function.getExpression()); if (kind == null) { return; } switch (kind) { case FEEL: final Optional<ExpressionEditorDefinition<Expression>> expressionEditorDefinition = expressionEditorDefinitionsSupplier.get().getExpressionEditorDefinition(expression); expressionEditorDefinition.ifPresent(ed -> { setUiModelEditor(rowIndex, columnIndex, function, ed); }); break; case JAVA: case PMML: final Optional<ExpressionEditorDefinition<Expression>> supplementaryEditorDefinition = supplementaryEditorDefinitionsSupplier.get().getExpressionEditorDefinition(expression); supplementaryEditorDefinition.ifPresent(ed -> { setUiModelEditor(rowIndex, columnIndex, function, ed); }); } }); } FunctionUIModelMapper(final GridWidget gridWidget,
                                 final Supplier<GridData> uiModel,
                                 final Supplier<Optional<FunctionDefinition>> dmnModel,
                                 final Supplier<Boolean> isOnlyVisualChangeAllowedSupplier,
                                 final Supplier<ExpressionEditorDefinitions> expressionEditorDefinitionsSupplier,
                                 final Supplier<ExpressionEditorDefinitions> supplementaryEditorDefinitionsSupplier,
                                 final ListSelectorView.Presenter listSelector,
                                 final int nesting); @Override void fromDMNModel(final int rowIndex,
                             final int columnIndex); @Override @SuppressWarnings("unchecked") void toDMNModel(final int rowIndex,
                           final int columnIndex,
                           final Supplier<Optional<GridCellValue<?>>> cell); }
FunctionUIModelMapper extends BaseUIModelMapper<FunctionDefinition> { @Override public void fromDMNModel(final int rowIndex, final int columnIndex) { dmnModel.get().ifPresent(function -> { final FunctionDefinition.Kind kind = extractExpressionLanguage(function); final Optional<Expression> expression = Optional.ofNullable(function.getExpression()); if (kind == null) { return; } switch (kind) { case FEEL: final Optional<ExpressionEditorDefinition<Expression>> expressionEditorDefinition = expressionEditorDefinitionsSupplier.get().getExpressionEditorDefinition(expression); expressionEditorDefinition.ifPresent(ed -> { setUiModelEditor(rowIndex, columnIndex, function, ed); }); break; case JAVA: case PMML: final Optional<ExpressionEditorDefinition<Expression>> supplementaryEditorDefinition = supplementaryEditorDefinitionsSupplier.get().getExpressionEditorDefinition(expression); supplementaryEditorDefinition.ifPresent(ed -> { setUiModelEditor(rowIndex, columnIndex, function, ed); }); } }); } FunctionUIModelMapper(final GridWidget gridWidget,
                                 final Supplier<GridData> uiModel,
                                 final Supplier<Optional<FunctionDefinition>> dmnModel,
                                 final Supplier<Boolean> isOnlyVisualChangeAllowedSupplier,
                                 final Supplier<ExpressionEditorDefinitions> expressionEditorDefinitionsSupplier,
                                 final Supplier<ExpressionEditorDefinitions> supplementaryEditorDefinitionsSupplier,
                                 final ListSelectorView.Presenter listSelector,
                                 final int nesting); @Override void fromDMNModel(final int rowIndex,
                             final int columnIndex); @Override @SuppressWarnings("unchecked") void toDMNModel(final int rowIndex,
                           final int columnIndex,
                           final Supplier<Optional<GridCellValue<?>>> cell);  }