Package org.drools.workbench.models.datamodel.rule

Examples of org.drools.workbench.models.datamodel.rule.ConnectiveConstraint


                for ( int i = 0; i < connectiveConstraints.length; i++ ) {
                    String constraint = splittedValue[ i + 1 ].trim();
                    String connectiveOperator = findOperator( constraint );
                    String connectiveValue = constraint.substring( connectiveOperator.length() ).trim();

                    connectiveConstraints[ i ] = new ConnectiveConstraint();
                    connectiveConstraints[ i ].setOperator( ( isAnd ? "&& " : "|| " ) + connectiveOperator );
                    setValueOnConstraint( m, operator, factPattern, connectiveConstraints[ i ], connectiveValue );
                }
                con.setConnectives( connectiveConstraints );
            }
View Full Code Here


                                               cctx,
                                               true );
            }

            for ( int j = 0; j < constr.getConnectives().length; j++ ) {
                final ConnectiveConstraint conn = constr.getConnectives()[ j ];
                final Map<String, String> connectiveParameters = conn.getParameters();

                addConnectiveFieldRestriction( buf,
                                               conn.getConstraintValueType(),
                                               conn.getFieldType(),
                                               conn.getOperator(),
                                               connectiveParameters,
                                               conn.getValue(),
                                               conn.getExpressionValue(),
                                               cctx,
                                               true );
            }
        }
View Full Code Here

                for ( int i = 0; i < connectiveConstraints.length; i++ ) {
                    String constraint = splittedValue[ i + 1 ].trim();
                    String connectiveOperator = findOperator( constraint );
                    String connectiveValue = constraint.substring( connectiveOperator.length() ).trim();

                    connectiveConstraints[ i ] = new ConnectiveConstraint();
                    connectiveConstraints[ i ].setOperator( ( isAnd ? "&& " : "|| " ) + connectiveOperator );
                    setValueOnConstraint( operator, connectiveConstraints[ i ], connectiveValue );
                }
                con.setConnectives( connectiveConstraints );
            }
View Full Code Here

                                               cctx,
                                               true );
            }

            for ( int j = 0; j < constr.getConnectives().length; j++ ) {
                final ConnectiveConstraint conn = constr.getConnectives()[ j ];

                if ( conn instanceof HasParameterizedOperator ) {
                    HasParameterizedOperator hop = (HasParameterizedOperator) conn;
                    parameters = hop.getParameters();
                }

                addConnectiveFieldRestriction( buf,
                                               conn.getConstraintValueType(),
                                               conn.getFieldType(),
                                               conn.getOperator(),
                                               parameters,
                                               conn.getValue(),
                                               conn.getExpressionValue(),
                                               cctx,
                                               true );
            }
        }
View Full Code Here

                    // if there are connectives, and the first is a template key, then all templates keys must be checked up front
                    // individual connectives, that have template keys, will still need to be checked too.
                    SingleFieldConstraint sconstr = (SingleFieldConstraint) constr;
                    buf.append( "@if{" + ( (SingleFieldConstraint) constr ).getValue() + " != empty" );
                    for ( int j = 0; j < sconstr.getConnectives().length; j++ ) {
                        final ConnectiveConstraint conn = sconstr.getConnectives()[ j ];
                        if ( conn.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_TEMPLATE ) {
                            buf.append( " || " + conn.getValue() + " != empty" );
                        }
                    }
                    buf.append( "}" );
                } else {
                    buf.append( "@if{" + ( (SingleFieldConstraint) constr ).getValue() + " != empty}" );
View Full Code Here

        }

        //Visit Connection constraints
        if ( sfc.getConnectives() != null ) {
            for ( int i = 0; i < sfc.getConnectives().length; i++ ) {
                final ConnectiveConstraint cc = sfc.getConnectives()[ i ];
                InterpolationVariable ccVar = new InterpolationVariable( cc.getValue(),
                                                                         cc.getFieldType(),
                                                                         ( factPattern == null ? "" : factPattern.getFactType() ),
                                                                         cc.getFieldName() );
                if ( BaseSingleFieldConstraint.TYPE_TEMPLATE == cc.getConstraintValueType() && !vars.contains( ccVar ) ) {
                    vars.add( ccVar );
                } else {
                    hasNonTemplateOutput = true;
                }
View Full Code Here

        }

        //Visit Connection constraints
        if ( sfexp.getConnectives() != null ) {
            for ( int i = 0; i < sfexp.getConnectives().length; i++ ) {
                final ConnectiveConstraint cc = sfexp.getConnectives()[ i ];
                InterpolationVariable ccVar = new InterpolationVariable( cc.getValue(),
                                                                         genericType,
                                                                         factType,
                                                                         cc.getFieldName() );
                if ( BaseSingleFieldConstraint.TYPE_TEMPLATE == cc.getConstraintValueType() && !vars.contains( ccVar ) ) {
                    vars.add( ccVar );
                } else {
                    hasNonTemplateOutput = true;
                }
            }
View Full Code Here

                for ( int i = 0; i < connectiveConstraints.length; i++ ) {
                    String constraint = splittedValue[ i + 1 ].trim();
                    String connectiveOperator = findOperator( constraint );
                    String connectiveValue = constraint.substring( connectiveOperator.length() ).trim();

                    connectiveConstraints[ i ] = new ConnectiveConstraint();
                    connectiveConstraints[ i ].setOperator( ( isAnd ? "&& " : "|| " ) + connectiveOperator );
                    setValueOnConstraint( m,
                                          operator,
                                          factPattern,
                                          connectiveConstraints[ i ],
View Full Code Here

                                               cctx,
                                               true );
            }

            for ( int j = 0; j < constr.getConnectives().length; j++ ) {
                final ConnectiveConstraint conn = constr.getConnectives()[ j ];
                final Map<String, String> connectiveParameters = conn.getParameters();

                addConnectiveFieldRestriction( buf,
                                               conn.getConstraintValueType(),
                                               conn.getFieldType(),
                                               conn.getOperator(),
                                               connectiveParameters,
                                               conn.getValue(),
                                               conn.getExpressionValue(),
                                               cctx,
                                               true );
            }
        }
View Full Code Here

                                               cctx,
                                               true );
            }

            for ( int j = 0; j < constr.getConnectives().length; j++ ) {
                final ConnectiveConstraint conn = constr.getConnectives()[ j ];
                final Map<String, String> connectiveParameters = conn.getParameters();

                addConnectiveFieldRestriction( buf,
                                               conn.getConstraintValueType(),
                                               conn.getFieldType(),
                                               conn.getOperator(),
                                               connectiveParameters,
                                               conn.getValue(),
                                               conn.getExpressionValue(),
                                               cctx,
                                               true );
            }
        }
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.datamodel.rule.ConnectiveConstraint

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.