Search in sources :

Example 1 with GuidedDecisionTableDescriptionBuilder

use of org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableDescriptionBuilder 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;
    }
}
Also used : GuidedDecisionTableAgendaGroupBuilder(org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableAgendaGroupBuilder) ActionType(org.drools.decisiontable.parser.ActionType) GuidedDecisionTableCalendarsBuilder(org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableCalendarsBuilder) GuidedDecisionTableActivationGroupBuilder(org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableActivationGroupBuilder) GuidedDecisionTableDateEffectiveBuilder(org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableDateEffectiveBuilder) GuidedDecisionTableTimerBuilder(org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableTimerBuilder) GuidedDecisionTableAutoFocusBuilder(org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableAutoFocusBuilder) GuidedDecisionTableNameBuilder(org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableNameBuilder) GuidedDecisionTableMetadataBuilder(org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableMetadataBuilder) GuidedDecisionTableSourceBuilder(org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableSourceBuilder) GuidedDecisionTableRuleflowGroupBuilder(org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableRuleflowGroupBuilder) GuidedDecisionTableDateExpiresBuilder(org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableDateExpiresBuilder) GuidedDecisionTableSalienceBuilder(org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableSalienceBuilder) GuidedDecisionTableDescriptionBuilder(org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableDescriptionBuilder) GuidedDecisionTableNoLoopBuilder(org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableNoLoopBuilder) GuidedDecisionTableDurationBuilder(org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableDurationBuilder) GuidedDecisionTableLockonActiveBuilder(org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableLockonActiveBuilder)

Aggregations

ActionType (org.drools.decisiontable.parser.ActionType)1 GuidedDecisionTableActivationGroupBuilder (org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableActivationGroupBuilder)1 GuidedDecisionTableAgendaGroupBuilder (org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableAgendaGroupBuilder)1 GuidedDecisionTableAutoFocusBuilder (org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableAutoFocusBuilder)1 GuidedDecisionTableCalendarsBuilder (org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableCalendarsBuilder)1 GuidedDecisionTableDateEffectiveBuilder (org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableDateEffectiveBuilder)1 GuidedDecisionTableDateExpiresBuilder (org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableDateExpiresBuilder)1 GuidedDecisionTableDescriptionBuilder (org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableDescriptionBuilder)1 GuidedDecisionTableDurationBuilder (org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableDurationBuilder)1 GuidedDecisionTableLockonActiveBuilder (org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableLockonActiveBuilder)1 GuidedDecisionTableMetadataBuilder (org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableMetadataBuilder)1 GuidedDecisionTableNameBuilder (org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableNameBuilder)1 GuidedDecisionTableNoLoopBuilder (org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableNoLoopBuilder)1 GuidedDecisionTableRuleflowGroupBuilder (org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableRuleflowGroupBuilder)1 GuidedDecisionTableSalienceBuilder (org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableSalienceBuilder)1 GuidedDecisionTableSourceBuilder (org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableSourceBuilder)1 GuidedDecisionTableTimerBuilder (org.drools.workbench.screens.dtablexls.backend.server.conversion.builders.GuidedDecisionTableTimerBuilder)1