protected void processConstraintsAndBinds(final RuleBuildContext context,
                                              final PatternDescr patternDescr,
                                              final Pattern pattern) {

        MVELDumper.MVELDumperContext mvelCtx = new MVELDumper.MVELDumperContext().setRuleContext(context);
        for (BaseDescr b : patternDescr.getDescrs()) {
            String expression;
            boolean isPositional = false;
            if (b instanceof BindingDescr) {
                BindingDescr bind = (BindingDescr) b;
                expression = bind.getVariable() + (bind.isUnification() ? " := " : " : ") + bind.getExpression();
            } else if (b instanceof ExprConstraintDescr) {
                ExprConstraintDescr descr = (ExprConstraintDescr) b;
                expression = descr.getExpression();
                isPositional = descr.getType() == ExprConstraintDescr.Type.POSITIONAL;
            } else {
                expression = b.getText();
            }

            ConstraintConnectiveDescr result = parseExpression(context,
                                                               patternDescr,
                                                               b,
                                                               expression);
            if (result == null) {
                return;
            }

            isPositional &= !(result.getDescrs().size() == 1 && result.getDescrs().get(0) instanceof BindingDescr);

            if (isPositional) {
                processPositional(context,
                                  patternDescr,
                                  pattern,
                                  (ExprConstraintDescr) b);
            } else {
                // need to build the actual constraint
                List<Constraint> constraints = build(context, patternDescr, pattern, result, mvelCtx);
                pattern.addConstraints(constraints);
            }
        }

        TypeDeclaration typeDeclaration = getTypeDeclaration(pattern, context);
        if (typeDeclaration != null && typeDeclaration.isPropertyReactive()) {
            for (String field : context.getRuleDescr().lookAheadFieldsOfIdentifier(patternDescr)) {
                addFieldToPatternWatchlist(pattern, typeDeclaration, field);
            }
        }

        combineConstraints(context, pattern, mvelCtx);
    }
protected void processConstraintsAndBinds ( final RuleBuildContext context , final PatternDescr patternDescr , final Pattern pattern ) { MVELDumper . MVELDumperContext mvelCtx = new MVELDumper . MVELDumperContext ( ) . setRuleContext ( context ) ; for ( BaseDescr b : patternDescr . getDescrs ( ) ) { String expression ; boolean isPositional = false ; if ( b instanceof BindingDescr ) { BindingDescr bind = ( BindingDescr ) b ; expression = bind . getVariable ( ) + ( bind . isUnification ( ) ? " := " : " : " ) + bind . getExpression ( ) ; } else if ( b instanceof ExprConstraintDescr ) { ExprConstraintDescr descr = ( ExprConstraintDescr ) b ; expression = descr . getExpression ( ) ; isPositional = descr . getType ( ) == ExprConstraintDescr . Type . POSITIONAL ; } else { expression = b . getText ( ) ; } ConstraintConnectiveDescr result = parseExpression ( context , patternDescr , b , expression ) ; if ( result == null ) { return ; } isPositional &= ! ( result . getDescrs ( ) . size ( ) == 1 && result . getDescrs ( ) . get ( 0 ) instanceof BindingDescr ) ; if ( isPositional ) { processPositional ( context , patternDescr , pattern , ( ExprConstraintDescr ) b ) ; } else { List < Constraint > constraints = build ( context , patternDescr , pattern , result , mvelCtx ) ; pattern . addConstraints ( constraints ) ; } } TypeDeclaration typeDeclaration = getTypeDeclaration ( pattern , context ) ; if ( typeDeclaration != null && typeDeclaration . isPropertyReactive ( ) ) { for ( String field : context . getRuleDescr ( ) . lookAheadFieldsOfIdentifier ( patternDescr ) ) { addFieldToPatternWatchlist ( pattern , typeDeclaration , field ) ; } } combineConstraints ( context , pattern , mvelCtx ) ; }
Process all constraints and bindings on this pattern