Package org.apache.commons.jexl2

Examples of org.apache.commons.jexl2.Script.execute()


   
    Boolean result = null;
    if (rewritten) {
      Script script = engine.createScript(this.modifiedQuery);
      try {
        result = (Boolean) script.execute(ctx);
      } catch (Exception e) {
        log.error("Error evaluating script: " + this.modifiedQuery + " against event" + eventFields.toString(), e);
      }
    } else {
      Expression expr = engine.createExpression(this.modifiedQuery);
View Full Code Here


        // This is mandated by JSR-223 (end of section SCR.4.3.4.1.2 - Script Execution)
        context.setAttribute(CONTEXT_KEY, context, ScriptContext.ENGINE_SCOPE);
        try {
            Script jexlScript = jexlEngine.createScript(script);
            JexlContext ctxt = new JexlContextWrapper(context);
            return jexlScript.execute(ctxt);
        } catch (Exception e) {
            throw new ScriptException(e.toString());
        }
    }
View Full Code Here

        Script jexlScript = null;
        try {
            final JexlContext effective = getEffectiveContext(jexlCtx);
            effective.setEvaluatingLocation(true);
            jexlScript = getJexlEngine().createScript(script);
            return jexlScript.execute(effective);
        } catch (Exception e) {
            String exMessage = e.getMessage() != null ? e.getMessage() : e.getClass().getCanonicalName();
            throw new SCXMLExpressionException("evalScript('" + script + "'): " + exMessage, e);
        }
    }
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.