try {
query = SerializerFactory.getDeserializer("application/json").deserializeQuery(jsonEncodedQuery, getEngineInstance().getDataSource());
//query = QueryEncoder.decode(queryRecords, queryFilters, queryFilterExp, getDatamartModel());
} catch (SerializationException e) {
String message = "Impossible to decode query string comming from client";
throw new SpagoBIEngineServiceException(getActionName(), message, e);
}
Query queryBkp = getEngineInstance().getActiveQuery();
query.setId( queryBkp.getId() );
getEngineInstance().setActiveQuery(query);
result = saveAnalysisState();
getEngineInstance().setActiveQuery(queryBkp);
if(!result.trim().toLowerCase().startsWith("ok")) {
throw new SpagoBIEngineServiceException(getActionName(), result);
}
try {
writeBackToClient( new JSONSuccess( result ) );
} catch (IOException e) {
String message = "Impossible to write back the responce to the client";
throw new SpagoBIEngineServiceException(getActionName(), message, e);
}
} catch(Throwable t) {
throw SpagoBIEngineServiceExceptionHandler.getInstance().getWrappedException(getActionName(), getEngineInstance(), t);
} finally {