* @return a list of task definition references.
*/
public List<TaskRef> readTasks(String responseText) {
Document xml = XMLParser.parse(responseText);
List<TaskRef> retval = null;
NodeList list = xml.getElementsByTagName("task");
if (list != null) {
retval = new ArrayList<TaskRef>(list.getLength());
for (int index = 0; index < list.getLength(); index++) {
Element elem = (Element) list.item(index);
TaskRef ref = new TaskRef();
ref.setProcessId(elem.getAttribute("processId"));
ref.setTaskId(elem.getAttribute("taskName"));
ref.setInputs(extractTaskIO(elem.getElementsByTagName("input")));
ref.setOutputs(extractTaskIO(elem.getElementsByTagName("output")));
NodeList mdList = elem.getElementsByTagName("metaData");
if (mdList != null) {
Map<String, String> metaData = new HashMap<String, String>();
for (int i = 0; i < mdList.getLength(); i++) {
Element mdElem = (Element) mdList.item(i);
metaData.put(mdElem.getAttribute("key"), mdElem.getAttribute("value"));
}
ref.setMetaData(metaData);
}
retval.add(ref);