Element outputResult = (Element)i.next();
String name = outputResult.getAttributeValue("name");
String description = outputResult.getAttributeValue("description");
String contentType = outputResult.getAttributeValue("content-type");
boolean presentable = ConversionHelpers.getBoolean(outputResult.getAttributeValue("presentable"), false);
resultEntryDescriptors.add(new ResultEntryDescriptor(name, new DefaultMessage(description), contentType, presentable));
}
List stateElements = XPath.newInstance("/process/description/output/state").selectNodes(rootElement);
List states = new ArrayList();
for ( Iterator i = stateElements.iterator(); i.hasNext(); ) {
Element stateElement = (Element)i.next();
String description = stateElement.getAttributeValue("description");
states.add(new StateDescriptor(stateElement.getTextTrim(), new DefaultMessage(description)));
}
resultDescriptor = new ResultDescriptor((StateDescriptor [])states.toArray(new StateDescriptor[states.size()]), (ResultEntryDescriptor[])resultEntryDescriptors.toArray(new ResultEntryDescriptor[resultEntryDescriptors.size()]));
List providedEnvironmentElements = XPath.newInstance("/process/description/output/environment").selectNodes(rootElement);
List providedEnvironment = new ArrayList();
for ( Iterator i = providedEnvironmentElements.iterator(); i.hasNext(); ) {
Element environmentElement = (Element)i.next();
String key = environmentElement.getAttributeValue("key");
String storeName = environmentElement.getAttributeValue("store");
String description = environmentElement.getAttributeValue("description");
String contentType = environmentElement.getAttributeValue("content-type");
boolean presentable = ConversionHelpers.getBoolean(environmentElement.getAttributeValue("presentable"), false);
int store = StoreHelper.getStoreByName(storeName);
ProvidedEnvironmentDescriptor environmentDescriptor = new ProvidedEnvironmentDescriptor(key, new DefaultMessage(description), contentType, presentable);
environmentDescriptor.setStore(store);
providedEnvironment.add(environmentDescriptor);
}
providedEnvironmentDescriptors = (ProvidedEnvironmentDescriptor [])providedEnvironment.toArray(new ProvidedEnvironmentDescriptor[providedEnvironment.size()]);
List requiredEnvironmentElements = XPath.newInstance("/process/description/input/environment").selectNodes(rootElement);