|
|
|
@ -26,6 +26,7 @@ package org.jeasy.rules.mvel;
|
|
|
|
|
import org.jeasy.rules.api.Action;
|
|
|
|
|
import org.jeasy.rules.api.Facts;
|
|
|
|
|
import org.mvel2.MVEL;
|
|
|
|
|
import org.mvel2.ParserContext;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
|
@ -53,6 +54,17 @@ public class MVELAction implements Action {
|
|
|
|
|
compiledExpression = MVEL.compileExpression(expression);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create a new {@link MVELAction}.
|
|
|
|
|
*
|
|
|
|
|
* @param expression the action written in expression language
|
|
|
|
|
* @param parserContext the MVEL parser context
|
|
|
|
|
*/
|
|
|
|
|
public MVELAction(String expression, ParserContext parserContext) {
|
|
|
|
|
this.expression = expression;
|
|
|
|
|
compiledExpression = MVEL.compileExpression(expression, parserContext);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void execute(Facts facts) {
|
|
|
|
|
try {
|
|
|
|
|