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

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


        X.setConstraintValueType( SingleFieldConstraint.TYPE_TEMPLATE );
        X.setValue( "$f1" );
        X.setOperator( "==" );
        p1.addConstraint( X );

        ConnectiveConstraint connective = new ConnectiveConstraint();
        connective.setConstraintValueType( BaseSingleFieldConstraint.TYPE_TEMPLATE );
        connective.setFieldType( DataType.TYPE_STRING );
        connective.setOperator( "|| ==" );
        connective.setValue( "$f2" );

        X.setConnectives( new ConnectiveConstraint[ 1 ] );
        X.getConnectives()[ 0 ] = connective;

        String expected = "rule \"t1_0\"\n" +
View Full Code Here


        if ( c.getConnectives() != null && c.getConnectives().length > 0 ) {
            hp.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
            hp.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
            for ( int i = 0; i < c.getConnectives().length; i++ ) {
                final int index = i;
                final ConnectiveConstraint con = c.getConnectives()[ i ];
                connectiveOperatorDropDown( con,
                                            new Callback<Widget>() {
                                                @Override
                                                public void callback( final Widget w ) {
                                                    hp.add( w );
View Full Code Here

            }
            this.fieldName = sfexp.getExpressionLeftSide().getFieldName();
            this.fieldType = sfexp.getExpressionLeftSide().getGenericType();

        } else if ( con instanceof ConnectiveConstraint ) {
            ConnectiveConstraint cc = (ConnectiveConstraint) con;
            this.factType = cc.getFactType();
            this.fieldName = cc.getFieldName();
            this.fieldType = cc.getFieldType();

        } else if ( con instanceof SingleFieldConstraint ) {
            SingleFieldConstraint sfc = (SingleFieldConstraint) con;
            this.factType = sfc.getFactType();
            this.fieldName = sfc.getFieldName();
View Full Code Here

            if ( fieldName.equals( DataType.TYPE_THIS ) ) {
                showLiteralSelector = CEPOracle.isCEPOperator( sfc.getOperator() );
                showFormulaSelector = showFormulaSelector && showLiteralSelector;
            }
        } else if ( con instanceof ConnectiveConstraint ) {
            ConnectiveConstraint cc = (ConnectiveConstraint) con;
            String fieldName = cc.getFieldName();
            if ( fieldName.equals( DataType.TYPE_THIS ) ) {
                showLiteralSelector = CEPOracle.isCEPOperator( cc.getOperator() );
                showFormulaSelector = showFormulaSelector && showLiteralSelector;
            }
        }

        //Literal value selector
View Full Code Here

            }
            this.fieldName = sfexp.getExpressionLeftSide().getFieldName();
            this.fieldType = sfexp.getExpressionLeftSide().getGenericType();

        } else if ( con instanceof ConnectiveConstraint ) {
            ConnectiveConstraint cc = (ConnectiveConstraint) con;
            this.factType = cc.getFactType();
            this.fieldName = cc.getFieldName();
            this.fieldType = cc.getFieldType();

        } else if ( con instanceof SingleFieldConstraint ) {
            SingleFieldConstraint sfc = (SingleFieldConstraint) con;
            this.factType = sfc.getFactType();
            this.fieldName = sfc.getFieldName();
View Full Code Here

            if ( fieldName.equals( DataType.TYPE_THIS ) ) {
                showLiteralSelector = CEPOracle.isCEPOperator( sfc.getOperator() );
                showFormulaSelector = showFormulaSelector && showLiteralSelector;
            }
        } else if ( con instanceof ConnectiveConstraint ) {
            ConnectiveConstraint cc = (ConnectiveConstraint) con;
            String fieldName = cc.getFieldName();
            if ( fieldName.equals( DataType.TYPE_THIS ) ) {
                showLiteralSelector = CEPOracle.isCEPOperator( cc.getOperator() );
                showFormulaSelector = showFormulaSelector && showLiteralSelector;
            }
        }

        //Literal value selector
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.containsKey( ccVar ) ) {
                    vars.put( ccVar,
                              vars.size() );
                }

            }
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.containsKey( ccVar ) ) {
                    vars.put( ccVar,
                              vars.size() );
                }
            }
        }
View Full Code Here

        if ( c.getConnectives() != null && c.getConnectives().length > 0 ) {
            hp.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
            hp.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
            for ( int i = 0; i < c.getConnectives().length; i++ ) {
                final int index = i;
                final ConnectiveConstraint con = c.getConnectives()[ i ];
                connectiveOperatorDropDown( con,
                                            new Callback<Widget>() {
                                                @Override
                                                public void callback( final Widget w ) {
                                                    hp.add( w );
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

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.