}
JexlContext jexlCtx = null;
if (ctx instanceof JexlContext) {
jexlCtx = (JexlContext) ctx;
} else {
throw new SCXMLExpressionException(ERR_CTX_TYPE);
}
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);
}
}