wf.setGroup("group");
wf.setWorkflowInstance(job);
wf.setRun(2);
wf.setProtoActionConf(conf.toXmlString());
WorkflowActionBean action = new WorkflowActionBean();
action.setId("actionId");
action.setName("actionName");
action.setErrorInfo("ec", "em");
action.setData("b=B");
action.setExternalId("ext");
action.setTrackerUri("tracker");
action.setExternalStatus("externalStatus");
ELEvaluator eval = Services.get().get(ELService.class).createEvaluator("workflow");
DagELFunctions.configureEvaluator(eval, wf, action);
assertEquals("wfId", eval.evaluate("${wf:id()}", String.class));
assertEquals("name", eval.evaluate("${wf:name()}", String.class));
assertEquals("appPath", eval.evaluate("${wf:appPath()}", String.class));
assertEquals("A", eval.evaluate("${wf:conf('a')}", String.class));
assertEquals("A", eval.evaluate("${a}", String.class));
assertEquals("user", eval.evaluate("${wf:user()}", String.class));
assertEquals("group", eval.evaluate("${wf:group()}", String.class));
assertTrue(eval.evaluate("${wf:callback('XX')}", String.class).contains("id=actionId"));
assertTrue(eval.evaluate("${wf:callback('XX')}", String.class).contains("status=XX"));
assertTrue(eval.evaluate("${wf:callback('XX')}", String.class).contains("status=XX"));
assertEquals(2, (int) eval.evaluate("${wf:run()}", Integer.class));
action.setStatus(WorkflowAction.Status.ERROR);
System.out.println("WorkflowInstance " + wf.getWorkflowInstance().getStatus().toString());
WorkflowInstance wfInstance = wf.getWorkflowInstance();
DagELFunctions.setActionInfo(wfInstance, action);
wf.setWorkflowInstance(wfInstance);