}
protected String getFormTemplateString(FormData formInstance, String formKey) {
String deploymentId = formInstance.getDeploymentId();
ResourceEntity resourceStream = Context
.getCommandContext()
.getResourceManager()
.findResourceByDeploymentIdAndResourceName(deploymentId, formKey);
ensureNotNull("Form with formKey '" + formKey + "' does not exist", "resourceStream", resourceStream);
byte[] resourceBytes = resourceStream.getBytes();
String encoding = "UTF-8";
String formTemplateString = "";
try {
formTemplateString = new String(resourceBytes, encoding);
} catch (UnsupportedEncodingException e) {