JMeterContext jmctx = JMeterContextService.getContext();
JMeterVariables vars = jmctx.getVariables();
try
{
JexlContext jc = new MapContext();
jc.set("log", log); //$NON-NLS-1$
jc.set("ctx", jmctx); //$NON-NLS-1$
jc.set("vars", vars); //$NON-NLS-1$
jc.set("props", JMeterUtils.getJMeterProperties()); //$NON-NLS-1$
// Previously mis-spelt as theadName
jc.set("threadName", Thread.currentThread().getName()); //$NON-NLS-1$
jc.set("sampler", currentSampler); //$NON-NLS-1$ (may be null)
jc.set("sampleResult", previousResult); //$NON-NLS-1$ (may be null)
jc.set("OUT", System.out);//$NON-NLS-1$
// Now evaluate the script, getting the result
Expression e = getJexlEngine().createExpression( exp );
Object o = e.evaluate(jc);
if (o != null)