* instead of the WorkflowConf object. This may be offered for downloading.
* @see buildWorkflowConfFromCurrentConfiguration
* @return
*/
public String buildXMLConfigFromCurrentConfiguration(){
WorkflowConf conf = new WorkflowConf();
//1.add the template retrieved from the uploaded wfconfig
Template serTempl = this.getWeeXMLConfig().getTemplate();
Services services = new Services();
//2.browse through the servicebeans and build the Services object
for(ServiceBean sb : this.getServiceBeans()){
Service service = new Service();
service.setId(sb.getServiceId());
service.setEndpoint(sb.getServiceEndpoint());
Parameters parameters = new Parameters();
//3. iterate over all parameters that have been created/altered
for(ServiceParameter param : sb.getServiceParameters()){
Param parameter = new Param();
parameter.setName(param.getName());
parameter.setValue(param.getValue());
parameters.getParam().add(parameter);
}
if(parameters.getParam().size()>0){
//there needs to be a Parameter element only if there's a param for being xsd compliant
service.setParameters(parameters);
}
services.getService().add(service);
}
conf.setServices(services);
conf.setTemplate(serTempl);
try {
return wfConfigUtil.marshalWorkflowConfigToXMLTemplate(conf);
} catch (Exception e) {
log.debug("Unable to retrieve the XMLWorkflowConfiguration",e);