Search in sources :

Example 1 with BuiltinAggregator

use of org.kie.workbench.common.dmn.api.definition.v1_1.BuiltinAggregator in project kie-wb-common by kiegroup.

the class HitPolicyEditorViewImpl method setupBuiltinAggregatorEventHandler.

private void setupBuiltinAggregatorEventHandler() {
    setupChangeEventHandler(lstBuiltinAggregator, () -> {
        final BuiltinAggregator aggregator = builtinAggregatorUtils.toEnum(lstBuiltinAggregator.getValue());
        presenter.setBuiltinAggregator(aggregator);
    });
}
Also used : BuiltinAggregator(org.kie.workbench.common.dmn.api.definition.v1_1.BuiltinAggregator)

Example 2 with BuiltinAggregator

use of org.kie.workbench.common.dmn.api.definition.v1_1.BuiltinAggregator in project kie-wb-common by kiegroup.

the class RowNumberColumnHeaderMetaData method getTitle.

@Override
public String getTitle() {
    final HitPolicy hitPolicy = hitPolicySupplier.get();
    final BuiltinAggregator builtinAggregator = builtinAggregatorSupplier.get();
    final StringBuilder sb = new StringBuilder(hitPolicy.value().substring(0, 1).toUpperCase());
    if (HitPolicy.COLLECT == hitPolicy) {
        if (builtinAggregator != null) {
            sb.append(builtinAggregator.getCode());
        }
    }
    return sb.toString();
}
Also used : HitPolicy(org.kie.workbench.common.dmn.api.definition.v1_1.HitPolicy) BuiltinAggregator(org.kie.workbench.common.dmn.api.definition.v1_1.BuiltinAggregator)

Example 3 with BuiltinAggregator

use of org.kie.workbench.common.dmn.api.definition.v1_1.BuiltinAggregator in project kie-wb-common by kiegroup.

the class DecisionTableGridTest method testSetBuiltInAggregator.

@Test
public void testSetBuiltInAggregator() {
    final BuiltinAggregator aggregator = BuiltinAggregator.SUM;
    setupGrid(makeHasNameForDecision(), 0);
    grid.setBuiltinAggregator(aggregator);
    verify(sessionCommandManager).execute(eq(canvasHandler), setBuiltInAggregatorCommandCaptor.capture());
    final SetBuiltinAggregatorCommand setBuiltinAggregatorCommand = setBuiltInAggregatorCommandCaptor.getValue();
    setBuiltinAggregatorCommand.execute(canvasHandler);
    verify(gridLayer).batch();
}
Also used : BuiltinAggregator(org.kie.workbench.common.dmn.api.definition.v1_1.BuiltinAggregator) SetBuiltinAggregatorCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.SetBuiltinAggregatorCommand) Test(org.junit.Test)

Example 4 with BuiltinAggregator

use of org.kie.workbench.common.dmn.api.definition.v1_1.BuiltinAggregator in project kie-wb-common by kiegroup.

the class HitPolicyEditorImplTest method testSetBuiltInAggregatorNonNullControl.

@Test
public void testSetBuiltInAggregatorNonNullControl() {
    final BuiltinAggregator aggregator = BuiltinAggregator.COUNT;
    when(control.getBuiltinAggregator()).thenReturn(aggregator);
    editor.bind(control, UI_ROW_INDEX, UI_COLUMN_INDEX);
    reset(view);
    editor.setBuiltinAggregator(aggregator);
    verify(control).setBuiltinAggregator(eq(aggregator));
}
Also used : BuiltinAggregator(org.kie.workbench.common.dmn.api.definition.v1_1.BuiltinAggregator) Test(org.junit.Test)

Example 5 with BuiltinAggregator

use of org.kie.workbench.common.dmn.api.definition.v1_1.BuiltinAggregator in project kie-wb-common by kiegroup.

the class SetBuiltinAggregatorCommandTest method makeCommand.

private void makeCommand(final BuiltinAggregator aggregator) {
    this.dtable = new DecisionTable();
    this.dtable.setAggregation(aggregator);
    this.command = new SetBuiltinAggregatorCommand(dtable, NEW_AGGREGATOR, canvasOperation);
}
Also used : DecisionTable(org.kie.workbench.common.dmn.api.definition.v1_1.DecisionTable)

Aggregations

BuiltinAggregator (org.kie.workbench.common.dmn.api.definition.v1_1.BuiltinAggregator)4 Test (org.junit.Test)2 DecisionTable (org.kie.workbench.common.dmn.api.definition.v1_1.DecisionTable)1 HitPolicy (org.kie.workbench.common.dmn.api.definition.v1_1.HitPolicy)1 SetBuiltinAggregatorCommand (org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.SetBuiltinAggregatorCommand)1