Search in sources :

Example 1 with AddInputClauseCommand

use of org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.AddInputClauseCommand in project kie-wb-common by kiegroup.

the class DecisionTableGrid method addInputClause.

void addInputClause(final int index) {
    expression.ifPresent(dtable -> {
        final InputClause clause = new InputClause();
        final LiteralExpression le = new LiteralExpression();
        le.setText("input");
        clause.setInputExpression(le);
        sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new AddInputClauseCommand(dtable, clause, model, makeInputClauseColumn(clause), index, uiModelMapper, () -> synchroniseViewWhenExpressionEditorChanged(this)));
    });
}
Also used : AddInputClauseCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.AddInputClauseCommand) LiteralExpression(org.kie.workbench.common.dmn.api.definition.v1_1.LiteralExpression) InputClause(org.kie.workbench.common.dmn.api.definition.v1_1.InputClause)

Example 2 with AddInputClauseCommand

use of org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.AddInputClauseCommand in project kie-wb-common by kiegroup.

the class DecisionTableGridTest method testAddInputClause.

@Test
public void testAddInputClause() {
    setupGrid(makeHasNameForDecision(), 0);
    grid.addInputClause(1);
    verify(sessionCommandManager).execute(eq(canvasHandler), addInputClauseCommandCaptor.capture());
    final AddInputClauseCommand addInputClauseCommand = addInputClauseCommandCaptor.getValue();
    addInputClauseCommand.execute(canvasHandler);
    verify(parent).proposeContainingColumnWidth(eq(grid.getWidth() + grid.getPadding() * 2));
    verifyGridPanelRefresh();
}
Also used : AddInputClauseCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.AddInputClauseCommand) Test(org.junit.Test)

Aggregations

AddInputClauseCommand (org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.AddInputClauseCommand)2 Test (org.junit.Test)1 InputClause (org.kie.workbench.common.dmn.api.definition.v1_1.InputClause)1 LiteralExpression (org.kie.workbench.common.dmn.api.definition.v1_1.LiteralExpression)1