String operationName = null;
BPELScript script = null;
script = new BPELScript(this);
ODEWSDLTransformer wsdlTransformer = new ODEWSDLTransformer();
script.create(BPELScriptType.BPEL2);
this.odeProcess = script.getGpelProcess();
this.odeProcess.setTargetNamespace(XBayaConstants.LEAD_NS);
WsdlDefinitions abstractWorkflowWsdl = script.getWorkflowWSDL().getWsdlDefinitions();
this.odeWorkflowWSDL = abstractWorkflowWsdl;
try {
this.odeInvokableWSDL = WSDLUtil.stringToWSDL(abstractWorkflowWsdl.xmlString());
wsdlTransformer.makeWorkflowWSDLConcrete(this.odeInvokableWSDL, this.getName(), dscUrl);
wsdlTransformer.setOdeLocation(odeEprEndingWithPort, this.getName(), this.odeInvokableWSDL);
this.odeWsdlMap = new HashMap<String, WsdlDefinitions>();
Collection<XmlElement> itr = script.getWSDLs();
for (XmlElement xmlElement : itr) {
WsdlDefinitions wsdl = WSDLUtil.stringToWSDL(XmlConstants.BUILDER.serializeToString(xmlElement));
String id = xmlElement.attributeValue(NS_XWF, ID_ATTRIBUTE);
if (id == null || id.length() == 0) {
// xwf up to 2.2.6_2 doesn't have ID.
id = WSDLUtil.getWSDLQName(wsdl).toString();
if (null == id || "".equals(id) || (id.startsWith("{") && id.endsWith("}"))) {
QName wsdlQname = new QName(NS_XWF.getName(), WSDLUtil.getFirstOperationName(wsdl,
WSDLUtil.getFirstPortTypeQName(wsdl)));
id = wsdlQname.toString();
wsdl.xml().setAttributeValue("name", wsdlQname.getLocalPart());
}
}
WSDLCleaner.cleanWSDL(wsdl);
this.odeWsdlMap.put(id, wsdl);
}
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
new ODEBPELTransformer()
.generateODEBPEL(this.odeProcess, this.getName(), this.odeWorkflowWSDL, this.odeWsdlMap);
wsdlTransformer.trasnformToODEWsdls(this.getName(), dscUrl, this.odeWorkflowWSDL, this.odeWsdlMap);
String wsdlString = XMLUtil.xmlElementToString(this.odeWorkflowWSDL.xml());
this.tridentWSDL = new WsdlDefinitions(XMLUtil.stringToXmlElement(wsdlString));
new TridentTransformer().process(this.tridentWSDL);