* @param conf :Configuration to substitute any variables
* @return configured ELEvaluator
* @throws Exception : If there is any date-time string in wrong format, the exception is thrown
*/
public static ELEvaluator createDataEvaluator(Element eJob, Configuration conf, String actionId) throws Exception {
ELEvaluator e = Services.get().get(ELService.class).createEvaluator("coord-action-start");
setConfigToEval(e, conf);
SyncCoordAction appInst = new SyncCoordAction();
String strNominalTime = eJob.getAttributeValue("action-nominal-time");
if (strNominalTime != null) {
appInst.setNominalTime(DateUtils.parseDateUTC(strNominalTime));
appInst.setActionId(actionId);
appInst.setName(eJob.getAttributeValue("name"));
}
String strActualTime = eJob.getAttributeValue("action-actual-time");
if (strActualTime != null) {
appInst.setActualTime(DateUtils.parseDateUTC(strActualTime));
}
CoordELFunctions.configureEvaluator(e, null, appInst);
Element events = eJob.getChild("input-events", eJob.getNamespace());
if (events != null) {
for (Element data : (List<Element>) events.getChildren("data-in", eJob.getNamespace())) {
if (data.getChild("uris", data.getNamespace()) != null) {
String uris = data.getChild("uris", data.getNamespace()).getTextTrim();
uris = uris.replaceAll(CoordELFunctions.INSTANCE_SEPARATOR, CoordELFunctions.DIR_SEPARATOR);
e.setVariable(".datain." + data.getAttributeValue("name"), uris);
}
else {
}
if (data.getChild("unresolved-instances", data.getNamespace()) != null) {
e.setVariable(".datain." + data.getAttributeValue("name") + ".unresolved", "true"); // TODO:
// check
// null
}
}
}
events = eJob.getChild("output-events", eJob.getNamespace());
if (events != null) {
for (Element data : (List<Element>) events.getChildren("data-out", eJob.getNamespace())) {
if (data.getChild("uris", data.getNamespace()) != null) {
String uris = data.getChild("uris", data.getNamespace()).getTextTrim();
uris = uris.replaceAll(CoordELFunctions.INSTANCE_SEPARATOR, CoordELFunctions.DIR_SEPARATOR);
e.setVariable(".dataout." + data.getAttributeValue("name"), uris);
}
else {
}// TODO
if (data.getChild("unresolved-instances", data.getNamespace()) != null) {
e.setVariable(".dataout." + data.getAttributeValue("name") + ".unresolved", "true"); // TODO:
// check
// null
}
}
}