use of org.drools.scenariosimulation.api.model.AbstractScesimData in project drools-wb by kiegroup.
the class SetGridCellValueCommand method internalExecute.
@Override
protected void internalExecute(ScenarioSimulationContext context) {
final ScenarioSimulationContext.Status status = context.getStatus();
AbstractScesimModel<AbstractScesimData> abstractScesimModel = context.getAbstractScesimModelByGridWidget(gridWidget);
int columnIndex = status.getColumnIndex();
FactMapping factMapping = abstractScesimModel.getScesimModelDescriptor().getFactMappingByIndex(columnIndex);
ScenarioGridColumn selectedColumn = (ScenarioGridColumn) context.getAbstractScesimGridModelByGridWidget(gridWidget).getColumns().get(columnIndex);
String placeholder = ScenarioSimulationUtils.getPlaceHolder(selectedColumn.isInstanceAssigned(), selectedColumn.isPropertyAssigned(), factMapping.getFactMappingValueType(), factMapping.getClassName());
context.getAbstractScesimGridModelByGridWidget(gridWidget).setCellValue(status.getRowIndex(), columnIndex, new ScenarioGridCellValue(status.getGridCellValue(), placeholder));
context.getAbstractScesimGridModelByGridWidget(gridWidget).resetError(status.getRowIndex(), columnIndex);
}
Aggregations