Search in sources :

Example 1 with AddParameterBindingCommand

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

the class InvocationGridTest method testAddParameterBinding.

@Test
public void testAddParameterBinding() {
    setupGrid(0);
    grid.addParameterBinding(0);
    verify(sessionCommandManager).execute(eq(canvasHandler), addParameterBindingCommandCaptor.capture());
    final AddParameterBindingCommand addParameterBindingCommand = addParameterBindingCommandCaptor.getValue();
    addParameterBindingCommand.execute(canvasHandler);
    verify(parent).onResize();
    verify(gridPanel).refreshScrollPosition();
    verify(gridPanel).updatePanelSize();
    verify(gridLayer).batch(redrawCommandCaptor.capture());
    final GridLayerRedrawManager.PrioritizedCommand redrawCommand = redrawCommandCaptor.getValue();
    redrawCommand.execute();
    verify(gridLayer).draw();
}
Also used : GridLayerRedrawManager(org.uberfire.ext.wires.core.grids.client.widget.layer.impl.GridLayerRedrawManager) AddParameterBindingCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.invocation.AddParameterBindingCommand) Test(org.junit.Test)

Example 2 with AddParameterBindingCommand

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

the class InvocationGrid method addParameterBinding.

void addParameterBinding(final int index) {
    expression.ifPresent(invocation -> {
        final Binding binding = new Binding();
        final InformationItem parameter = new InformationItem();
        parameter.setName(new Name("p" + invocation.getBinding().size()));
        binding.setParameter(parameter);
        sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new AddParameterBindingCommand(invocation, binding, model, new DMNGridRow(), index, uiModelMapper, this::synchroniseView));
    });
}
Also used : Binding(org.kie.workbench.common.dmn.api.definition.v1_1.Binding) AddParameterBindingCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.invocation.AddParameterBindingCommand) DMNGridRow(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridRow) InformationItem(org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem) Name(org.kie.workbench.common.dmn.api.property.dmn.Name) HasName(org.kie.workbench.common.dmn.api.definition.HasName)

Aggregations

AddParameterBindingCommand (org.kie.workbench.common.dmn.client.commands.expressions.types.invocation.AddParameterBindingCommand)2 Test (org.junit.Test)1 HasName (org.kie.workbench.common.dmn.api.definition.HasName)1 Binding (org.kie.workbench.common.dmn.api.definition.v1_1.Binding)1 InformationItem (org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem)1 Name (org.kie.workbench.common.dmn.api.property.dmn.Name)1 DMNGridRow (org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridRow)1 GridLayerRedrawManager (org.uberfire.ext.wires.core.grids.client.widget.layer.impl.GridLayerRedrawManager)1