use of org.drools.decisiontable.parser.ActionType in project drools-wb by kiegroup.
the class GuidedDecisionTableGeneratorListener method doDataCell.
private void doDataCell(final int row, final int column, final String value) {
final ActionType actionType = getActionForColumn(row, column);
if (row - this._ruleRow > 1) {
// Encountered a row gap from the last rule. This is not part of the ruleset.
finishRuleTable();
processNonRuleCell(row, column, value);
return;
}
if (row > this._ruleRow) {
// In a new row/rule
this._ruleRow++;
}
// Add data to column definition
actionType.addCellValue(row, column, value, _currentEscapeQuotesFlag);
}
use of org.drools.decisiontable.parser.ActionType in project drools-wb by kiegroup.
the class GuidedDecisionTableGeneratorListener method doActionTypeCell.
private void doActionTypeCell(final int row, final int column, final String trimVal) {
_ruleEndColumn = column;
ActionType.addNewActionType(this._actions, trimVal, column, row);
final ActionType actionType = getActionForColumn(row, column);
GuidedDecisionTableSourceBuilder sb = null;
switch(actionType.getCode()) {
case CONDITION:
case ACTION:
// SourceBuilders for ACTIONs are set when processing the Object row
break;
case NAME:
sb = new GuidedDecisionTableNameBuilder(row - 1, column, this._conversionResult);
actionType.setSourceBuilder(sb);
this._sourceBuilders.add(sb);
break;
case DESCRIPTION:
// Remove default Description Column builder and add that provided
this._sourceBuilders.remove(DEFAULT_DESCRIPTION_BUILDER);
sb = new GuidedDecisionTableDescriptionBuilder(row - 1, column, this._conversionResult);
// Description column must always be at position 1
this._sourceBuilders.add(DESCRIPTION_COLUMN_INDEX, sb);
actionType.setSourceBuilder(sb);
break;
case SALIENCE:
sb = new GuidedDecisionTableSalienceBuilder(row - 1, column, this._currentSequentialFlag, this._conversionResult);
actionType.setSourceBuilder(sb);
this._sourceBuilders.add(sb);
break;
case DURATION:
sb = new GuidedDecisionTableDurationBuilder(row - 1, column, this._conversionResult);
actionType.setSourceBuilder(sb);
this._sourceBuilders.add(sb);
break;
case TIMER:
sb = new GuidedDecisionTableTimerBuilder(row - 1, column, this._conversionResult);
actionType.setSourceBuilder(sb);
this._sourceBuilders.add(sb);
break;
case CALENDARS:
sb = new GuidedDecisionTableCalendarsBuilder(row - 1, column, this._conversionResult);
actionType.setSourceBuilder(sb);
this._sourceBuilders.add(sb);
break;
case NOLOOP:
sb = new GuidedDecisionTableNoLoopBuilder(row - 1, column, this._conversionResult);
actionType.setSourceBuilder(sb);
this._sourceBuilders.add(sb);
break;
case LOCKONACTIVE:
sb = new GuidedDecisionTableLockonActiveBuilder(row - 1, column, this._conversionResult);
actionType.setSourceBuilder(sb);
this._sourceBuilders.add(sb);
break;
case AUTOFOCUS:
sb = new GuidedDecisionTableAutoFocusBuilder(row - 1, column, this._conversionResult);
actionType.setSourceBuilder(sb);
this._sourceBuilders.add(sb);
break;
case ACTIVATIONGROUP:
sb = new GuidedDecisionTableActivationGroupBuilder(row - 1, column, this._conversionResult);
actionType.setSourceBuilder(sb);
this._sourceBuilders.add(sb);
break;
case AGENDAGROUP:
sb = new GuidedDecisionTableAgendaGroupBuilder(row - 1, column, this._conversionResult);
actionType.setSourceBuilder(sb);
this._sourceBuilders.add(sb);
break;
case RULEFLOWGROUP:
sb = new GuidedDecisionTableRuleflowGroupBuilder(row - 1, column, this._conversionResult);
actionType.setSourceBuilder(sb);
this._sourceBuilders.add(sb);
break;
case DATEEFFECTIVE:
sb = new GuidedDecisionTableDateEffectiveBuilder(row - 1, column, this._conversionResult);
actionType.setSourceBuilder(sb);
this._sourceBuilders.add(sb);
break;
case DATEEXPIRES:
sb = new GuidedDecisionTableDateExpiresBuilder(row - 1, column, this._conversionResult);
actionType.setSourceBuilder(sb);
this._sourceBuilders.add(sb);
break;
case METADATA:
sb = new GuidedDecisionTableMetadataBuilder(row - 1, column, this._conversionResult);
actionType.setSourceBuilder(sb);
this._sourceBuilders.add(sb);
break;
}
}
use of org.drools.decisiontable.parser.ActionType in project drools-wb by kiegroup.
the class GuidedDecisionTableGeneratorListener method doLabelCell.
private void doLabelCell(final int row, final int column, final String value) {
final ActionType actionType = getActionForColumn(row, column);
SourceBuilder sb = actionType.getSourceBuilder();
if (sb instanceof HasColumnHeadings) {
((HasColumnHeadings) sb).setColumnHeader(column, value);
}
}
Aggregations