Examples of SingleFieldConstraintEBLeftSide


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

        private SingleFieldConstraintEBLeftSide createSingleFieldConstraintEBLeftSide( FactPattern factPattern,
                                                                                       String fieldName,
                                                                                       String operator,
                                                                                       String value ) {
            SingleFieldConstraintEBLeftSide con = new SingleFieldConstraintEBLeftSide();

            fieldName = setFieldBindingOnContraint( fieldName, con );
            String classType = getFQFactType( factPattern.getFactType() );
            con.getExpressionLeftSide().appendPart( new ExpressionUnboundFact( factPattern,
                                                                               classType ) );

            String type = setOperatorAndValueOnConstraint( operator,
                                                           value,
                                                           con );

            parseExpression( classType, fieldName, type, con.getExpressionLeftSide() );

            return con;
        }
View Full Code Here

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

        }

        private void generateNormalFieldRestriction( SingleFieldConstraint constr,
                                                     Map<String, String> parameters ) {
            if ( constr instanceof SingleFieldConstraintEBLeftSide ) {
                SingleFieldConstraintEBLeftSide sfexp = (SingleFieldConstraintEBLeftSide) constr;
                addFieldRestriction( buf,
                                     sfexp.getConstraintValueType(),
                                     sfexp.getExpressionLeftSide().getGenericType(),
                                     sfexp.getOperator(),
                                     parameters,
                                     sfexp.getValue(),
                                     sfexp.getExpressionValue(),
                                     true );
            } else {
                addFieldRestriction( buf,
                                     constr.getConstraintValueType(),
                                     constr.getFieldType(),
View Full Code Here

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

                                                         GeneratorContext gctx ) {
            GeneratorContext cctx = generatorContextFactory.newChildGeneratorContext( gctx );
            preGenerateConstraints( cctx );
            cctx.setFieldConstraint( constr );
            if ( constr instanceof SingleFieldConstraintEBLeftSide ) {
                SingleFieldConstraintEBLeftSide sfexp = (SingleFieldConstraintEBLeftSide) constr;
                addConnectiveFieldRestriction( buf,
                                               sfexp.getConstraintValueType(),
                                               sfexp.getExpressionLeftSide().getGenericType(),
                                               sfexp.getOperator(),
                                               parameters,
                                               sfexp.getValue(),
                                               sfexp.getExpressionValue(),
                                               cctx,
                                               true );
            } else {
                addConnectiveFieldRestriction( buf,
                                               constr.getConstraintValueType(),
View Full Code Here

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

        private SingleFieldConstraintEBLeftSide createSingleFieldConstraintEBLeftSide( final RuleModel m,
                                                                                       final FactPattern factPattern,
                                                                                       String fieldName,
                                                                                       final String operator,
                                                                                       final String value ) {
            SingleFieldConstraintEBLeftSide con = new SingleFieldConstraintEBLeftSide();

            fieldName = setFieldBindingOnContraint( factPattern.getFactType(),
                                                    fieldName,
                                                    m,
                                                    con,
                                                    boundParams );
            String classType = getFQFactType( m,
                                              factPattern.getFactType() );
            con.getExpressionLeftSide().appendPart( new ExpressionUnboundFact( factPattern ) );

            parseExpression( m,
                             classType,
                             fieldName,
                             con.getExpressionLeftSide() );

            setOperatorAndValueOnConstraint( m,
                                             operator,
                                             value,
                                             factPattern,
View Full Code Here

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

                                            final FactPattern factPattern,
                                            final BaseSingleFieldConstraint con ) {
            String factType = null;
            String fieldName = null;
            if ( con instanceof SingleFieldConstraintEBLeftSide ) {
                SingleFieldConstraintEBLeftSide sfcex = (SingleFieldConstraintEBLeftSide) con;
                List<ExpressionPart> sfcexParts = sfcex.getExpressionLeftSide().getParts();
                factType = sfcexParts.get( sfcexParts.size() - 1 ).getPrevious().getClassType();
                fieldName = sfcex.getFieldName();
            } else if ( con instanceof SingleFieldConstraint ) {
                factType = factPattern.getFactType();
                fieldName = ( (SingleFieldConstraint) con ).getFieldName();
            } else if ( con instanceof ConnectiveConstraint ) {
                factType = factPattern.getFactType();
View Full Code Here

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

                assertConstraintValue( constr );

                if ( isConstraintComplete( constr ) ) {
                    if ( constr instanceof SingleFieldConstraintEBLeftSide ) {
                        final SingleFieldConstraintEBLeftSide sfcexp = ( (SingleFieldConstraintEBLeftSide) constr );
                        final ToStringExpressionVisitor visitor = new ToStringExpressionVisitor( sfcexp.getExpressionLeftSide().getBinding(),
                                                                                                 constraintValueBuilder );
                        buf.append( sfcexp.getExpressionLeftSide().getText( visitor ) );
                    } else {
                        SingleFieldConstraint parent = (SingleFieldConstraint) constr.getParent();
                        StringBuilder parentBuf = new StringBuilder();
                        while ( parent != null ) {
                            String fieldName = parent.getFieldName();
View Full Code Here

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

        }

        private void generateNormalFieldRestriction( final SingleFieldConstraint constr,
                                                     final Map<String, String> parameters ) {
            if ( constr instanceof SingleFieldConstraintEBLeftSide ) {
                SingleFieldConstraintEBLeftSide sfexp = (SingleFieldConstraintEBLeftSide) constr;
                addFieldRestriction( buf,
                                     sfexp.getConstraintValueType(),
                                     sfexp.getExpressionLeftSide().getGenericType(),
                                     sfexp.getOperator(),
                                     parameters,
                                     sfexp.getValue(),
                                     sfexp.getExpressionValue(),
                                     true );
            } else {
                addFieldRestriction( buf,
                                     constr.getConstraintValueType(),
                                     constr.getFieldType(),
View Full Code Here

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

                                                         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(),
                                               sfexp.getExpressionLeftSide().getGenericType(),
                                               sfexp.getOperator(),
                                               parameters,
                                               sfexp.getValue(),
                                               sfexp.getExpressionValue(),
                                               cctx,
                                               true );
            } else {
                addConnectiveFieldRestriction( buf,
                                               constr.getConstraintValueType(),
View Full Code Here

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

                assertConstraintValue( constr );

                if ( isConstraintComplete( constr ) ) {
                    if ( constr instanceof SingleFieldConstraintEBLeftSide ) {
                        final SingleFieldConstraintEBLeftSide sfcexp = ( (SingleFieldConstraintEBLeftSide) constr );
                        final ToStringExpressionVisitor visitor = new ToStringExpressionVisitor( sfcexp.getExpressionLeftSide().getBinding(),
                                                                                                 constraintValueBuilder );
                        buf.append( sfcexp.getExpressionLeftSide().getText( visitor ) );
                    } else {
                        SingleFieldConstraint parent = (SingleFieldConstraint) constr.getParent();
                        StringBuilder parentBuf = new StringBuilder();
                        while ( parent != null ) {
                            String fieldName = parent.getFieldName();
View Full Code Here

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

        }

        private void generateNormalFieldRestriction( final SingleFieldConstraint constr,
                                                     final Map<String, String> parameters ) {
            if ( constr instanceof SingleFieldConstraintEBLeftSide ) {
                SingleFieldConstraintEBLeftSide sfexp = (SingleFieldConstraintEBLeftSide) constr;
                addFieldRestriction( buf,
                                     sfexp.getConstraintValueType(),
                                     sfexp.getExpressionLeftSide().getGenericType(),
                                     sfexp.getOperator(),
                                     parameters,
                                     sfexp.getValue(),
                                     sfexp.getExpressionValue(),
                                     true );
            } else {
                addFieldRestriction( buf,
                                     constr.getConstraintValueType(),
                                     constr.getFieldType(),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.