//JSONObject formState = new JSONObject(jsonEncodedFormState);
//logger.debug("Form state converted into a valid JSONObject: " + formState.toString(3));
JSONObject template = (JSONObject) getEngineInstance().getFormState().getConf();
logger.debug("Form viewer template retrieved.");
FormViewerQueryTransformer formViewerQueryTransformer = new FormViewerQueryTransformer();
formViewerQueryTransformer.setFormState(jsonEncodedFormState);
formViewerQueryTransformer.setTemplate(template);
logger.debug("Applying Form Viewer query transformation...");
query = formViewerQueryTransformer.execTransformation(copy);
logger.debug("Applying Form Viewer query transformation...");
return copy;
}else{
return query;
}