Package org.broadleafcommerce.openadmin.web.rulebuilder

Examples of org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException


    public Group createGroups(String mvel) throws MVELTranslationException {
        mvel = stripWhiteSpace(mvel);
        String[] tokens = mvel.trim().split(STATEMENTENDCHAR);
        if (tokens.length > 1) {
            throw new MVELTranslationException(MVELTranslationException.INCOMPATIBLE_RULE, "mvel expressions must resolve to a boolean result. " +
                    "More than one terminated statement has been detected, which does not cumulatively result " +
                    "in a single boolean. Multiple phrases should be strung together into a single expression using " +
                    "standard operators.");
        }
        Group topGroup = new Group();
View Full Code Here


                if(leftParenPos.isEmpty()) {
                    return j + 1;
                }
            }
        }
        throw new MVELTranslationException(MVELTranslationException.INCOMPATIBLE_RULE, "Unable to find an end parenthesis for the group started at (" +
                segment.substring(subgroupStartIndex) + ")");
    }
View Full Code Here

            return;
        }
        String[] andTokens = segment.split("&&");
        String[] orTokens = segment.split("\\|\\|");
        if (andTokens.length > 1 && orTokens.length > 1) {
            throw new MVELTranslationException(MVELTranslationException.INCOMPATIBLE_RULE, "Segments that mix logical operators are not compatible with " +
                    "the rules builder: (" + segment + ")");
        }
        boolean isAnd = false;
        boolean isOr = false;
        boolean isNot = false;
View Full Code Here

            }
        } else {
            if (
                    (isOr && !myGroup.getOperatorType().toString().equals(BLCOperator.OR.toString()))
                    ) {
                throw new MVELTranslationException(MVELTranslationException.INCOMPATIBLE_RULE, "Segment logical operator is not compatible with the group " +
                        "logical operator: (" + segment + ")");
            }
        }
    }
View Full Code Here

                if (value.endsWith("\"")) {
                    value = value.substring(0, value.length()-1);
                }
                value = RuleBuilderFormatUtil.formatDate(RuleBuilderFormatUtil.parseDate(value));
            } catch (ParseException e) {
                throw new MVELTranslationException(MVELTranslationException.INCOMPATIBLE_DATE_VALUE, "Unable to convert " +
                        "the persisted date value(" + value + ") to the admin display format.");
            }
        }
        int entityKeyIndex = field.indexOf(".");
        if (entityKeyIndex < 0) {
            throw new MVELTranslationException(MVELTranslationException.NO_FIELD_FOUND_IN_RULE, "Could not identify a " +
                    "valid property field value in the expression: ("+phrase+")");
        }
        if (value.startsWith(caseInsensitivityKey)) {
            value = value.substring(caseInsensitivityKey.length(), value.length()-1);
        }
View Full Code Here

                } catch (Exception e1) {
                    //do nothing
                }

                if (components.length != 3) {
                    throw new MVELTranslationException(MVELTranslationException.UNRECOGNIZABLE_RULE, "Could not parse the MVEL expression to a " +
                            "compatible form for the rules builder (" + phrase + ")");
                }
            }
        }
View Full Code Here

        } else if (operator.equals(".size()<=")) {
            return BLCOperator.COUNT_LESS_OR_EQUAL;
        } else if (operator.equals(".size()==")) {
            return BLCOperator.COUNT_EQUALS;
        }
        throw new MVELTranslationException(MVELTranslationException.OPERATOR_NOT_FOUND, "Unable to identify an operator compatible with the " +
                "rules builder: ("+(isNegation?"!":""+field+operator+value)+")");
    }
View Full Code Here

TOP

Related Classes of org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException

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.