} else {
throw new IllegalStateException("NO Service found in the workflow WSDL:" + workflowName);
}
Iterator<WsdlPort> ports = service.ports().iterator();
WsdlPort port = null;
if (ports.hasNext()) {
port = ports.next();
} else {
throw new IllegalStateException("NO Port found in the workflow WSDL:" + workflowName);
}
String targetNamespace = gpelProcess.getTargetNamespace();
String targetNamespacePrefix = "wfns";
XmlNamespace odeNs = builder.newNamespace("http://www.apache.org/ode/schemas/dd/2007/03");
XmlElement deploy = builder.newFragment(odeNs, "deploy");
deploy.declareNamespace(PROCESS, targetNamespace);
deploy.declareNamespace(targetNamespacePrefix, workflowWSDL.getTargetNamespace());
XmlElement process = deploy.addElement(odeNs, PROCESS);
process.setAttributeValue(NAME, PROCESS + ":" + workflowName);
// active
XmlElement active = process.addElement(odeNs, "active");
active.addChild("true");
// provide
XmlElement provide = process.addElement(odeNs, "provide");
provide.setAttributeValue("partnerLink", "workflowUserPartner");
XmlElement providerService = provide.addElement(odeNs, "service");
providerService.setAttributeValue("port", port.getName());
providerService.setAttributeValue(NAME, targetNamespacePrefix + ":" + service.getName());
org.xmlpull.infoset.XmlElement wsdlXml = workflowWSDL.xml();
Iterable<org.xmlpull.infoset.XmlElement> partnerLinkTypes = wsdlXml.elements(null, "partnerLinkType");