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

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


        }

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


            if ( isDSLEnhanced ) {
                // adding passthrough markup
                buf.append( ">" );
            }

            final LHSGeneratorContext gctx = generatorContextFactory.newChildGeneratorContext( rootContext,
                                                                                               pattern );
            preGeneratePattern( gctx );

            generateFactPattern( pattern,
                                 gctx );
View Full Code Here

                // adding passthrough markup
                buf.append( ">" );
            }

            if ( pattern.getFactPattern() != null ) {
                final LHSGeneratorContext gctx = generatorContextFactory.newChildGeneratorContext( rootContext,
                                                                                                   pattern.getFactPattern() );
                generateFactPattern( pattern.getFactPattern(),
                                     gctx );

                buf.append( " from " );
View Full Code Here

                // adding passthrough markup
                buf.append( ">" );
            }

            if ( pattern.getFactPattern() != null ) {
                final LHSGeneratorContext gctx = generatorContextFactory.newChildGeneratorContext( rootContext,
                                                                                                   pattern.getFactPattern() );
                generateFactPattern( pattern.getFactPattern(),
                                     gctx );

                buf.append( " from collect ( " );
View Full Code Here

                // adding passthrough markup
                buf.append( ">" );
            }

            if ( pattern.getFactPattern() != null ) {
                final LHSGeneratorContext gctx = generatorContextFactory.newChildGeneratorContext( rootContext,
                                                                                                   pattern.getFactPattern() );
                generateFactPattern( pattern.getFactPattern(),
                                     gctx );

                buf.append( " from accumulate ( " );
                if ( pattern.getSourcePattern() != null ) {
                    if ( pattern.getSourcePattern() instanceof FactPattern ) {
                        final LHSGeneratorContext soucrceGctx = generatorContextFactory.newGeneratorContext();
                        generateFactPattern( (FactPattern) pattern.getSourcePattern(),
                                             soucrceGctx );

                    } else if ( pattern.getSourcePattern() instanceof FromAccumulateCompositeFactPattern ) {
                        visitFromAccumulateCompositeFactPattern( (FromAccumulateCompositeFactPattern) pattern.getSourcePattern(),
View Full Code Here

                // adding passthrough markup
                buf.append( ">" );
            }

            if ( pattern.getFactPattern() != null ) {
                final LHSGeneratorContext gctx = generatorContextFactory.newChildGeneratorContext( rootContext,
                                                                                                   pattern.getFactPattern() );
                generateFactPattern( pattern.getFactPattern(),
                                     gctx );
                buf.append( " from entry-point \"" + pattern.getEntryPointName() + "\"\n" );
            }
View Full Code Here

            if ( pattern.getPatterns() == null || pattern.getPatterns().length == 0 ) {
                return;
            }
            IFactPattern subPattern = pattern.getPatterns()[ subIndex ];
            if ( subPattern instanceof FactPattern ) {
                final LHSGeneratorContext gctx = generatorContextFactory.newChildGeneratorContext( rootContext,
                                                                                                   subPattern );
                this.generateFactPattern( (FactPattern) subPattern,
                                          gctx );

            } else if ( subPattern instanceof FromAccumulateCompositeFactPattern ) {
View Full Code Here

            }
        }

        private void generateConstraints( final FactPattern pattern,
                                          final LHSGeneratorContext parentContext ) {
            LHSGeneratorContext gctx = null;
            for ( int constraintIndex = 0; constraintIndex < pattern.getFieldConstraints().length; constraintIndex++ ) {
                FieldConstraint constr = pattern.getConstraintList().getConstraints()[ constraintIndex ];

                if ( constraintIndex == 0 ) {
                    gctx = generatorContextFactory.newChildGeneratorContext( parentContext,
View Full Code Here

                               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 ) {
                        buf.append( "( " );
                    }
                    LHSGeneratorContext gctx = null;
                    for ( int nestedConstraintIndex = 0; nestedConstraintIndex < nestedConstraints.length; nestedConstraintIndex++ ) {
                        FieldConstraint nestedConstr = nestedConstraints[ nestedConstraintIndex ];

                        if ( nestedConstraintIndex == 0 ) {
                            gctx = generatorContextFactory.newChildGeneratorContext( nestedGctx,
View Full Code Here

        }

        private void generateConnectiveFieldRestriction( final SingleFieldConstraint constr,
                                                         final Map<String, String> parameters,
                                                         final LHSGeneratorContext gctx ) {
            LHSGeneratorContext cctx = generatorContextFactory.newChildGeneratorContext( gctx,
                                                                                         constr );
            if ( constr instanceof SingleFieldConstraintEBLeftSide ) {
                SingleFieldConstraintEBLeftSide sfexp = (SingleFieldConstraintEBLeftSide) constr;
                addConnectiveFieldRestriction( buf,
                                               sfexp.getConstraintValueType(),
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.