protected String renderTaskForm(Task task, InputStream template, Map<String, Object> renderContext) {
String result = null;
try {
Form form = formSerializationManager.loadFormFromXML(template);
Map inputs = new HashMap();
Map outputs;
if (task.getTaskData().getOutputContentId() == -1) outputs = new HashMap();
else outputs = (Map) renderContext.get("outputs");
Map m = (Map) renderContext.get("inputs");
if (m != null) inputs.putAll(m);
inputs.put("task", task);
FormRenderContext context = formRenderContextManager.newContext(form, task.getTaskData().getDeploymentId(), inputs, outputs);
formRenderContentMarshaller.addContentMarshaller(context.getUID(), (ContentMarshallerContext) renderContext.get("marshallerContext"));
String status = task.getTaskData().getStatus().name();
boolean readonly = !"InProgress".equals(status);
context.setReadonly(readonly);
result = context.getUID();
} catch (Exception e) {
log.warn("Error rendering form: ", e);
}
return result;
}