Package org.drools.workbench.models.commons.backend.rule.context

Examples of org.drools.workbench.models.commons.backend.rule.context.LHSGeneratorContext


                               gctx );
            if ( con instanceof CompositeFieldConstraint ) {
                CompositeFieldConstraint cfc = (CompositeFieldConstraint) con;
                FieldConstraint[] nestedConstraints = cfc.getConstraints();
                if ( nestedConstraints != null ) {
                    LHSGeneratorContext nestedGctx = generatorContextFactory.newChildGeneratorContext( gctx );
                    preGenerateConstraints( nestedGctx );
                    preGenerateNestedConstraint( gctx );
                    if ( gctx.getDepth() > 0 ) {
                        buf.append( "( " );
                    }
                    for ( int nestedConstraintIndex = 0; nestedConstraintIndex < nestedConstraints.length; nestedConstraintIndex++ ) {
                        FieldConstraint nestedConstr = nestedConstraints[ nestedConstraintIndex ];
                        nestedGctx.setFieldConstraint( nestedConstr );
                        generateConstraint( nestedConstr,
                                            nestedGctx );
                    }
                    gctx.setHasOutput( nestedGctx.isHasOutput() );
                    if ( gctx.getDepth() > 0 ) {
                        buf.append( ")" );
                    }
                    postGenerateNestedConstraint( gctx );
                }
View Full Code Here


        }

        private void generateConnectiveFieldRestriction( final SingleFieldConstraint constr,
                                                         final Map<String, String> parameters,
                                                         final LHSGeneratorContext gctx ) {
            LHSGeneratorContext cctx = generatorContextFactory.newChildGeneratorContext( gctx );
            preGenerateConstraints( cctx );
            cctx.setFieldConstraint( constr );
            if ( constr instanceof SingleFieldConstraintEBLeftSide ) {
                SingleFieldConstraintEBLeftSide sfexp = (SingleFieldConstraintEBLeftSide) constr;
                addConnectiveFieldRestriction( buf,
                                               sfexp.getConstraintValueType(),
                                               sfexp.getExpressionLeftSide().getGenericType(),
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.commons.backend.rule.context.LHSGeneratorContext

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.