public class MvelHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
BLC_RULE_MAP_PARAM |
static String |
REQUEST_DTO |
Constructor and Description |
---|
MvelHelper() |
Modifier and Type | Method and Description |
---|---|
static Map<String,Object> |
buildMvelParameters()
Builds parameters using time, request, customer, and cart.
|
static Object |
convertField(String type,
String fieldValue)
Converts a field to the specified type.
|
static boolean |
evaluateRule(String rule,
Map<String,Object> ruleParameters)
Returns true if the passed in rule passes based on the passed in ruleParameters.
|
static boolean |
evaluateRule(String rule,
Map<String,Object> ruleParameters,
Map expressionCache)
Evaluates the passed in rule given the passed in parameters.
|
static void |
setTestMode(boolean testMode)
When true, LOG.info statement will be suppressed.
|
static Object |
toUpperCase(String value) |
public static final String BLC_RULE_MAP_PARAM
public static final String REQUEST_DTO
public static Object convertField(String type, String fieldValue)
type
- fieldValue
- public static boolean evaluateRule(String rule, Map<String,Object> ruleParameters)
evaluateRule(String, Map, Map)
method passing in the DEFAULT_EXPRESSION_CACHE.
For systems that need to cache a large number of rule expressions, an alternate cache can be passed in. The
default cache is able to cache up to 1,000 rule expressions which should suffice for most systems.rule
- ruleParameters
- public static boolean evaluateRule(String rule, Map<String,Object> ruleParameters, Map expressionCache)
rule
- ruleParameters
- public static void setTestMode(boolean testMode)
testMode
- Copyright © 2014. All rights reserved.