Examples of ConnectiveConstraint


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

                                               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

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

                    // 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

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

        }

        //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

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

        }

        //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

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 ],
View Full Code Here

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

                                               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

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

                                               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

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

        assertEquals( BaseSingleFieldConstraint.TYPE_LITERAL,
                      sfp.getConstraintValueType() );

        assertEquals( 1,
                      sfp.getConnectives().length );
        ConnectiveConstraint cc = sfp.getConnectives()[ 0 ];
        assertEquals( "Applicant",
                      cc.getFactType() );
        assertEquals( "age",
                      cc.getFieldName() );
        assertEquals( "|| >",
                      cc.getOperator() );
        assertEquals( "75",
                      cc.getValue() );
        assertEquals( BaseSingleFieldConstraint.TYPE_LITERAL,
                      cc.getConstraintValueType() );

        assertEqualsIgnoreWhitespace( drl,
                                      RuleModelDRLPersistenceImpl.getInstance().marshal( m ) );
    }
View Full Code Here

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

        assertEquals( BaseSingleFieldConstraint.TYPE_LITERAL,
                      sfp.getConstraintValueType() );

        assertEquals( 1,
                      sfp.getConnectives().length );
        ConnectiveConstraint cc = sfp.getConnectives()[ 0 ];
        assertEquals( "Applicant",
                      cc.getFactType() );
        assertEquals( "age",
                      cc.getFieldName() );
        assertEquals( "|| ==",
                      cc.getOperator() );
        assertEquals( "75",
                      cc.getValue() );
        assertEquals( BaseSingleFieldConstraint.TYPE_LITERAL,
                      cc.getConstraintValueType() );

        assertEqualsIgnoreWhitespace( drl,
                                      RuleModelDRLPersistenceImpl.getInstance().marshal( m ) );
    }
View Full Code Here

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 == null ? null : connectiveOperator.trim() ) );
                    connectiveConstraints[ i ].setFactType( factPattern.getFactType() );
                    connectiveConstraints[ i ].setFieldName( con.getFieldName() );
                    connectiveConstraints[ i ].setFieldType( con.getFieldType() );
                    setValueOnConstraint( m,
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.