* @return
* @throws IOException
* @throws XMLStreamException
*/
protected BPELProcessDefinition indexRead(URL doc) throws Exception {
BPELProcessDefinition processDefinition = factory.createBPELProcessDefinition();
processDefinition.setUnresolved(true);
processDefinition.setLocation(doc);
InputStream is = doc.openStream();
XMLStreamReader reader = null;
try {
reader = inputFactory.createXMLStreamReader(is);
int eventType = reader.getEventType();
while (true) {
if (eventType == XMLStreamConstants.START_ELEMENT) {
QName elementName = reader.getName();
if (BPEL_PROCESS_DEFINITION.equals(elementName) || BPEL_EXECUTABLE_DEFINITION.equals(elementName) ) {
QName processName = new QName(getString(reader, org.apache.tuscany.sca.assembly.xml.Constants.TARGET_NAMESPACE), getString(reader, NAME_ELEMENT));
processDefinition.setName(processName);
break;
}
}
if (reader.hasNext()) {
eventType = reader.next();