public WorkflowSubmission readWorkflow(Element elem) throws IOException {
Element jobsElem = elem.getChild("jobs");
if (jobsElem == null)
throw new MissingElementException("jobs");
WorkflowSubmission submission = new WorkflowSubmission();
List children = jobsElem.getChildren();
int jobIndex = 0;
for (int i=0; i<children.size(); i++) {
Element child = (Element)children.get(i);
String name = child.getName();
if (name.equals("job")) {
String taskId = JobSubmissionSerializer.readTaskId(child);
JobSubmissionSerializer serializer = serializers.
getJobSubmissionSerializer(jobIndex, taskId, config);
JobSubmission job = serializer.readJob(child);
submission.addJob(job);
jobIndex++;
}
}