Package org.drools.ide.common.client.modeldriven.brl

Examples of org.drools.ide.common.client.modeldriven.brl.ConnectiveConstraint


        X.setFieldType( SuggestionCompletionEngine.TYPE_STRING );
        X.setConstraintValueType( SingleFieldConstraint.TYPE_LITERAL );
        X.setValue( "foo" );
        X.setOperator( "==" );
        X.connectives = new ConnectiveConstraint[1];
        X.connectives[0] = new ConnectiveConstraint();
        X.connectives[0].setConstraintValueType( ConnectiveConstraint.TYPE_LITERAL );
        X.connectives[0].setFieldType( SuggestionCompletionEngine.TYPE_STRING );
        X.connectives[0].setOperator( "|| ==" );
        X.connectives[0].setValue( "bar" );
        comp.addConstraint( X );
View Full Code Here


        con.setOperator( "==" );
        con.setValue( "goo" );
        con.setConstraintValueType( SingleFieldConstraint.TYPE_VARIABLE );
        p.addConstraint( con );

        ConnectiveConstraint connective = new ConnectiveConstraint();
        connective.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        connective.setFieldType( SuggestionCompletionEngine.TYPE_STRING );
        connective.setOperator( "|| ==" );
        connective.setValue( "blah" );

        con.connectives = new ConnectiveConstraint[1];
        con.connectives[0] = connective;

        m.addLhsItem( p );
View Full Code Here

                }

                // and now do the connectives.
                if ( constr.connectives != null ) {
                    for ( int j = 0; j < constr.connectives.length; j++ ) {
                        final ConnectiveConstraint conn = constr.connectives[ j ];

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

                        addFieldRestriction( buf,
                                             conn.getConstraintValueType(),
                                             conn.getFieldType(),
                                             conn.getOperator(),
                                             parameters,
                                             conn.getValue(),
                                             conn.getExpressionValue() );
                    }
                }

            }
        }
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( SuggestionCompletionEngine.TYPE_THIS ) ) {
                showLiteralSelector = SuggestionCompletionEngine.isCEPOperator( sfc.getOperator() );
                showFormulaSelector = showFormulaSelector && showLiteralSelector;
            }
        } else if ( con instanceof ConnectiveConstraint ) {
            ConnectiveConstraint cc = (ConnectiveConstraint) con;
            String fieldName = cc.getFieldName();
            if ( fieldName.equals( SuggestionCompletionEngine.TYPE_THIS ) ) {
                showLiteralSelector = SuggestionCompletionEngine.isCEPOperator( cc.getOperator() );
                showFormulaSelector = showFormulaSelector && showLiteralSelector;
            }
        }

        //Literal value selector
View Full Code Here

                }

                // and now do the connectives.
                if ( constr.connectives != null ) {
                    for ( int j = 0; j < constr.connectives.length; j++ ) {
                        final ConnectiveConstraint conn = constr.connectives[j];

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

                        addFieldRestriction( buf,
                                             conn.getConstraintValueType(),
                                             conn.getFieldType(),
                                             conn.getOperator(),
                                             parameters,
                                             conn.getValue(),
                                             conn.getExpressionValue() );
                    }
                }

            }
        }
View Full Code Here

            }

            //Visit Connection constraints
            if ( sfc.connectives != null ) {
                for ( int i = 0; i < sfc.connectives.length; i++ ) {
                    final ConnectiveConstraint cc = sfc.connectives[i];
                    if ( BaseSingleFieldConstraint.TYPE_TEMPLATE == cc.getConstraintValueType() && !vars.containsKey( cc.getValue() ) ) {
                        InterpolationVariable var = new InterpolationVariable( cc.getValue(),
                                                                               cc.getFieldType(),
                                                                               factPattern.getFactType(),
                                                                               cc.getFieldName() );
                        vars.put( var,
                                  vars.size() );
                    }
                }
            }
View Full Code Here

            }

            //Visit Connection constraints
            if ( sfexp.connectives != null ) {
                for ( int i = 0; i < sfexp.connectives.length; i++ ) {
                    final ConnectiveConstraint cc = sfexp.connectives[i];
                    if ( BaseSingleFieldConstraint.TYPE_TEMPLATE == cc.getConstraintValueType() && !vars.containsKey( cc.getValue() ) ) {
                        InterpolationVariable var = new InterpolationVariable( cc.getValue(),
                                                                               sfexp.getExpressionLeftSide().getGenericType(),
                                                                               factPattern.getFactType(),
                                                                               cc.getFieldName() );
                        vars.put( var,
                                  vars.size() );
                    }
                }
            }
View Full Code Here

    public Widget connectives(SingleFieldConstraint c,
                              String factClass) {
        if ( c.connectives != null && c.connectives.length > 0 ) {
            DirtyableHorizontalPane horiz = new DirtyableHorizontalPane();
            for ( int i = 0; i < c.connectives.length; i++ ) {
                ConnectiveConstraint con = c.connectives[i];
                horiz.add( connectiveOperatorDropDown( con,
                                                       c.getFieldName() ) );
                horiz.add( connectiveValueEditor( con,
                                                  factClass,
                                                  c.getFieldName() ) );
View Full Code Here

            }
        }

        //Repeat of SingleFieldConstraint checks but for ConnectiveContraints (oh why don't they extend a single common ancestor)
        if ( con instanceof ConnectiveConstraint && f != null && f.getFactType() != null ) {
            ConnectiveConstraint cc = (ConnectiveConstraint) con;
            if ( SuggestionCompletionEngine.isCEPOperator( cc.getOperator() ) ) {
                if ( cc.getFieldType().equals( SuggestionCompletionEngine.TYPE_THIS ) ) {
                    if ( sce.isFactTypeAnEvent( f.getFactType() ) ) {
                        return true;
                    } else if ( cc.getFieldType().equals( SuggestionCompletionEngine.TYPE_DATE ) ) {
                        if ( sce.isFactTypeAnEvent( f.getFactType() ) ) {
                            return true;
                        }
                    }
                }
            } else if ( cc.getFieldType().equals( SuggestionCompletionEngine.TYPE_THIS ) ) {
                if ( f.getFactType().equals( this.pattern.getFactType() ) ) {
                    return true;
                }
                if ( fieldConstraint != null && fieldConstraint.equals( this.pattern.getFactType() ) ) {
                    return true;
View Full Code Here

TOP

Related Classes of org.drools.ide.common.client.modeldriven.brl.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.