Search in sources :

Example 1 with AddOutputClauseCommand

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

the class DecisionTableGrid method addOutputClause.

void addOutputClause(final int index) {
    expression.ifPresent(dtable -> {
        final OutputClause clause = new OutputClause();
        clause.setName("output");
        sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new AddOutputClauseCommand(dtable, clause, model, makeOutputClauseColumn(clause), index, uiModelMapper, () -> synchroniseViewWhenExpressionEditorChanged(this)));
    });
}
Also used : OutputClause(org.kie.workbench.common.dmn.api.definition.v1_1.OutputClause) AddOutputClauseCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.AddOutputClauseCommand)

Example 2 with AddOutputClauseCommand

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

the class DecisionTableGridTest method testAddOutputClause.

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

Aggregations

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