Package org.drools.spi

Examples of org.drools.spi.DataProvider


                                contextStack,
                                rce );
            }
            ((Accumulate)element).resetInnerDeclarationCache();
        } else if ( element instanceof From ) {
            DataProvider provider = ((From) element).getDataProvider();
            Declaration[] decl = provider.getRequiredDeclarations();
            for (Declaration aDecl : decl) {
                Declaration resolved = resolver.getDeclaration(null,
                        aDecl.getIdentifier());
                if (resolved != null && resolved != aDecl) {
                    provider.replaceDeclaration(aDecl,
                            resolved);
                } else if (resolved == null) {
                    // it is probably an implicit declaration, so find the corresponding pattern
                    Pattern old = aDecl.getPattern();
                    Pattern current = resolver.findPatternByIndex(old.getIndex());
                    if (current != null && old != current) {
                        resolved = new Declaration(aDecl.getIdentifier(),
                                aDecl.getExtractor(),
                                current);
                        provider.replaceDeclaration(aDecl,
                                resolved);
                    }
                }
            }
        } else if ( element instanceof QueryElement ) {
View Full Code Here


                                contextStack,
                                rce );
            }
            ((Accumulate)element).resetInnerDeclarationCache();
        } else if ( element instanceof From ) {
            DataProvider provider = ((From) element).getDataProvider();
            Declaration[] decl = provider.getRequiredDeclarations();
            for (Declaration aDecl : decl) {
                Declaration resolved = resolver.getDeclaration(null,
                        aDecl.getIdentifier());
                if (resolved != null && resolved != aDecl) {
                    provider.replaceDeclaration(aDecl,
                            resolved);
                } else if (resolved == null) {
                    // it is probably an implicit declaration, so find the corresponding pattern
                    Pattern old = aDecl.getPattern();
                    Pattern current = resolver.findPatternByIndex(old.getIndex());
                    if (current != null && old != current) {
                        resolved = new Declaration(aDecl.getIdentifier(),
                                aDecl.getExtractor(),
                                current);
                        provider.replaceDeclaration(aDecl,
                                resolved);
                    }
                }
            }
        } else if ( element instanceof QueryElement ) {
View Full Code Here

                    ((EvalCondition) element).replaceDeclaration( decl[i],
                                                                  resolved );
                }
            }
        } else if ( element instanceof From ) {
            DataProvider provider = ((From) element).getDataProvider();
            Declaration[] decl = provider.getRequiredDeclarations();
            for ( int i = 0; i < decl.length; i++ ) {
                Declaration resolved = resolver.getDeclaration( null,
                                                                decl[i].getIdentifier() );
                if ( resolved != null && resolved != decl[i] ) {
                    provider.replaceDeclaration( decl[i],
                                                 resolved );
                } else if ( resolved == null ) {
                    // it is probably an implicit declaration, so find the corresponding pattern
                    Pattern old = decl[i].getPattern();
                    Pattern current = resolver.findPatternByIndex( old.getIndex() );
                    if ( current != null && old != current ) {
                        resolved = new Declaration( decl[i].getIdentifier(),
                                                    decl[i].getExtractor(),
                                                    current );
                        provider.replaceDeclaration( decl[i],
                                                     resolved );
                    }
                }
            }
        } else {
View Full Code Here

                    ((EvalCondition) element).replaceDeclaration( decl[i],
                                                                  resolved );
                }
            }
        } else if ( element instanceof From ) {
            DataProvider provider = ((From) element).getDataProvider();
            Declaration[] decl = provider.getRequiredDeclarations();
            for ( int i = 0; i < decl.length; i++ ) {
                Declaration resolved = resolver.getDeclaration( null,
                                                                decl[i].getIdentifier() );
                if ( resolved != null && resolved != decl[i] ) {
                    provider.replaceDeclaration( decl[i],
                                                 resolved );
                } else if ( resolved == null ) {
                    // it is probably an implicit declaration, so find the corresponding pattern
                    Pattern old = decl[i].getPattern();
                    Pattern current = resolver.findPatternByIndex( old.getIndex() );
                    if ( current != null && old != current ) {
                        resolved = new Declaration( decl[i].getIdentifier(),
                                                    decl[i].getExtractor(),
                                                    current );
                        provider.replaceDeclaration( decl[i],
                                                     resolved );
                    }
                }
            }
        } else if ( element instanceof QueryElement ) {
View Full Code Here

                                contextStack,
                                rce );
            }
            ((Accumulate)element).resetInnerDeclarationCache();
        } else if ( element instanceof From ) {
            DataProvider provider = ((From) element).getDataProvider();
            Declaration[] decl = provider.getRequiredDeclarations();
            for ( int i = 0; i < decl.length; i++ ) {
                Declaration resolved = resolver.getDeclaration( null,
                                                                decl[i].getIdentifier() );
                if ( resolved != null && resolved != decl[i] ) {
                    provider.replaceDeclaration( decl[i],
                                                 resolved );
                } else if ( resolved == null ) {
                    // it is probably an implicit declaration, so find the corresponding pattern
                    Pattern old = decl[i].getPattern();
                    Pattern current = resolver.findPatternByIndex( old.getIndex() );
                    if ( current != null && old != current ) {
                        resolved = new Declaration( decl[i].getIdentifier(),
                                                    decl[i].getExtractor(),
                                                    current );
                        provider.replaceDeclaration( decl[i],
                                                     resolved );
                    }
                }
            }
        } else if ( element instanceof QueryElement ) {
View Full Code Here

                                      final BaseDescr descr,
                                      final Pattern prefixPattern) {
        final FromDescr fromDescr = (FromDescr) descr;

        final AccessorDescr accessor = (AccessorDescr) fromDescr.getDataSource();
        DataProvider dataProvider = null;
        try {
            final DroolsMVELFactory factory = new DroolsMVELFactory( context.getDeclarationResolver().getDeclarations(),
                                                                     null,
                                                                     context.getPkg().getGlobals() );
View Full Code Here

                                      final BaseDescr descr,
                                      final Pattern prefixPattern) {
        final FromDescr fromDescr = (FromDescr) descr;

        final AccessorDescr accessor = (AccessorDescr) fromDescr.getDataSource();
        DataProvider dataProvider = null;
        try {
            final DroolsMVELFactory factory = new DroolsMVELFactory( context.getDeclarationResolver().getDeclarations(),
                                                                     null,
                                                                     context.getPkg().getGlobals() );
View Full Code Here

                    ((EvalCondition) element).replaceDeclaration( decl[i],
                                                                  resolved );
                }
            }
        } else if ( element instanceof From ) {
            DataProvider provider = ((From) element).getDataProvider();
            Declaration[] decl = provider.getRequiredDeclarations();
            for ( int i = 0; i < decl.length; i++ ) {
                Declaration resolved = resolver.getDeclaration( null,
                                                                decl[i].getIdentifier() );
                if ( resolved != null && resolved != decl[i] ) {
                    provider.replaceDeclaration( decl[i],
                                                 resolved );
                } else if ( resolved == null ) {
                    // it is probably an implicit declaration, so find the corresponding pattern
                    Pattern old = decl[i].getPattern();
                    Pattern current = resolver.findPatternByIndex( old.getIndex() );
                    if ( current != null && old != current ) {
                        resolved = new Declaration( decl[i].getIdentifier(),
                                                    decl[i].getExtractor(),
                                                    current );
                        provider.replaceDeclaration( decl[i],
                                                     resolved );
                    }
                }
            }
        } else {
View Full Code Here

                                contextStack,
                                rce );
            }
            ((Accumulate)element).resetInnerDeclarationCache();
        } else if ( element instanceof From ) {
            DataProvider provider = ((From) element).getDataProvider();
            Declaration[] decl = provider.getRequiredDeclarations();
            for (Declaration aDecl : decl) {
                Declaration resolved = resolver.getDeclaration(null,
                        aDecl.getIdentifier());
                if (resolved != null && resolved != aDecl) {
                    provider.replaceDeclaration(aDecl,
                            resolved);
                } else if (resolved == null) {
                    // it is probably an implicit declaration, so find the corresponding pattern
                    Pattern old = aDecl.getPattern();
                    Pattern current = resolver.findPatternByIndex(old.getIndex());
                    if (current != null && old != current) {
                        resolved = new Declaration(aDecl.getIdentifier(),
                                aDecl.getExtractor(),
                                current);
                        provider.replaceDeclaration(aDecl,
                                resolved);
                    }
                }
            }
        } else if ( element instanceof QueryElement ) {
View Full Code Here

                    ((EvalCondition) element).replaceDeclaration( decl[i],
                                                                  resolved );
                }
            }
        } else if ( element instanceof From ) {
            DataProvider provider = ((From) element).getDataProvider();
            Declaration[] decl = provider.getRequiredDeclarations();
            for ( int i = 0; i < decl.length; i++ ) {
                Declaration resolved = resolver.getDeclaration( null,
                                                                decl[i].getIdentifier() );
                if ( resolved != null && resolved != decl[i] ) {
                    provider.replaceDeclaration( decl[i],
                                                 resolved );
                } else if ( resolved == null ) {
                    // it is probably an implicit declaration, so find the corresponding pattern
                    Pattern old = decl[i].getPattern();
                    Pattern current = resolver.findPatternByIndex( old.getIndex() );
                    if ( current != null && old != current ) {
                        resolved = new Declaration( decl[i].getIdentifier(),
                                                    decl[i].getExtractor(),
                                                    current );
                        provider.replaceDeclaration( decl[i],
                                                     resolved );
                    }
                }
            }
        } else if ( element instanceof QueryElement ) {
View Full Code Here

TOP

Related Classes of org.drools.spi.DataProvider

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.