protected XMLImporter getImporter(Import theImport) { if (this.importers.containsKey(theImport.getImportType())) { return this.importers.get(theImport.getImportType()); } else { if (theImport.getImportType().equals("http://schemas.xmlsoap.org/wsdl/")) { Class<?> wsdlImporterClass; try { wsdlImporterClass = Class.forName("org.flowable.engine.impl.webservice.CxfWSDLImporter", true, Thread.currentThread().getContextClassLoader()); XMLImporter newInstance = (XMLImporter) wsdlImporterClass.newInstance(); this.importers.put(theImport.getImportType(), newInstance); return newInstance; } catch (Exception e) { throw new ActivitiException("Could not find importer for type " + theImport.getImportType(), e); } } return null; } }
@Override public XMLImporter createXMLImporter(Import theImport) throws FlowableException { try { Class<?> wsdlImporterClass = Class.forName(DEFAULT_XML_IMPORTER_FACTORY_CLASSNAME, true, Thread.currentThread().getContextClassLoader()); return (XMLImporter) wsdlImporterClass.newInstance(); } catch (ClassNotFoundException e) { throw new FlowableException("Could not find importer class for type " + theImport.getImportType(), e); } catch (Exception e) { throw new FlowableException(String.format("Error instantiating XML importer '%s' for type '%s'", DEFAULT_XML_IMPORTER_FACTORY_CLASSNAME, theImport.getImportType()), e); } } }
protected void fillImporterInfo(Import theImport, String sourceSystemId) { if (!xmlImporterMap.containsKey(theImport.getNamespace())) { if (theImport.getImportType().equals("http://schemas.xmlsoap.org/wsdl/")) { try { ProcessEngineConfigurationImpl processEngineConfig = CommandContextUtil.getProcessEngineConfiguration(); XMLImporter importerInstance = processEngineConfig.getWsdlImporterFactory() .createXMLImporter(theImport); xmlImporterMap.put(theImport.getNamespace(), importerInstance); importerInstance.importFrom(theImport, sourceSystemId); structureDefinitionMap.putAll(importerInstance.getStructures()); wsServiceMap.putAll(importerInstance.getServices()); wsOperationMap.putAll(importerInstance.getOperations()); } catch (FlowableException e) { throw e; } catch (Exception e) { throw new FlowableException(String.format("Error importing '%s' as '%s'", theImport.getLocation(), theImport.getImportType()), e); } } else { throw new FlowableException(String.format("Unsupported import type '%s'", theImport.getImportType())); } } }
protected void createImports() { for (Import theImport : bpmnModel.getImports()) { XMLImporter importer = this.getImporter(theImport); if (importer == null) { throw new ActivitiException("Could not import item of type " + theImport.getImportType()); } else { importer.importFrom(theImport, sourceSystemId); this.structures.putAll(importer.getStructures()); this.interfaceImplementations.putAll(importer.getServices()); this.operationImplementations.putAll(importer.getOperations()); } } }
public void setValues(Import otherElement) { super.setValues(otherElement); setImportType(otherElement.getImportType()); setLocation(otherElement.getLocation()); setNamespace(otherElement.getNamespace()); } }
public void setValues(Import otherElement) { super.setValues(otherElement); setImportType(otherElement.getImportType()); setLocation(otherElement.getLocation()); setNamespace(otherElement.getNamespace()); } }