@Test public void testToDMNModelBindingParameter() { setup(false); cellValueSupplier = () -> Optional.of(new BaseGridCellValue<>("updated")); mapper.toDMNModel(0, 1, cellValueSupplier); assertEquals("updated", invocation.getBinding().get(0).getParameter().getName().getValue()); }
@Override @SuppressWarnings("unchecked") public void toDMNModel(final int rowIndex, final int columnIndex, final Supplier<Optional<GridCellValue<?>>> cell) { dmnModel.get().ifPresent(invocation -> { switch (columnIndex) { case ROW_NUMBER_COLUMN_INDEX: break; case BINDING_PARAMETER_COLUMN_INDEX: invocation.getBinding() .get(rowIndex) .getParameter() .getName() .setValue(cell.get().orElse(new BaseGridCellValue<>("")).getValue().toString()); break; case BINDING_EXPRESSION_COLUMN_INDEX: cell.get().ifPresent(v -> { final ExpressionCellValue ecv = (ExpressionCellValue) v; ecv.getValue().ifPresent(beg -> { beg.getExpression().get().ifPresent(e -> invocation.getBinding() .get(rowIndex) .setExpression((Expression) e)); }); }); } }); }
InvocationUIModelMapper extends BaseUIModelMapper<Invocation> { @Override @SuppressWarnings("unchecked") public void toDMNModel(final int rowIndex, final int columnIndex, final Supplier<Optional<GridCellValue<?>>> cell) { dmnModel.get().ifPresent(invocation -> { switch (columnIndex) { case ROW_NUMBER_COLUMN_INDEX: break; case BINDING_PARAMETER_COLUMN_INDEX: invocation.getBinding() .get(rowIndex) .getParameter() .getName() .setValue(cell.get().orElse(new BaseGridCellValue<>("")).getValue().toString()); break; case BINDING_EXPRESSION_COLUMN_INDEX: cell.get().ifPresent(v -> { final ExpressionCellValue ecv = (ExpressionCellValue) v; ecv.getValue().ifPresent(beg -> { beg.getExpression().get().ifPresent(e -> invocation.getBinding() .get(rowIndex) .setExpression((Expression) e)); }); }); } }); } }
InvocationUIModelMapper extends BaseUIModelMapper<Invocation> { @Override @SuppressWarnings("unchecked") public void toDMNModel(final int rowIndex, final int columnIndex, final Supplier<Optional<GridCellValue<?>>> cell) { dmnModel.get().ifPresent(invocation -> { switch (columnIndex) { case ROW_NUMBER_COLUMN_INDEX: break; case BINDING_PARAMETER_COLUMN_INDEX: invocation.getBinding() .get(rowIndex) .getParameter() .getName() .setValue(cell.get().orElse(new BaseGridCellValue<>("")).getValue().toString()); break; case BINDING_EXPRESSION_COLUMN_INDEX: cell.get().ifPresent(v -> { final ExpressionCellValue ecv = (ExpressionCellValue) v; ecv.getValue().ifPresent(beg -> { beg.getExpression().get().ifPresent(e -> invocation.getBinding() .get(rowIndex) .setExpression((Expression) e)); }); }); } }); } InvocationUIModelMapper(final GridWidget gridWidget,
                                   final Supplier<GridData> uiModel,
                                   final Supplier<Optional<Invocation>> dmnModel,
                                   final Supplier<Boolean> isOnlyVisualChangeAllowedSupplier,
                                   final Supplier<ExpressionEditorDefinitions> expressionEditorDefinitionsSupplier,
                                   final ListSelectorView.Presenter listSelector,
                                   final int nesting); }
InvocationUIModelMapper extends BaseUIModelMapper<Invocation> { @Override @SuppressWarnings("unchecked") public void toDMNModel(final int rowIndex, final int columnIndex, final Supplier<Optional<GridCellValue<?>>> cell) { dmnModel.get().ifPresent(invocation -> { switch (columnIndex) { case ROW_NUMBER_COLUMN_INDEX: break; case BINDING_PARAMETER_COLUMN_INDEX: invocation.getBinding() .get(rowIndex) .getParameter() .getName() .setValue(cell.get().orElse(new BaseGridCellValue<>("")).getValue().toString()); break; case BINDING_EXPRESSION_COLUMN_INDEX: cell.get().ifPresent(v -> { final ExpressionCellValue ecv = (ExpressionCellValue) v; ecv.getValue().ifPresent(beg -> { beg.getExpression().get().ifPresent(e -> invocation.getBinding() .get(rowIndex) .setExpression((Expression) e)); }); }); } }); } InvocationUIModelMapper(final GridWidget gridWidget,
                                   final Supplier<GridData> uiModel,
                                   final Supplier<Optional<Invocation>> dmnModel,
                                   final Supplier<Boolean> isOnlyVisualChangeAllowedSupplier,
                                   final Supplier<ExpressionEditorDefinitions> expressionEditorDefinitionsSupplier,
                                   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); }
InvocationUIModelMapper extends BaseUIModelMapper<Invocation> { @Override @SuppressWarnings("unchecked") public void toDMNModel(final int rowIndex, final int columnIndex, final Supplier<Optional<GridCellValue<?>>> cell) { dmnModel.get().ifPresent(invocation -> { switch (columnIndex) { case ROW_NUMBER_COLUMN_INDEX: break; case BINDING_PARAMETER_COLUMN_INDEX: invocation.getBinding() .get(rowIndex) .getParameter() .getName() .setValue(cell.get().orElse(new BaseGridCellValue<>("")).getValue().toString()); break; case BINDING_EXPRESSION_COLUMN_INDEX: cell.get().ifPresent(v -> { final ExpressionCellValue ecv = (ExpressionCellValue) v; ecv.getValue().ifPresent(beg -> { beg.getExpression().get().ifPresent(e -> invocation.getBinding() .get(rowIndex) .setExpression((Expression) e)); }); }); } }); } InvocationUIModelMapper(final GridWidget gridWidget,
                                   final Supplier<GridData> uiModel,
                                   final Supplier<Optional<Invocation>> dmnModel,
                                   final Supplier<Boolean> isOnlyVisualChangeAllowedSupplier,
                                   final Supplier<ExpressionEditorDefinitions> expressionEditorDefinitionsSupplier,
                                   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); static final int ROW_NUMBER_COLUMN_INDEX; static final int BINDING_PARAMETER_COLUMN_INDEX; static final int BINDING_EXPRESSION_COLUMN_INDEX; }