}
}
// process outputs
if (exception == null && outputs != null) {
ProcessOutputsType1 processOutputs = f.createProcessOutputsType1();
response.setProcessOutputs(processOutputs);
Map<String, Parameter<?>> resultInfo = pf.getResultInfo(processName, null);
if (request.getResponseForm() != null
&& request.getResponseForm().getResponseDocument() != null
&& request.getResponseForm().getResponseDocument().getOutput() != null
&& request.getResponseForm().getResponseDocument().getOutput().size() > 0) {
// we have a selection of outputs, possibly with indication of mime type
// and reference encoding
EList outputs = request.getResponseForm().getResponseDocument().getOutput();
for (Object object : outputs) {
DocumentOutputDefinitionType odt = (DocumentOutputDefinitionType) object;
String key = odt.getIdentifier().getValue();
Parameter<?> outputParam = resultInfo.get(key);
if (outputParam == null) {
throw new WPSException("Unknown output " + key + " possible values are: "
+ resultInfo.keySet());
}
String mimeType = odt.getMimeType();
OutputDataType output = encodeOutput(key, outputParam, mimeType, odt.isAsReference());
processOutputs.getOutput().add(output);
}
} else {
// encode all as inline for the moment
for (String key : outputs.keySet()) {
Parameter<?> outputParam = resultInfo.get(key);
OutputDataType output = encodeOutput(key, outputParam, null, false);
processOutputs.getOutput().add(output);
}
}
}
return response;