gpelProcess = workflow.getOdeProcess(dscURI, configuration
.getODEURL());
processString = gpelProcess.xmlStringPretty();
BufferedImage image = workflow.getImage();
WsdlDefinitions workflowWSDL = workflow.getOdeWorkflowWSDL(dscURI,
configuration.getODEURL());
// do some error checking here
if (workflowName == null || "".equals(workflowName)) {
throw new IllegalStateException("No workflow name given");
}
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