DeploymentInformationDocument document = DeploymentInformationDocument.Factory
.newInstance();
DeploymentInformationDocument.DeploymentInformation deploymentInformation = DeploymentInformationDocument.DeploymentInformation.Factory
.newInstance();
DeploymentDocumentsType documentsType = DeploymentDocumentsType.Factory
.newInstance();
// setting the process name
deploymentInformation.setProcessName(StringUtil
.convertToJavaIdentifier(workflowName));
// setting workflow template id
if (templateId != null) {
deploymentInformation.setTemplateId(templateId.toString());
}
// setting process GPEL
XmlObject gpelProcessXmlObject = XBeansUtil
.xmlElementToXmlObject(processString);
documentsType.setBPEL(gpelProcessXmlObject);
// setting deployment descriptors
documentsType.setDeploymentDescriptor(XmlObject.Factory
.parse(XmlConstants.BUILDER
.serializeToStringPretty(workflow
.getODEDeploymentDescriptor(dscURI,
configuration.getODEURL()))));
XMLFile processWSDL = XMLFile.Factory.newInstance();
processWSDL.setFileName(workflowWSDL.xml().attributeValue("name")
+ ".wsdl");
processWSDL.setContent(XBeansUtil
.xmlElementToXmlObject(workflowWSDL.xmlStringPretty()));
documentsType.setProcessWSDL(processWSDL);
XMLFile serviceWSDL;
Map<String, WsdlDefinitions> wsdlMap = workflow.getOdeServiceWSDLs(
dscURI, configuration.getODEURL());
XMLFile[] serviceWSDLs = new XMLFile[wsdlMap.size() + 3];
int index = 0;
for (String id : wsdlMap.keySet()) {
WsdlDefinitions wsdl = wsdlMap.get(id);
serviceWSDL = XMLFile.Factory.newInstance();
serviceWSDL.setFileName(wsdl.xml().attributeValue("name")
+ ".wsdl");
serviceWSDL.setContent(XBeansUtil.xmlElementToXmlObject(wsdl
.xmlStringPretty()));
serviceWSDLs[index++] = serviceWSDL;
}
//add the xsds
//crosscutt
XMLFile crossCutXsd = XMLFile.Factory.newInstance();
crossCutXsd.setFileName("lead-crosscut-parameters.xsd");
crossCutXsd.setContent(XBeansUtil.xmlElementToXmlObject(LeadCrosscutXSD.getXml()));
serviceWSDLs[index++] = crossCutXsd;
//gfac-simple-types.xsd
XMLFile gfacXsd = XMLFile.Factory.newInstance();
gfacXsd.setFileName("gfac-simple-types.xsd");
gfacXsd.setContent(XBeansUtil.xmlElementToXmlObject(GFacSimpleTypesXSD.getXml()));
serviceWSDLs[index++] = gfacXsd;
//fileidtype
XMLFile lch = XMLFile.Factory.newInstance();
lch.setFileName("lead-context.xsd");
lch.setContent(XBeansUtil.xmlElementToXmlObject(LeadContextHeaderXSD.getXml()));
serviceWSDLs[index++] = lch;
documentsType.setServiceWSDLsArray(serviceWSDLs);
// let's set the graph and the image to WSDL as any elements
WSGraph wsGraph = workflow.getGraph();