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);
});
}
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();
}
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();
}
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));
}
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);
}
Aggregations