MVELInformationTransformer extends InformationTransformer { public String transform(Object information, java.util.Map<String, Object> headers, ActivityType activityType) { java.util.Map<String,Object> vars=new java.util.HashMap<String, Object>(); vars.put("information", information); vars.put("headers", headers); vars.put("activity", activityType); Object result=MVEL.executeExpression(_compiledExpression, vars); return (result == null ? null : result.toString()); }  String getExpression(); void setExpression(String expr); @Override void init(); String transform(Object information, java.util.Map<String, Object> headers, ActivityType activityType);  }
@Test public void testTransform() { MVELInformationTransformer transformer=new MVELInformationTransformer(); transformer.setExpression("information.value"); try { transformer.init(); } catch (Exception e) { fail("Evaluator should have initialized: "+e); } TestInfo info=new TestInfo(); String value=transformer.transform(info); if (value == null) { fail("Null value returned"); } if (!value.equals(info.value)) { fail("Value mismatch: "+value+" not equal "+info.value); } }