Package org.drools.template.parser

Examples of org.drools.template.parser.DecisionTableParseException


    /**
     * This is where a code snippet template is added.
     */
    public void addTemplate(int row, int column, String content) {
        if( this.sourceBuilder == null ){
            throw new DecisionTableParseException(
                    "Unexpected content \"" + content + "\" in cell " +
                    RuleSheetParserUtil.rc2name(row, column) + ", leave this cell blank" );
        }
        this.sourceBuilder.addTemplate( row, column, content );
    }
View Full Code Here


                                  _listeners.get( sheetName ) );

                }
            }
        } catch ( InvalidFormatException e ) {
            throw new DecisionTableParseException( "An error occurred opening the workbook. It is possible that the encoding of the document did not match the encoding of the reader.",
                                                   e );

        } catch ( IOException e ) {
            throw new DecisionTableParseException( "Failed to open Excel stream, " + "please check that the content is xls97 format.",
                                                   e );
        }

    }
View Full Code Here

            case Cell.CELL_TYPE_ERROR:
                cachedValue = String.valueOf(cell.getErrorCellValue());
                break;

            default:
                throw new DecisionTableParseException(format("Can't read cached value for cell[row=%d, col=%d, value=%s]!",
                        cell.getRowIndex(), cell.getColumnIndex(), cell));
        }
        return cachedValue;
    }
View Full Code Here

                final String token = tokens.nextToken();
                final Global vars = new Global();
                final StringTokenizer paramTokens = new StringTokenizer( token, " " );
                vars.setClassName( paramTokens.nextToken() );
                if ( !paramTokens.hasMoreTokens() ) {
                    throw new DecisionTableParseException( "The format for global variables is incorrect. " + "It should be: [Class name, Class otherName]. But it was: [" + variableCell + "]" );
                }
                vars.setIdentifier( paramTokens.nextToken() );
                variableList.add( vars );
            }
        }
View Full Code Here

                if ( at.getCode() == code ) {
                    count++;
                }
            }
            if ( count >= code.getMaxCount() ) {
                throw new DecisionTableParseException( "Maximum number of " +
                                                               code.getColHeader() + "/" + code.getColShort() + " columns is " +
                                                               code.getMaxCount() + ", in cell " + RuleSheetParserUtil.rc2name( row, column ) );
            }
            actionTypeMap.put( new Integer( column ), new ActionType( code ) );
        } else {
            throw new DecisionTableParseException(
                    "Invalid column header: " + value + ", should be CONDITION, ACTION or attribute, " +
                            "in cell " + RuleSheetParserUtil.rc2name( row, column ) );
        }
    }
View Full Code Here

     */
    public void addTemplate( int row,
                             int column,
                             String content ) {
        if ( this.sourceBuilder == null ) {
            throw new DecisionTableParseException(
                    "Unexpected content \"" + content + "\" in cell " +
                            RuleSheetParserUtil.rc2name( row, column ) + ", leave this cell blank" );
        }
        this.sourceBuilder.addTemplate( row, column, content );
    }
View Full Code Here

                                  _listeners.get( sheetName ) );

                }
            }
        } catch ( InvalidFormatException e ) {
            throw new DecisionTableParseException( "An error occurred opening the workbook. It is possible that the encoding of the document did not match the encoding of the reader.",
                                                   e );

        } catch ( IOException e ) {
            throw new DecisionTableParseException( "Failed to open Excel stream, " + "please check that the content is xls97 format.",
                                                   e );
        }

    }
View Full Code Here

            case Cell.CELL_TYPE_ERROR:
                cachedValue = String.valueOf( cell.getErrorCellValue() );
                break;

            default:
                throw new DecisionTableParseException( format( "Can't read cached value for cell[row=%d, col=%d, value=%s]!",
                                                               cell.getRowIndex(), cell.getColumnIndex(), cell ) );
        }
        return cachedValue;
    }
View Full Code Here

    public void addCellValue(int row, int column, String value) {
        hasValues = true;
        String template = (String) this.templates.get( new Integer( column ) );
        if( template == null ){
            throw new DecisionTableParseException( "No code snippet for " +
                    this.actionTypeCode + ", above cell " +
                    RuleSheetParserUtil.rc2name( this.headerRow + 2, this.headerCol ) );
        }
        SnippetBuilder snip = new SnippetBuilder(template);
        this.values.add(snip.build( value ));
View Full Code Here

                              String value ) {
        this.hasValues = true;
        Integer key = new Integer( column );
        String content = (String) this.constraints.get( key );
        if ( content == null ) {
            throw new DecisionTableParseException( "No code snippet for CONDITION in cell " +
                                                           RuleSheetParserUtil.rc2name( this.headerRow + 2, this.headerCol ) );
        }
        SnippetBuilder snip = new SnippetBuilder( content );
        String result = snip.build( fixValue( value ) );
        this.values.add( result );
View Full Code Here

TOP

Related Classes of org.drools.template.parser.DecisionTableParseException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.