long id = DetermineCommand.getNewId();
// Add the reqId to each of the entries for referencing
ScriptBuilder.addObjectToEntries(entries, "ReqId", id);
InstantQueue queue = InstantQueue.getQueue(ScriptQueue.getNextId(script.getContainer().getName()));
queue.addEntries(entries);
queue.setReqId(id);
if (event.hasType() &&
event.getType().equalsIgnoreCase("context") &&
event.hasTypeContext()) {
attribs = 2;
int x = 1;
dList definitions = new dList(event.getTypeContext());
String[] definition_names = null;
try { definition_names = script.getContainer().getString("definitions").split("\\|");
} catch (Exception e) { }
for (String definition : definitions) {
String name = definition_names != null && definition_names.length >= x ?
definition_names[x - 1].trim() : String.valueOf(x);
queue.addDefinition(name, definition);
dB.echoDebug(event.getScriptEntry(), "Adding definition %" + name + "% as " + definition);
x++;
}
}
queue.start();
if (DetermineCommand.hasOutcome(id)) {
event.setReplaced(ObjectFetcher.pickObjectFor(DetermineCommand.getOutcome(id))
.getAttribute(attr.fulfill(attribs)));
}