Package org.drools.spi

Examples of org.drools.spi.Constraint.replaceDeclaration()


                        Pattern current = resolver.findPatternByIndex( old.getIndex() );
                        if ( current != null && old != current ) {
                            resolved = new Declaration( decl[i].getIdentifier(),
                                                        decl[i].getExtractor(),
                                                        current );
                            constraint.replaceDeclaration( decl[i], resolved );
                        }
                    }
                }
            }
        } else if ( element instanceof EvalCondition ) {
View Full Code Here


                Constraint constraint = (Constraint) next;
                Declaration[] decl = constraint.getRequiredDeclarations();
                for( int i = 0; i < decl.length; i++ ) {
                    Declaration resolved = resolver.getDeclaration( decl[i].getIdentifier() );
                    if( resolved != null && resolved != decl[i] ) {
                        constraint.replaceDeclaration( decl[i], resolved );
                    }
                }
            }
        } else {
            contextStack.push( element );
View Full Code Here

                Declaration[] decl = constraint.getRequiredDeclarations();
                for ( int i = 0; i < decl.length; i++ ) {
                    Declaration resolved = resolver.getDeclaration( null,
                                                                    decl[i].getIdentifier() );
                    if ( resolved != null && resolved != decl[i] ) {
                        constraint.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() );
View Full Code Here

                        Pattern current = resolver.findPatternByIndex( old.getIndex() );
                        if ( current != null && old != current ) {
                            resolved = new Declaration( decl[i].getIdentifier(),
                                                        decl[i].getExtractor(),
                                                        current );
                            constraint.replaceDeclaration( decl[i],
                                                           resolved );
                        }
                    }
                }
            }
View Full Code Here

                Declaration[] newDecl = constraint.getRequiredDeclarations();
                for ( int i = 0; i < newDecl.length; i++ ) {
                    if ( newDecl[i].getPattern() == this ) {
                        newDecl[i].setPattern( clone );
                        // we still need to call replace because there might be nested declarations to replace
                        constraint.replaceDeclaration( oldDecl[i],
                                                       newDecl[i] );
                    }
                }

                clone.addConstraint( constraint );
View Full Code Here

                            ((VariableConstraint)constraint).setRestriction( restriction.getVariableRestriction() );
                        }
                    }                   
                   
                    if ( resolved != null && resolved != decl[i] && resolved.getPattern() != pattern ) {
                        constraint.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() );
View Full Code Here

                        Pattern current = resolver.findPatternByIndex( old.getIndex() );
                        if ( current != null && old != current ) {
                            resolved = new Declaration( decl[i].getIdentifier(),
                                                        decl[i].getExtractor(),
                                                        current );
                            constraint.replaceDeclaration( decl[i],
                                                           resolved );
                        }
                    }
                }
            }
View Full Code Here

                Constraint constraint = (Constraint) next;
                Declaration[] decl = constraint.getRequiredDeclarations();
                for ( int i = 0; i < decl.length; i++ ) {
                    Declaration resolved = resolver.getDeclaration( decl[i].getIdentifier() );
                    if ( resolved != null && resolved != decl[i] ) {
                        constraint.replaceDeclaration( decl[i],
                                                       resolved );
                    }
                }
            }
        } else if ( element instanceof EvalCondition ) {
View Full Code Here

                Declaration[] newDecl = constraint.getRequiredDeclarations();
                for( int i = 0; i < newDecl.length; i++ ) {
                    if( newDecl[i].getPattern() == this ) {
                        newDecl[i].setPattern( clone );
                        // we still need to call replace because there might be nested declarations to replace
                        constraint.replaceDeclaration( oldDecl[i], newDecl[i] );
                    }
                }
               
                clone.addConstraint( constraint );
            }
View Full Code Here

                            ((MvelConstraint)constraint).unsetUnification();
                        }
                    }
                   
                    if ( resolved != null && resolved != decl[i] && resolved.getPattern() != pattern ) {
                        constraint.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() );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.