Search in sources :

Example 1 with AddParameterCommand

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

the class FunctionGrid method addParameter.

@Override
public void addParameter(final Command onSuccess) {
    expression.ifPresent(e -> {
        final InformationItem parameter = new InformationItem();
        parameter.setName(new Name("p" + e.getFormalParameter().size()));
        sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new AddParameterCommand(e, parameter, () -> {
            gridLayer.batch();
            onSuccess.execute();
        }));
    });
}
Also used : AddParameterCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.function.AddParameterCommand) 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

HasName (org.kie.workbench.common.dmn.api.definition.HasName)1 InformationItem (org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem)1 Name (org.kie.workbench.common.dmn.api.property.dmn.Name)1 AddParameterCommand (org.kie.workbench.common.dmn.client.commands.expressions.types.function.AddParameterCommand)1