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

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


            this.connector = connector;
        }

        public FieldConstraint asFieldConstraint( RuleModel m,
                                                  FactPattern factPattern ) {
            CompositeFieldConstraint comp = new CompositeFieldConstraint();
            comp.setCompositeJunctionType( connector.equals( "&&" ) ? CompositeFieldConstraint.COMPOSITE_TYPE_AND : CompositeFieldConstraint.COMPOSITE_TYPE_OR );
            for ( Expr expr : subExprs ) {
                comp.addConstraint( expr.asFieldConstraint( m, factPattern ) );
            }
            return comp;
        }
View Full Code Here


            if ( gctx.getDepth() == 0 ) {
                if ( buf.length() > 2 && !( buf.charAt( buf.length() - 2 ) == ',' ) ) {
                    buf.append( ", " );
                }
            } else {
                CompositeFieldConstraint cconstr = (CompositeFieldConstraint) gctx.getParent().getFieldConstraint();
                buf.append( cconstr.getCompositeJunctionType() + " " );
            }
        }
View Full Code Here

        protected void generateConstraint( final FieldConstraint con,
                                           final GeneratorContext gctx ) {
            generateSeparator( con,
                               gctx );
            if ( con instanceof CompositeFieldConstraint ) {
                CompositeFieldConstraint cfc = (CompositeFieldConstraint) con;
                FieldConstraint[] nestedConstraints = cfc.getConstraints();
                if ( nestedConstraints != null ) {
                    GeneratorContext nestedGctx = generatorContextFactory.newChildGeneratorContext( gctx );
                    preGenerateConstraints( nestedGctx );
                    preGenerateNestedConstraint( gctx );
                    if ( gctx.getDepth() > 0 ) {
View Full Code Here

        private ComplexExpr( String connector ) {
            this.connector = connector;
        }

        public FieldConstraint asFieldConstraint( FactPattern factPattern ) {
            CompositeFieldConstraint comp = new CompositeFieldConstraint();
            comp.setCompositeJunctionType( connector.equals( "&&" ) ? CompositeFieldConstraint.COMPOSITE_TYPE_AND : CompositeFieldConstraint.COMPOSITE_TYPE_OR );
            for ( Expr expr : subExprs ) {
                comp.addConstraint( expr.asFieldConstraint( factPattern ) );
            }
            return comp;
        }
View Full Code Here

                return;
            }
            if ( gctx.getDepth() == 0 ) {
                buf.append( ", " );
            } else {
                CompositeFieldConstraint cconstr = (CompositeFieldConstraint) gctx.getParent().getFieldConstraint();
                buf.append( cconstr.getCompositeJunctionType() + " " );
            }
        }
View Full Code Here

         */
        protected void generateConstraint( final FieldConstraint con,
                                           GeneratorContext gctx ) {
            generateSeparator( con, gctx );
            if ( con instanceof CompositeFieldConstraint ) {
                CompositeFieldConstraint cfc = (CompositeFieldConstraint) con;
                FieldConstraint[] nestedConstraints = cfc.getConstraints();
                if ( nestedConstraints != null ) {
                    GeneratorContext nestedGctx = generatorContextFactory.newChildGeneratorContext( gctx );
                    preGenerateConstraints( nestedGctx );
                    preGenerateNestedConstraint( gctx );
                    if ( gctx.getDepth() > 0 ) {
View Full Code Here

            preGenerateNestedConnector( gctx );
            if ( gctx.getDepth() == 0 ) {
                buf.append( ", " );
            } else {
                CompositeFieldConstraint cconstr = (CompositeFieldConstraint) gctx.getParent().getFieldConstraint();
                buf.append( cconstr.getCompositeJunctionType() + " " );
            }
            postGenerateNestedConnector( gctx );
            if ( generateTemplateCheck ) {
                buf.append( "@end{}" );
            }
View Full Code Here

            this.connector = connector;
        }

        public FieldConstraint asFieldConstraint( final RuleModel m,
                                                  final FactPattern factPattern ) {
            CompositeFieldConstraint comp = new CompositeFieldConstraint();
            comp.setCompositeJunctionType( connector.equals( "&&" ) ? CompositeFieldConstraint.COMPOSITE_TYPE_AND : CompositeFieldConstraint.COMPOSITE_TYPE_OR );
            for ( Expr expr : subExprs ) {
                comp.addConstraint( expr.asFieldConstraint( m,
                                                            factPattern ) );
            }
            return comp;
        }
View Full Code Here

                                       final LHSGeneratorContext gctx ) {
            if ( !doesPeerHaveOutput( gctx ) ) {
                return;
            }
            if ( gctx.getParent().getFieldConstraint() instanceof CompositeFieldConstraint ) {
                CompositeFieldConstraint cconstr = (CompositeFieldConstraint) gctx.getParent().getFieldConstraint();
                buf.append( cconstr.getCompositeJunctionType() + " " );
            } else {
                if ( buf.length() > 2 && !( buf.charAt( buf.length() - 2 ) == ',' ) ) {
                    buf.append( ", " );
                }
            }
View Full Code Here

        protected void generateConstraint( final FieldConstraint con,
                                           final LHSGeneratorContext parentContext ) {
            generateSeparator( con,
                               parentContext );
            if ( con instanceof CompositeFieldConstraint ) {
                CompositeFieldConstraint cfc = (CompositeFieldConstraint) con;
                FieldConstraint[] nestedConstraints = cfc.getConstraints();
                if ( nestedConstraints != null ) {
                    LHSGeneratorContext nestedGctx = generatorContextFactory.newChildGeneratorContext( parentContext,
                                                                                                       con );
                    preGenerateNestedConstraint( nestedGctx );
                    if ( parentContext.getParent().getFieldConstraint() instanceof CompositeFieldConstraint ) {
View Full Code Here

TOP

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

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.