Add <exm_root>/services/adobe-exm-expeval-services.jar
to your classpath.
The default Spring context file is available at /META-INF/spring/module-context.xml,
inside adobe-exm-expeval-services.jar. Create a Spring context using
this file.
ApplicationContext ctx = new ClassPathXmlApplicationContext("/META-INF/spring/module-context.xml");
Retrieve the expression evaluation service.
EXPEvaluator expressionEvaluationService = (EXPEvaluator) ctx.getBean("lc.exm.expEvaluator");
Create a map of the variables used inside the expression
being evaluated.
HashMap<String, Serializable> variables = new HashMap<String, Serializable>();
variables.put("number1", 25);
variables.put("number2", 26);
Start the expression evaluation service, and pass the expression
and expression variables as parameters.
Boolean result = (Boolean)expressionEvaluationService.evaluateExpression("${number2 > number1}",variables);
|
|
|